increase slider visibility and remove debug logging

This commit is contained in:
2026-06-01 12:12:00 +02:00
parent 2a7cd66f40
commit ebedf4b6fe
5 changed files with 178 additions and 151 deletions
+11 -7
View File
@@ -10,31 +10,35 @@ Slider {
background: Item {
CustomRect {
anchors.bottom: parent.bottom
anchors.bottomMargin: root.implicitHeight / 6
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: root.implicitHeight / 6
bottomRightRadius: root.implicitHeight / 6
color: root.color
implicitWidth: root.handle.x - root.implicitHeight / 2
radius: Appearance.rounding.full
implicitWidth: root.handle.x - root.implicitHeight / 6
radius: root.implicitHeight / 6
topRightRadius: root.implicitHeight / 6
}
CustomRect {
anchors.bottom: parent.bottom
anchors.bottomMargin: root.implicitHeight / 6
anchors.right: parent.right
anchors.top: parent.top
anchors.topMargin: root.implicitHeight / 6
bottomLeftRadius: root.implicitHeight / 6
color: DynamicColors.tPalette.m3surfaceContainer
implicitWidth: parent.width - root.handle.x - root.handle.implicitWidth - root.implicitHeight / 2
radius: Appearance.rounding.full
color: DynamicColors.tPalette.m3surfaceContainerHighest
implicitWidth: parent.width - root.handle.x - root.handle.implicitWidth - root.implicitHeight / 6
radius: root.implicitHeight / 6
topLeftRadius: root.implicitHeight / 6
}
}
handle: CustomRect {
anchors.verticalCenter: parent.verticalCenter
color: root.color
implicitHeight: 15
implicitWidth: 5
implicitHeight: root.implicitHeight
implicitWidth: root.implicitHeight / 4.5
radius: Appearance.rounding.full
x: root.visualPosition * root.availableWidth - implicitWidth / 2
-1
View File
@@ -14,7 +14,6 @@ Scope {
function nearestThresholdAbove(p: real): var {
const thresholds = [...root.popupThresholds];
for (const perc of thresholds) {
console.log(perc.message);
if (p < perc.perc)
return perc;
}
-1
View File
@@ -164,7 +164,6 @@ CustomMouseArea {
if (root.visibilities.launcher) {
if (root.panels.dashboardWrapper.x < root.panels.launcher.x + root.panels.launcher.width) {
console.log("true");
root.visibilities.dashboard = false;
}
@@ -80,7 +80,8 @@ Item {
required property ShellScreen modelData
function applyCrop(): void {
if (!cropRectLoader.item) return;
if (!cropRectLoader.item)
return;
const cropRect = cropRectLoader.item;
// We need to calculate the exact percentage coordinates that map perfectly
@@ -97,7 +98,8 @@ Item {
}
function zoomClipRect(zoom: real): void {
if (!cropRectLoader.item) return;
if (!cropRectLoader.item)
return;
const cropRect = cropRectLoader.item;
let oldCenterX = cropRect.x + cropRect.width * 0.5;
@@ -139,8 +141,9 @@ Item {
id: zoomSlider
Layout.fillWidth: true
Layout.preferredHeight: 10
Layout.preferredHeight: 30
from: 1.0
implicitHeight: 30
to: 5.0
value: cropRectLoader.item ? cropRectLoader.item.zoom : 1.0
@@ -198,6 +201,7 @@ Item {
Loader {
id: cropRectLoader
active: scaledImg.paintedWidth > 0 && scaledImg.status == Image.Ready
sourceComponent: Component {
@@ -272,7 +276,8 @@ Item {
id: mouse
function updateCrop(mouseX, mouseY) {
if (!cropRectLoader.item) return;
if (!cropRectLoader.item)
return;
const cropRect = cropRectLoader.item;
let nx = mouseX - cropRect.width * 0.5;
+67 -47
View File
@@ -52,25 +52,25 @@ Item {
CustomRect {
Layout.fillWidth: true
Layout.preferredHeight: 42 + Appearance.spacing.smaller * 2
Layout.preferredHeight: 50 + Appearance.spacing.smaller * 2
Layout.topMargin: root.topMargin
color: DynamicColors.tPalette.m3surfaceContainer
radius: root.rounding
RowLayout {
id: outputVolume
Item {
id: sinkIcon
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.margins: Appearance.spacing.smaller
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: 15
anchors.leftMargin: Appearance.padding.normal
anchors.top: parent.top
implicitWidth: childrenRect.width
CustomRect {
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: 40
Layout.preferredWidth: 40
anchors.centerIn: parent
color: Audio.muted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
implicitHeight: 40
implicitWidth: 40
radius: Appearance.rounding.full
MaterialIcon {
@@ -92,11 +92,20 @@ Item {
}
}
}
}
ColumnLayout {
Layout.fillWidth: true
anchors.bottom: parent.bottom
anchors.bottomMargin: Appearance.padding.smallest
anchors.left: sinkIcon.right
anchors.leftMargin: Appearance.spacing.normal
anchors.right: parent.right
anchors.rightMargin: Appearance.padding.large
anchors.top: parent.top
anchors.topMargin: Appearance.padding.smaller
RowLayout {
Layout.fillHeight: true
Layout.fillWidth: true
CustomText {
@@ -114,14 +123,14 @@ Item {
CustomMouseArea {
Layout.bottomMargin: 5
Layout.fillHeight: true
Layout.fillWidth: true
Layout.preferredHeight: 10
CustomSlider {
anchors.left: parent.left
anchors.right: parent.right
color: Audio.muted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
implicitHeight: 10
implicitHeight: parent.height
value: Audio.volume
Behavior on value {
@@ -134,11 +143,10 @@ Item {
}
}
}
}
CustomClippingRect {
Layout.fillWidth: true
Layout.preferredHeight: 42 + Appearance.spacing.smaller * 2
Layout.preferredHeight: 50 + Appearance.spacing.smaller * 2
Layout.topMargin: root.topMargin
color: DynamicColors.tPalette.m3surfaceContainer
radius: root.rounding
@@ -165,20 +173,20 @@ Item {
}
}
RowLayout {
id: inputVolume
Item {
id: sourceIcon
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.margins: Appearance.spacing.smaller
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: 15
anchors.leftMargin: Appearance.padding.normal
anchors.top: parent.top
implicitWidth: childrenRect.width
CustomRect {
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: 40
Layout.preferredWidth: 40
anchors.centerIn: parent
color: Audio.sourceMuted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
implicitHeight: 40
implicitWidth: 40
radius: Appearance.rounding.full
MaterialIcon {
@@ -200,9 +208,17 @@ Item {
}
}
}
}
ColumnLayout {
Layout.fillWidth: true
anchors.bottom: parent.bottom
anchors.bottomMargin: Appearance.padding.smallest
anchors.left: sourceIcon.right
anchors.leftMargin: Appearance.spacing.normal
anchors.right: parent.right
anchors.rightMargin: Appearance.padding.large
anchors.top: parent.top
anchors.topMargin: Appearance.padding.smaller
RowLayout {
Layout.fillHeight: true
@@ -223,14 +239,14 @@ Item {
CustomMouseArea {
Layout.bottomMargin: 5
Layout.fillHeight: true
Layout.fillWidth: true
implicitHeight: 10
CustomSlider {
anchors.left: parent.left
anchors.right: parent.right
color: Audio.sourceMuted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
implicitHeight: 10
implicitHeight: parent.height
value: Audio.sourceVolume
Behavior on value {
@@ -243,7 +259,6 @@ Item {
}
}
}
}
Rectangle {
Layout.fillWidth: true
@@ -265,7 +280,7 @@ Item {
required property var modelData
Layout.fillWidth: true
Layout.preferredHeight: 42 + Appearance.spacing.smaller * 2
Layout.preferredHeight: 50 + Appearance.spacing.smaller * 2
Layout.topMargin: root.topMargin
color: DynamicColors.tPalette.m3surfaceContainer
radius: root.rounding
@@ -292,18 +307,20 @@ Item {
}
}
RowLayout {
id: layoutVolume
Item {
id: appBoxIcon
anchors.fill: parent
anchors.margins: Appearance.spacing.smaller
spacing: 15
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.leftMargin: Appearance.padding.normal
anchors.top: parent.top
implicitWidth: childrenRect.width
CustomRect {
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: 40
Layout.preferredWidth: 40
anchors.centerIn: parent
color: appBox.modelData.audio.muted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
implicitHeight: 40
implicitWidth: 40
radius: Appearance.rounding.full
MaterialIcon {
@@ -325,10 +342,7 @@ Item {
}
}
}
ColumnLayout {
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillHeight: true
}
TextMetrics {
id: metrics
@@ -338,13 +352,22 @@ Item {
text: Audio.getStreamName(appBox.modelData)
}
ColumnLayout {
anchors.bottom: parent.bottom
anchors.bottomMargin: Appearance.padding.smallest
anchors.left: appBoxIcon.right
anchors.leftMargin: Appearance.spacing.normal
anchors.right: parent.right
anchors.rightMargin: Appearance.padding.large
anchors.top: parent.top
anchors.topMargin: Appearance.padding.smaller
RowLayout {
Layout.fillHeight: true
Layout.fillWidth: true
CustomText {
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.fillHeight: true
Layout.fillWidth: true
elide: Text.ElideRight
text: metrics.elidedText
@@ -352,23 +375,21 @@ Item {
CustomText {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.fillHeight: true
font.bold: true
text: qsTr("%1").arg(appBox.modelData.audio.muted ? qsTr("Muted") : `${Math.round(appBox.modelData.audio.volume * 100)}%`)
}
}
CustomMouseArea {
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.bottomMargin: 5
Layout.fillHeight: true
Layout.fillWidth: true
implicitHeight: 10
CustomSlider {
anchors.left: parent.left
anchors.right: parent.right
color: appBox.modelData.audio.muted ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary
implicitHeight: 10
implicitHeight: parent.height
value: appBox.modelData.audio.volume
onMoved: {
@@ -380,5 +401,4 @@ Item {
}
}
}
}
}