minor fixes and icons
This commit is contained in:
parent
2f6f940b76
commit
cf4696fe04
10 changed files with 82 additions and 11 deletions
|
|
@ -3,6 +3,7 @@ import Quickshell.Hyprland
|
|||
import QtQuick
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
WrapperRectangle {
|
||||
id: root
|
||||
|
|
@ -10,6 +11,7 @@ WrapperRectangle {
|
|||
color: Colors.base01
|
||||
required property int barHeight
|
||||
required property double vertMargin
|
||||
radius: Config.rounding
|
||||
topMargin: vertMargin
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import Quickshell.Widgets
|
|||
import QtQuick
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
WrapperRectangle {
|
||||
id: root
|
||||
|
|
@ -14,6 +15,7 @@ WrapperRectangle {
|
|||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
radius: Config.rounding
|
||||
SystemClock {
|
||||
id: clock
|
||||
precision: SystemClock.Seconds
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import QtQuick
|
|||
import QtQuick.Layouts
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
WrapperRectangle {
|
||||
id: root
|
||||
|
|
@ -16,6 +17,7 @@ WrapperRectangle {
|
|||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
color: Colors.base01
|
||||
radius: Config.rounding
|
||||
function findSpotify() {
|
||||
for (let i = 0; i < Mpris.players.values.length; i++) {
|
||||
let current = Mpris.players.values[i];
|
||||
|
|
@ -25,7 +27,22 @@ WrapperRectangle {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
StyledText {
|
||||
text: root.spotify?.trackTitle + " - " + root.spotify?.trackArtists
|
||||
child: WrapperMouseArea {
|
||||
id: clickHandler
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: mouse => {
|
||||
if (mouse.button == Qt.RightButton) {
|
||||
root.spotify.togglePlaying();
|
||||
}
|
||||
}
|
||||
child: RowLayout {
|
||||
MaterialIcon {
|
||||
text: "music_note_2"
|
||||
}
|
||||
StyledText {
|
||||
text: root.spotify?.trackTitle + " - " + root.spotify?.trackArtists
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import Quickshell.Services.Pipewire
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
WrapperRectangle {
|
||||
id: root
|
||||
|
|
@ -10,16 +12,39 @@ WrapperRectangle {
|
|||
required property int barHeight
|
||||
property double vertMargin: barHeight / 4 - 4
|
||||
property PwNode defaultAudio: Pipewire.ready ? Pipewire.preferredDefaultAudioSink : null
|
||||
property string status: defaultAudio?.audio.muted ? "mut " : "vol "
|
||||
property bool mute: Pipewire.ready ? defaultAudio?.audio.muted : null
|
||||
radius: Config.rounding
|
||||
topMargin: vertMargin
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
function getVolumeIcon() {
|
||||
let volume = Pipewire.ready ? root.defaultAudio.audio.volume : null;
|
||||
if (root.mute) {
|
||||
return "\ue04f";
|
||||
}
|
||||
if (volume <= 0.33) {
|
||||
return "\ue04e";
|
||||
}
|
||||
if (volume <= 0.66) {
|
||||
return "\ue04d";
|
||||
}
|
||||
if (volume >= 0.66) {
|
||||
return "\ue050";
|
||||
}
|
||||
}
|
||||
PwObjectTracker {
|
||||
objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null]
|
||||
}
|
||||
child: StyledText {
|
||||
text: root.status + Math.floor(root.defaultAudio?.audio.volume * 100) + "%"
|
||||
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0
|
||||
child: RowLayout {
|
||||
spacing: 4
|
||||
MaterialIcon {
|
||||
text: root.getVolumeIcon()
|
||||
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0
|
||||
}
|
||||
StyledText {
|
||||
text: Math.floor(root.defaultAudio?.audio.volume * 100) + "%"
|
||||
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
import Quickshell
|
||||
import Quickshell.Services.SystemTray
|
||||
import Quickshell.DBusMenu
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
WrapperRectangle {
|
||||
id: root
|
||||
|
|
@ -15,6 +14,7 @@ WrapperRectangle {
|
|||
required property int barHeight
|
||||
property double vertMargin: barHeight / 4 - 4
|
||||
topMargin: vertMargin
|
||||
radius: Config.rounding
|
||||
bottomMargin: vertMargin
|
||||
leftMargin: 8
|
||||
rightMargin: 8
|
||||
|
|
|
|||
|
|
@ -6,13 +6,15 @@ import QtQuick
|
|||
import QtQuick.Layouts
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
WrapperRectangle {
|
||||
id: root
|
||||
required property ShellScreen barScreen
|
||||
required property int barHeight
|
||||
readonly property double vertMargin: barHeight / 4 - 4
|
||||
property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen)
|
||||
property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen)
|
||||
radius: Config.rounding
|
||||
color: Colors.base01
|
||||
topMargin: vertMargin
|
||||
bottomMargin: vertMargin
|
||||
|
|
@ -20,6 +22,7 @@ WrapperRectangle {
|
|||
rightMargin: 8
|
||||
child: RowLayout {
|
||||
id: wsLayout
|
||||
spacing: 8
|
||||
Repeater {
|
||||
id: wsRepeater
|
||||
model: Hyprland.workspaces
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@ IpcHandler {
|
|||
Config.font = newFont;
|
||||
}
|
||||
|
||||
function setIconSize(newSize: int) {
|
||||
Config.iconSize = newSize;
|
||||
}
|
||||
|
||||
function setFontSize(newSize: int) {
|
||||
Config.fontSize = newSize;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue