forked from Shinonome/dots-hyprland
tweak osd size
This commit is contained in:
@@ -260,18 +260,19 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sizes: QtObject {
|
sizes: QtObject {
|
||||||
property int barHeight: 40
|
property real barHeight: 40
|
||||||
property int barCenterSideModuleWidth: 360
|
property real barCenterSideModuleWidth: 360
|
||||||
property int barPreferredSideSectionWidth: 400
|
property real barPreferredSideSectionWidth: 400
|
||||||
property int sidebarWidth: 450
|
property real sidebarWidth: 450
|
||||||
property int sidebarWidthExtended: 750
|
property real sidebarWidthExtended: 750
|
||||||
property int notificationPopupWidth: 410
|
property real osdWidth: 200
|
||||||
property int searchWidthCollapsed: 260
|
property real notificationPopupWidth: 410
|
||||||
property int searchWidth: 450
|
property real searchWidthCollapsed: 260
|
||||||
property int hyprlandGapsOut: 5
|
property real searchWidth: 450
|
||||||
property int elevationMargin: 7
|
property real hyprlandGapsOut: 5
|
||||||
property int fabShadowRadius: 5
|
property real elevationMargin: 7
|
||||||
property int fabHoveredShadowRadius: 7
|
property real fabShadowRadius: 5
|
||||||
|
property real fabHoveredShadowRadius: 7
|
||||||
}
|
}
|
||||||
|
|
||||||
syntaxHighlightingTheme: Appearance.m3colors.darkmode ? "Monokai" : "ayu Light"
|
syntaxHighlightingTheme: Appearance.m3colors.darkmode ? "Monokai" : "ayu Light"
|
||||||
|
|||||||
@@ -70,21 +70,18 @@ Scope {
|
|||||||
item: osdValuesWrapper
|
item: osdValuesWrapper
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitWidth: columnLayout.implicitWidth
|
implicitWidth: Appearance.sizes.osdWidth
|
||||||
implicitHeight: columnLayout.implicitHeight
|
implicitHeight: columnLayout.implicitHeight
|
||||||
visible: osdLoader.active
|
visible: osdLoader.active
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: columnLayout
|
id: columnLayout
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
Item {
|
|
||||||
height: 1 // Prevent Wayland protocol error
|
|
||||||
}
|
|
||||||
Item {
|
Item {
|
||||||
id: osdValuesWrapper
|
id: osdValuesWrapper
|
||||||
// Extra space for shadow
|
// Extra space for shadow
|
||||||
implicitHeight: true ? (osdValues.implicitHeight + Appearance.sizes.elevationMargin * 2) : 0
|
implicitHeight: osdValues.implicitHeight + Appearance.sizes.elevationMargin * 2
|
||||||
implicitWidth: osdValues.implicitWidth + Appearance.sizes.elevationMargin * 2
|
implicitWidth: osdValues.implicitWidth
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -102,8 +99,9 @@ Scope {
|
|||||||
|
|
||||||
OsdValueIndicator {
|
OsdValueIndicator {
|
||||||
id: osdValues
|
id: osdValues
|
||||||
anchors.centerIn: parent
|
anchors.fill: parent
|
||||||
value: root.brightnessMonitor.brightness
|
anchors.margins: Appearance.sizes.elevationMargin
|
||||||
|
value: root.brightnessMonitor?.brightness ?? 50
|
||||||
icon: "light_mode"
|
icon: "light_mode"
|
||||||
rotateIcon: true
|
rotateIcon: true
|
||||||
scaleIcon: true
|
scaleIcon: true
|
||||||
|
|||||||
@@ -72,21 +72,18 @@ Scope {
|
|||||||
item: osdValuesWrapper
|
item: osdValuesWrapper
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitWidth: columnLayout.implicitWidth
|
implicitWidth: Appearance.sizes.osdWidth
|
||||||
implicitHeight: columnLayout.implicitHeight
|
implicitHeight: columnLayout.implicitHeight
|
||||||
visible: osdLoader.active
|
visible: osdLoader.active
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: columnLayout
|
id: columnLayout
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
Item {
|
|
||||||
height: 1 // Prevent Wayland protocol error
|
|
||||||
}
|
|
||||||
Item {
|
Item {
|
||||||
id: osdValuesWrapper
|
id: osdValuesWrapper
|
||||||
// Extra space for shadow
|
// Extra space for shadow
|
||||||
implicitHeight: true ? (osdValues.implicitHeight + Appearance.sizes.elevationMargin * 2) : 0
|
implicitHeight: osdValues.implicitHeight + Appearance.sizes.elevationMargin * 2
|
||||||
implicitWidth: osdValues.implicitWidth + Appearance.sizes.elevationMargin * 2
|
implicitWidth: osdValues.implicitWidth
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -104,14 +101,14 @@ Scope {
|
|||||||
|
|
||||||
OsdValueIndicator {
|
OsdValueIndicator {
|
||||||
id: osdValues
|
id: osdValues
|
||||||
anchors.centerIn: parent
|
anchors.fill: parent
|
||||||
|
anchors.margins: Appearance.sizes.elevationMargin
|
||||||
value: Audio.sink?.audio.volume ?? 0
|
value: Audio.sink?.audio.volume ?? 0
|
||||||
icon: Audio.sink?.audio.muted ? "volume_off" : "volume_up"
|
icon: Audio.sink?.audio.muted ? "volume_off" : "volume_up"
|
||||||
name: qsTr("Volume")
|
name: qsTr("Volume")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,11 +21,12 @@ Item {
|
|||||||
property real valueIndicatorRightPadding: 20 // An icon is circle ish, a column isn't, hence the extra padding
|
property real valueIndicatorRightPadding: 20 // An icon is circle ish, a column isn't, hence the extra padding
|
||||||
|
|
||||||
Layout.margins: Appearance.sizes.elevationMargin
|
Layout.margins: Appearance.sizes.elevationMargin
|
||||||
implicitWidth: valueIndicator.implicitWidth
|
implicitWidth: Appearance.sizes.osdWidth
|
||||||
implicitHeight: valueIndicator.implicitHeight
|
implicitHeight: valueIndicator.implicitHeight
|
||||||
|
|
||||||
WrapperRectangle {
|
WrapperRectangle {
|
||||||
id: valueIndicator
|
id: valueIndicator
|
||||||
|
anchors.fill: parent
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
color: Appearance.colors.colLayer0
|
color: Appearance.colors.colLayer0
|
||||||
implicitWidth: valueRow.implicitWidth
|
implicitWidth: valueRow.implicitWidth
|
||||||
@@ -33,9 +34,10 @@ Item {
|
|||||||
RowLayout { // Icon on the left, stuff on the right
|
RowLayout { // Icon on the left, stuff on the right
|
||||||
id: valueRow
|
id: valueRow
|
||||||
Layout.margins: 10
|
Layout.margins: 10
|
||||||
|
anchors.fill: parent
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
implicitWidth: 30
|
implicitWidth: 30
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
@@ -86,6 +88,7 @@ Item {
|
|||||||
|
|
||||||
StyledProgressBar {
|
StyledProgressBar {
|
||||||
id: valueProgressBar
|
id: valueProgressBar
|
||||||
|
Layout.fillWidth: true
|
||||||
value: root.value
|
value: root.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user