mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-14 17:52:10 -04:00
Fix spacing of night mode + auto wallpaper sections
This commit is contained in:
@@ -184,7 +184,6 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
visible: SessionData.nightModeAutoEnabled
|
visible: SessionData.nightModeAutoEnabled
|
||||||
leftPadding: Theme.spacingM
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: SessionData
|
target: SessionData
|
||||||
@@ -194,13 +193,14 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: 200
|
width: parent.width
|
||||||
height: 45 + Theme.spacingM
|
height: 45 + Theme.spacingM
|
||||||
|
|
||||||
DankTabBar {
|
DankTabBar {
|
||||||
id: modeTabBarNight
|
id: modeTabBarNight
|
||||||
width: 200
|
width: 200
|
||||||
height: 45
|
height: 45
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
model: [{
|
model: [{
|
||||||
"text": "Time",
|
"text": "Time",
|
||||||
"icon": "access_time"
|
"icon": "access_time"
|
||||||
@@ -231,51 +231,54 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
property bool isTimeMode: SessionData.nightModeAutoMode === "time"
|
width: parent.width
|
||||||
visible: isTimeMode
|
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
visible: SessionData.nightModeAutoMode === "time"
|
||||||
|
|
||||||
|
Column {
|
||||||
|
spacing: Theme.spacingXS
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: ""
|
||||||
|
width: 50
|
||||||
height: 20
|
height: 20
|
||||||
leftPadding: 45
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Hour")
|
text: I18n.tr("Hour")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
width: 50
|
width: 70
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Minute")
|
text: I18n.tr("Minute")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
width: 50
|
width: 70
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
height: 32
|
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: startLabel
|
|
||||||
text: I18n.tr("Start")
|
text: I18n.tr("Start")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
width: 50
|
width: 50
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
height: 40
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
DankDropdown {
|
DankDropdown {
|
||||||
width: 60
|
dropdownWidth: 70
|
||||||
height: 32
|
|
||||||
text: ""
|
|
||||||
currentValue: SessionData.nightModeStartHour.toString()
|
currentValue: SessionData.nightModeStartHour.toString()
|
||||||
options: {
|
options: {
|
||||||
var hours = []
|
var hours = []
|
||||||
@@ -290,9 +293,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DankDropdown {
|
DankDropdown {
|
||||||
width: 60
|
dropdownWidth: 70
|
||||||
height: 32
|
|
||||||
text: ""
|
|
||||||
currentValue: SessionData.nightModeStartMinute.toString().padStart(2, '0')
|
currentValue: SessionData.nightModeStartMinute.toString().padStart(2, '0')
|
||||||
options: {
|
options: {
|
||||||
var minutes = []
|
var minutes = []
|
||||||
@@ -309,20 +310,18 @@ Item {
|
|||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
height: 32
|
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("End")
|
text: I18n.tr("End")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
width: startLabel.width
|
width: 50
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
height: 40
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
DankDropdown {
|
DankDropdown {
|
||||||
width: 60
|
dropdownWidth: 70
|
||||||
height: 32
|
|
||||||
text: ""
|
|
||||||
currentValue: SessionData.nightModeEndHour.toString()
|
currentValue: SessionData.nightModeEndHour.toString()
|
||||||
options: {
|
options: {
|
||||||
var hours = []
|
var hours = []
|
||||||
@@ -337,9 +336,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DankDropdown {
|
DankDropdown {
|
||||||
width: 60
|
dropdownWidth: 70
|
||||||
height: 32
|
|
||||||
text: ""
|
|
||||||
currentValue: SessionData.nightModeEndMinute.toString().padStart(2, '0')
|
currentValue: SessionData.nightModeEndMinute.toString().padStart(2, '0')
|
||||||
options: {
|
options: {
|
||||||
var minutes = []
|
var minutes = []
|
||||||
@@ -354,6 +351,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
property bool isLocationMode: SessionData.nightModeAutoMode === "location"
|
property bool isLocationMode: SessionData.nightModeAutoMode === "location"
|
||||||
@@ -378,16 +376,20 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
width: parent.width
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
visible: SessionData.nightModeLocationProvider !== "geoclue2"
|
||||||
|
leftPadding: Theme.spacingM
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Manual Coordinates")
|
text: I18n.tr("Manual Coordinates")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
visible: SessionData.nightModeLocationProvider !== "geoclue2"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingL
|
||||||
visible: SessionData.nightModeLocationProvider !== "geoclue2"
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
@@ -440,13 +442,14 @@ Item {
|
|||||||
text: I18n.tr("Uses sunrise/sunset times to automatically adjust night mode based on your location.")
|
text: I18n.tr("Uses sunrise/sunset times to automatically adjust night mode based on your location.")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
width: parent.width
|
width: parent.width - parent.leftPadding
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -693,6 +693,7 @@ Item {
|
|||||||
property var intervalOptions: ["1 minute", "5 minutes", "15 minutes", "30 minutes", "1 hour", "1.5 hours", "2 hours", "3 hours", "4 hours", "6 hours", "8 hours", "12 hours"]
|
property var intervalOptions: ["1 minute", "5 minutes", "15 minutes", "30 minutes", "1 hour", "1.5 hours", "2 hours", "3 hours", "4 hours", "6 hours", "8 hours", "12 hours"]
|
||||||
property var intervalValues: [60, 300, 900, 1800, 3600, 5400, 7200, 10800, 14400, 21600, 28800, 43200]
|
property var intervalValues: [60, 300, 900, 1800, 3600, 5400, 7200, 10800, 14400, 21600, 28800, 43200]
|
||||||
|
|
||||||
|
width: parent.width - parent.leftPadding
|
||||||
visible: {
|
visible: {
|
||||||
if (SessionData.perMonitorWallpaper) {
|
if (SessionData.perMonitorWallpaper) {
|
||||||
return SessionData.getMonitorCyclingSettings(selectedMonitorName).mode === "interval"
|
return SessionData.getMonitorCyclingSettings(selectedMonitorName).mode === "interval"
|
||||||
|
|||||||
@@ -20,11 +20,12 @@ Item {
|
|||||||
property int popupWidth: 0
|
property int popupWidth: 0
|
||||||
property bool alignPopupRight: false
|
property bool alignPopupRight: false
|
||||||
property int dropdownWidth: 200
|
property int dropdownWidth: 200
|
||||||
|
property bool compactMode: text === "" && description === ""
|
||||||
|
|
||||||
signal valueChanged(string value)
|
signal valueChanged(string value)
|
||||||
|
|
||||||
width: parent.width
|
width: compactMode ? dropdownWidth : parent.width
|
||||||
implicitHeight: Math.max(60, labelColumn.implicitHeight + Theme.spacingM)
|
implicitHeight: compactMode ? 40 : Math.max(60, labelColumn.implicitHeight + Theme.spacingM)
|
||||||
|
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
const popup = dropdownMenu
|
const popup = dropdownMenu
|
||||||
@@ -41,6 +42,7 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.rightMargin: Theme.spacingL
|
anchors.rightMargin: Theme.spacingL
|
||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
visible: !root.compactMode
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: root.text
|
text: root.text
|
||||||
@@ -62,7 +64,7 @@ Item {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: dropdown
|
id: dropdown
|
||||||
|
|
||||||
width: root.popupWidth === -1 ? undefined : (root.popupWidth > 0 ? root.popupWidth : root.dropdownWidth)
|
width: root.compactMode ? parent.width : (root.popupWidth === -1 ? undefined : (root.popupWidth > 0 ? root.popupWidth : root.dropdownWidth))
|
||||||
height: 40
|
height: 40
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|||||||
Reference in New Issue
Block a user