bar: wrap buttons in Loaders

This commit is contained in:
_xB
2025-06-12 09:01:25 +03:00
committed by GitHub
parent c3fa00b5c6
commit af409dc0c9
+48 -49
View File
@@ -22,65 +22,64 @@ Rectangle {
spacing: 4
anchors.centerIn: parent
CircleUtilButton {
Layout.alignment: Qt.AlignVCenter
onClicked: Hyprland.dispatch("exec hyprshot --freeze --clipboard-only --mode region --silent")
visible: ConfigOptions.bar.utilButtons.showScreenSnip
MaterialSymbol {
horizontalAlignment: Qt.AlignHCenter
fill: 1
text: "screenshot_region"
iconSize: Appearance.font.pixelSize.large
color: Appearance.colors.colOnLayer2
Loader {
active: ConfigOptions.bar.utilButtons.showScreenSnip
sourceComponent: CircleUtilButton {
Layout.alignment: Qt.AlignVCenter
onClicked: Hyprland.dispatch("exec hyprshot --freeze --clipboard-only --mode region --silent")
MaterialSymbol {
horizontalAlignment: Qt.AlignHCenter
fill: 1
text: "screenshot_region"
iconSize: Appearance.font.pixelSize.large
color: Appearance.colors.colOnLayer2
}
}
}
// CircleUtilButton {
// Layout.alignment: Qt.AlignVCenter
// onClicked: Hyprland.dispatch("exec hyprpicker -a")
// visible: ConfigOptions.bar.utilButtons.showColorPicker
// MaterialSymbol {
// horizontalAlignment: Qt.AlignHCenter
// fill: 1
// text: "colorize"
// iconSize: Appearance.font.pixelSize.large
// color: Appearance.colors.colOnLayer2
// Loader {
// active: ConfigOptions.bar.utilButtons.showColorPicker
// sourceComponent: CircleUtilButton {
// Layout.alignment: Qt.AlignVCenter
// onClicked: Hyprland.dispatch("exec hyprpicker -a")
// MaterialSymbol {
// horizontalAlignment: Qt.AlignHCenter
// fill: 1
// text: "colorize"
// iconSize: Appearance.font.pixelSize.large
// color: Appearance.colors.colOnLayer2
// }
// }
// }
CircleUtilButton {
Layout.alignment: Qt.AlignVCenter
onClicked: Hyprland.dispatch("global quickshell:oskToggle")
visible: ConfigOptions.bar.utilButtons.showKeyboardToggle
MaterialSymbol {
horizontalAlignment: Qt.AlignHCenter
fill: 0
text: "keyboard"
iconSize: Appearance.font.pixelSize.large
color: Appearance.colors.colOnLayer2
Loader {
active: ConfigOptions.bar.utilButtons.showKeyboardToggle
sourceComponent: CircleUtilButton {
Layout.alignment: Qt.AlignVCenter
onClicked: Hyprland.dispatch("global quickshell:oskToggle")
MaterialSymbol {
horizontalAlignment: Qt.AlignHCenter
fill: 0
text: "keyboard"
iconSize: Appearance.font.pixelSize.large
color: Appearance.colors.colOnLayer2
}
}
}
CircleUtilButton {
Layout.alignment: Qt.AlignVCenter
onClicked: Hyprland.dispatch("exec wpctl set-mute @DEFAULT_SOURCE@ toggle")
visible: ConfigOptions.bar.utilButtons.showMicToggle && Pipewire.defaultAudioSource?.audio
MaterialSymbol {
horizontalAlignment: Qt.AlignHCenter
fill: 0
text: Pipewire.defaultAudioSource?.audio?.muted ? "mic_off" : "mic"
iconSize: Appearance.font.pixelSize.large
color: Appearance.colors.colOnLayer2
Loader {
active: ConfigOptions.bar.utilButtons.showMicToggle
sourceComponent: CircleUtilButton {
Layout.alignment: Qt.AlignVCenter
onClicked: Hyprland.dispatch("exec wpctl set-mute @DEFAULT_SOURCE@ toggle")
MaterialSymbol {
horizontalAlignment: Qt.AlignHCenter
fill: 0
text: Pipewire.defaultAudioSource?.audio?.muted ? "mic_off" : "mic"
iconSize: Appearance.font.pixelSize.large
color: Appearance.colors.colOnLayer2
}
}
}
}
}