mute source audio

This commit is contained in:
Zacharias-Brohn
2026-02-09 22:23:53 +01:00
parent 5c64cc0bb9
commit 144d763c67
11 changed files with 414 additions and 110 deletions
+7
View File
@@ -376,6 +376,13 @@ Item {
source: iconPath1 !== "" ? iconPath1 : iconPath2
Layout.alignment: Qt.AlignVCenter
implicitSize: 42
StateLayer {
radius: 1000
onClicked: {
appBox.modelData.audio.muted = !appBox.modelData.audio.muted;
}
}
}
ColumnLayout {
+6 -2
View File
@@ -18,6 +18,7 @@ RowLayout {
required property Wrapper popouts
required property PersistentProperties visibilities
required property PanelWindow bar
required property ShellScreen screen
function checkPopout(x: real): void {
const ch = childAt(x, height / 2) as WrappedLoader;
@@ -60,7 +61,7 @@ RowLayout {
// popouts.currentName = "calendar";
// popouts.currentCenter = Qt.binding( () => item.mapToItem( root, itemWidth / 2, 0 ).x );
// popouts.hasCurrent = true;
} else if ( x > (root.width / 2 + 50) && x < (root.width / 2 - 50) && Config.barConfig.popouts.activeWindow ) {
} else if ( id === "activeWindow" && Config.barConfig.popouts.activeWindow ) {
popouts.currentName = "dash";
popouts.currentCenter = root.width / 2;
popouts.hasCurrent = true;
@@ -153,7 +154,10 @@ RowLayout {
DelegateChoice {
roleValue: "activeWindow"
delegate: WrappedLoader {
sourceComponent: WindowTitle {}
sourceComponent: WindowTitle {
bar: root
monitor: Brightness.getMonitorForScreen(root.screen)
}
}
}
}
+1 -33
View File
@@ -30,7 +30,7 @@ GridLayout {
Rect {
Layout.row: 0
Layout.columnSpan: 2
Layout.preferredWidth: Config.dashboard.sizes.weatherWidth
Layout.preferredWidth: 250
Layout.fillHeight: true
radius: 8
@@ -50,38 +50,6 @@ GridLayout {
}
}
Rect {
Layout.row: 1
Layout.column: 1
Layout.columnSpan: 3
Layout.fillWidth: true
Layout.preferredHeight: 100
radius: 8
}
Rect {
Layout.row: 1
Layout.column: 4
Layout.preferredWidth: 100
Layout.fillHeight: true
radius: 8
}
Rect {
Layout.row: 0
Layout.column: 5
Layout.rowSpan: 2
Layout.preferredWidth: 100
Layout.fillHeight: true
radius: 8
}
component Rect: CustomRect {
color: DynamicColors.tPalette.m3surfaceContainer
}
+3 -14
View File
@@ -12,32 +12,21 @@ Item {
required property var wrapper
readonly property PersistentProperties state: PersistentProperties {
property int currentTab
property int currentTab: 0
property date currentDate: new Date()
reloadableId: "dashboardState"
}
readonly property real nonAnimWidth: view.implicitWidth + viewWrapper.anchors.margins * 2
readonly property real nonAnimHeight: tabs.implicitHeight + tabs.anchors.topMargin + view.implicitHeight + viewWrapper.anchors.margins * 2
readonly property real nonAnimHeight: view.implicitHeight + viewWrapper.anchors.margins * 2
implicitWidth: nonAnimWidth
implicitHeight: nonAnimHeight
Tabs {
id: tabs
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
nonAnimWidth: root.nonAnimWidth - anchors.margins * 2
state: root.state
}
ClippingRectangle {
id: viewWrapper
anchors.top: tabs.bottom
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
+68 -51
View File
@@ -1,68 +1,85 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import Quickshell.Hyprland
import qs.Helpers
import qs.Config
import qs.Components
import qs.Config
import qs.Helpers
Item {
id: root
property string currentTitle: Hypr.activeName
Layout.fillHeight: true
Layout.preferredWidth: Math.max( titleText1.implicitWidth, titleText2.implicitWidth ) + 10
required property var bar
required property Brightness.Monitor monitor
property color colour: DynamicColors.palette.m3primary
readonly property int maxHeight: {
const otherModules = bar.children.filter(c => c.id && c.item !== this && c.id !== "spacer");
const otherHeight = otherModules.reduce((acc, curr) => acc + (curr.item.nonAnimHeight ?? curr.height), 0);
// Length - 2 cause repeater counts as a child
return bar.height - otherHeight - bar.spacing * (bar.children.length - 1) - bar.vPadding * 2;
}
property Title current: text1
clip: true
implicitWidth: current.implicitWidth + current.anchors.leftMargin
implicitHeight: current.implicitHeight
property bool showFirst: true
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3primary : "white"
// Component.onCompleted: {
// Hyprland.rawEvent.connect(( event ) => {
// if (event.name === "activewindow") {
// InitialTitle.getInitialTitle( function( initialTitle ) {
// root.currentTitle = initialTitle
// })
// }
// })
// MaterialIcon {
// id: icon
//
// anchors.verticalCenter: parent.verticalCenter
//
// animate: true
// text: Icons.getAppCategoryIcon(Hypr.activeToplevel?.lastIpcObject.class, "desktop_windows")
// color: root.colour
// }
onCurrentTitleChanged: {
if (showFirst) {
titleText2.text = currentTitle
showFirst = false
} else {
titleText1.text = currentTitle
showFirst = true
Title {
id: text1
}
Title {
id: text2
}
TextMetrics {
id: metrics
text: Hypr.activeToplevel?.title ?? qsTr("Desktop")
font.pointSize: 12
font.family: "Rubik"
onTextChanged: {
const next = root.current === text1 ? text2 : text1;
next.text = elidedText;
root.current = next;
}
onElideWidthChanged: root.current.text = elidedText
}
Behavior on implicitWidth {
Anim {
duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects
}
}
CustomText {
id: titleText1
anchors.fill: parent
anchors.margins: 5
text: root.currentTitle
color: root.textColor
elide: Text.ElideRight
font.pixelSize: 16
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
opacity: root.showFirst ? 1 : 0
Behavior on opacity {
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
}
}
component Title: CustomText {
id: text
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 7
font.pointSize: metrics.font.pointSize
font.family: metrics.font.family
color: root.colour
opacity: root.current === this ? 1 : 0
width: implicitWidth
height: implicitHeight
CustomText {
id: titleText2
anchors.fill: parent
anchors.margins: 5
color: root.textColor
elide: Text.ElideRight
font.pixelSize: 16
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
opacity: root.showFirst ? 0 : 1
Behavior on opacity {
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
Anim {}
}
}
}
+68
View File
@@ -0,0 +1,68 @@
import QtQuick
import QtQuick.Layouts
import Quickshell.Hyprland
import qs.Helpers
import qs.Config
import qs.Components
Item {
id: root
property string currentTitle: Hypr.activeName
Layout.fillHeight: true
Layout.preferredWidth: Math.max( titleText1.implicitWidth, titleText2.implicitWidth ) + 10
clip: true
property bool showFirst: true
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3primary : "white"
// Component.onCompleted: {
// Hyprland.rawEvent.connect(( event ) => {
// if (event.name === "activewindow") {
// InitialTitle.getInitialTitle( function( initialTitle ) {
// root.currentTitle = initialTitle
// })
// }
// })
// }
onCurrentTitleChanged: {
if (showFirst) {
titleText2.text = currentTitle
showFirst = false
} else {
titleText1.text = currentTitle
showFirst = true
}
}
CustomText {
id: titleText1
anchors.fill: parent
anchors.margins: 5
text: root.currentTitle
color: root.textColor
elide: Text.ElideRight
font.pixelSize: 16
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
opacity: root.showFirst ? 1 : 0
Behavior on opacity {
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
}
}
CustomText {
id: titleText2
anchors.fill: parent
anchors.margins: 5
color: root.textColor
elide: Text.ElideRight
font.pixelSize: 16
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
opacity: root.showFirst ? 0 : 1
Behavior on opacity {
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
}
}
}