diff --git a/shell/bar/Bar.qml b/shell/bar/Bar.qml index d30bdad..e8f1ab7 100644 --- a/shell/bar/Bar.qml +++ b/shell/bar/Bar.qml @@ -73,11 +73,11 @@ Variants { Layout.fillHeight: true } - VolumeIndicator { - bar: root - Layout.preferredWidth: this.height - Layout.fillHeight: true - } + // VolumeIndicator { + // bar: root + // Layout.preferredWidth: this.height + // Layout.fillHeight: true + // } PowerMenu { bar: root diff --git a/shell/bar/Popup.qml b/shell/bar/Popup.qml index 64a96de..f8dada8 100644 --- a/shell/bar/Popup.qml +++ b/shell/bar/Popup.qml @@ -63,7 +63,7 @@ Scope { LazyLoader { id: popupLoader - active: root.shownItem != null + activeAsync: root.shownItem != null PopupWindow { id: popup diff --git a/shell/bar/control/ControlCenter.qml b/shell/bar/control/ControlCenter.qml deleted file mode 100644 index 68698bf..0000000 --- a/shell/bar/control/ControlCenter.qml +++ /dev/null @@ -1,84 +0,0 @@ -pragma ComponentBehavior: Bound - -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts -import Qt5Compat.GraphicalEffects -import Quickshell.Services.Pipewire -import Quickshell.Widgets -import qs.widgets -import qs.bar - -StyledMouseArea { - id: root - onClicked: showMenu = !showMenu - - required property var bar - property bool showMenu: false - - IconImage { - id: icon - source: "root:resources/control/controls-button.svg" - - anchors { - fill: parent - margins: 3 - } - } - - property PopupItem menu: PopupItem { - id: menu - owner: root - popup: root.bar.popup - show: root.showMenu - onClosed: root.showMenu = false - - property real padding: 10 - - implicitWidth: 275 - implicitHeight: 350 - - ColumnLayout { - id: container - spacing: 4 - - anchors { - fill: parent - margins: 8 - } - - ControlCenterCard { - title: "Wi-Fi" - description: "Wifi Network" - Layout.fillWidth: true - Layout.preferredHeight: 40 - } - - ControlCenterCard { - title: "Bluetooth" - description: "Manage bluetooth devices." - Layout.fillWidth: true - Layout.preferredHeight: 40 - } - - // ControlCenterCard { - // title: "Bluetooth" - // description: "Manage bluetooth devices." - // Layout.fillWidth: true - // Layout.preferredHeight: 40 - // } - // - // ControlCenterCard { - // title: "Bluetooth" - // description: "Manage bluetooth devices." - // Layout.fillWidth: true - // Layout.preferredHeight: 40 - // } - - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } - } - } -} diff --git a/shell/bar/control/ControlCenterCard.qml b/shell/bar/control/ControlCenterCard.qml deleted file mode 100644 index 5017202..0000000 --- a/shell/bar/control/ControlCenterCard.qml +++ /dev/null @@ -1,45 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import Quickshell.Widgets -import qs - -WrapperMouseArea { - id: root - - required property var title - required property var description - - RowLayout { - ColumnLayout { - Layout.fillWidth: true - Layout.fillHeight: true - - Text { - text: root.title - color: ShellSettings.colors.active - font.pointSize: 10 - } - - Text { - text: root.description - color: ShellSettings.colors.active.darker(2.0) - font.pointSize: 9 - } - } - - IconImage { - source: "root:resources/general/right-arrow.svg" - Layout.preferredWidth: height - Layout.fillHeight: true - Layout.alignment: Qt.AlignRight - Layout.margins: 2 - } - - // Rectangle { - // Layout.preferredWidth: height - // Layout.fillHeight: true - // Layout.alignment: Qt.AlignRight - // Layout.margins: 2 - // } - } -} diff --git a/shell/bar/volume/VolumeCard.qml b/shell/bar/volume/VolumeCard.qml index c431c30..ea085de 100644 --- a/shell/bar/volume/VolumeCard.qml +++ b/shell/bar/volume/VolumeCard.qml @@ -5,20 +5,19 @@ import QtQuick.Layouts import QtQuick.Controls import Quickshell.Widgets import Quickshell.Services.Pipewire -import qs.widgets import qs +import qs.widgets Loader { id: root - active: node != null + active: node !== null required property PwNode node - property string label: node.nickname sourceComponent: WrapperRectangle { id: comp color: ShellSettings.colors.surface_container_translucent - radius: 12 + radius: 12 margin: 6 border { @@ -26,6 +25,7 @@ Loader { color: ShellSettings.colors.active_translucent } + // property string text // property Component button // property Component icon @@ -35,48 +35,23 @@ Loader { } RowLayout { - ColumnLayout { + Slider { + value: root.node.audio.volume ?? 0 + // text: root.text + // icon: root.icon + + onValueChanged: { + // only allow changes when the node is ready other wise you will combust + if (!root.node.ready) + return; + + root.node.audio.volume = value; + } + Layout.fillWidth: true Layout.fillHeight: true - - Text { - text: root.label - color: ShellSettings.colors.active - elide: Text.ElideRight - Layout.fillWidth: true - Layout.fillHeight: true - } - - StyledSlider { - value: root.node.audio.volume ?? 0 - // text: root.text - // icon: root.icon - - onValueChanged: { - // only allow changes when the node is ready other wise you will combust - if (!root.node.ready) - return; - - root.node.audio.volume = value; - } - - Layout.fillWidth: true - Layout.fillHeight: true - } } - // StyledMouseArea { - // id: rightArrow - // Layout.preferredWidth: rightArrow.height - // // Layout.fillWidth: true - // Layout.fillHeight: true - // - // IconImage { - // source: "root:resources/general/right-arrow.svg" - // anchors.fill: parent - // } - // } - // Loader { // id: buttonLoader // sourceComponent: root.button diff --git a/shell/bar/volume/VolumeIndicator.qml b/shell/bar/volume/VolumeIndicator.qml index 20b51ef..c251c4e 100644 --- a/shell/bar/volume/VolumeIndicator.qml +++ b/shell/bar/volume/VolumeIndicator.qml @@ -6,7 +6,6 @@ import Quickshell.Widgets import Quickshell.Services.Pipewire import qs.widgets import qs.bar -import qs StyledMouseArea { id: root @@ -35,66 +34,31 @@ StyledMouseArea { implicitWidth: 300 implicitHeight: container.implicitHeight + (2 * 8) - property PwNode sink: Pipewire.defaultAudioSink - property real entryHeight: 45 + // implicitWidth: volumeMenu.implicitWidth + // implicitHeight: volumeMenu.implicitHeight + + // VolumeControl { + // id: volumeMenu + // } ColumnLayout { id: container - spacing: 4 anchors { fill: parent margins: 8 } - // Default Audio VolumeCard { - node: menu.sink + node: Pipewire.defaultAudioSink Layout.fillWidth: true - Layout.preferredHeight: menu.entryHeight + Layout.preferredHeight: 45 } - Rectangle { - color: ShellSettings.colors.active_translucent - radius: height / 2 - Layout.leftMargin: 3 - Layout.rightMargin: 3 + VolumeCard { + node: Pipewire.defaultAudioSource Layout.fillWidth: true - Layout.preferredHeight: 2 - } - - // Application Mixer - Loader { - id: sinkLoader - active: menu.sink - - Layout.fillWidth: true - Layout.preferredHeight: 5 * menu.entryHeight - - PwNodeLinkTracker { - id: linkTracker - node: menu.sink - } - - sourceComponent: ListView { - anchors.fill: parent - spacing: 6 - model: linkTracker.linkGroups - - delegate: Loader { - id: nodeLoader - active: modelData.source != null - width: ListView.view.width - height: menu.entryHeight - - required property PwLinkGroup modelData - - sourceComponent: VolumeCard { - node: nodeLoader.modelData.source - label: node.properties["media.name"] ?? "" - } - } - } + Layout.preferredHeight: 45 } } } diff --git a/shell/resources/volume/volume-full.svg b/shell/resources/volume/volume-full.svg index 19bbfb1..2c24be5 100644 --- a/shell/resources/volume/volume-full.svg +++ b/shell/resources/volume/volume-full.svg @@ -1,6 +1,6 @@ - - + + diff --git a/shell/resources/volume/volume-low.svg b/shell/resources/volume/volume-low.svg deleted file mode 100644 index 69e95e5..0000000 --- a/shell/resources/volume/volume-low.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/shell/resources/volume/volume-off.svg b/shell/resources/volume/volume-off.svg deleted file mode 100644 index f975a8b..0000000 --- a/shell/resources/volume/volume-off.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/shell/widgets/StyledSlider.qml b/shell/widgets/RoundSlider.qml similarity index 92% rename from shell/widgets/StyledSlider.qml rename to shell/widgets/RoundSlider.qml index 11b653a..0317963 100644 --- a/shell/widgets/StyledSlider.qml +++ b/shell/widgets/RoundSlider.qml @@ -8,13 +8,13 @@ import ".." Slider { id: slider implicitHeight: 8 - property var accentColor: ShellSettings.colors.active + property var accentColor: ShellSettings.colors["primary"] background: Rectangle { id: sliderContainer width: slider.availableWidth height: slider.implicitHeight - color: ShellSettings.colors.inactive + color: ShellSettings.colors["inverse_surface"] radius: 4 anchors.verticalCenter: parent.verticalCenter