1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 06:52:50 -05:00

misc: fix some various scaling issues with fonts

fixes #1268
This commit is contained in:
bbedward
2026-01-24 22:26:59 -05:00
parent 80025804ab
commit 5f16624000
5 changed files with 197 additions and 102 deletions

View File

@@ -314,25 +314,39 @@ DankPopout {
height: Theme.spacingXS
}
StackLayout {
Item {
id: pages
width: parent.width
height: implicitHeight
implicitHeight: {
if (currentIndex === 0)
if (root.currentTabIndex === 0)
return overviewLoader.item?.implicitHeight ?? 410;
if (currentIndex === 1)
if (root.currentTabIndex === 1)
return mediaLoader.item?.implicitHeight ?? 410;
if (currentIndex === 2)
if (root.currentTabIndex === 2)
return wallpaperLoader.item?.implicitHeight ?? 410;
if (SettingsData.weatherEnabled && currentIndex === 3)
if (SettingsData.weatherEnabled && root.currentTabIndex === 3)
return weatherLoader.item?.implicitHeight ?? 410;
return 410;
}
currentIndex: root.currentTabIndex
readonly property var currentItem: {
if (root.currentTabIndex === 0)
return overviewLoader.item;
if (root.currentTabIndex === 1)
return mediaLoader.item;
if (root.currentTabIndex === 2)
return wallpaperLoader.item;
if (root.currentTabIndex === 3)
return weatherLoader.item;
return null;
}
Loader {
id: overviewLoader
anchors.fill: parent
active: root.currentTabIndex === 0
visible: active
sourceComponent: Component {
OverviewTab {
onCloseDash: root.dashVisible = false
@@ -350,7 +364,9 @@ DankPopout {
Loader {
id: mediaLoader
anchors.fill: parent
active: root.currentTabIndex === 1
visible: active
sourceComponent: Component {
MediaPlayerTab {
targetScreen: root.screen
@@ -379,7 +395,9 @@ DankPopout {
Loader {
id: wallpaperLoader
anchors.fill: parent
active: root.currentTabIndex === 2
visible: active
sourceComponent: Component {
WallpaperTab {
active: true
@@ -393,7 +411,9 @@ DankPopout {
Loader {
id: weatherLoader
anchors.fill: parent
active: SettingsData.weatherEnabled && root.currentTabIndex === 3
visible: active
sourceComponent: Component {
WeatherTab {}
}

View File

@@ -129,7 +129,7 @@ Item {
}
implicitWidth: 700
implicitHeight: 410
implicitHeight: playerContent.height + playerContent.anchors.topMargin * 2
Connections {
target: activePlayer
@@ -327,6 +327,7 @@ Item {
clip: false
visible: !_noneAvailable && (!showNoPlayerNow)
ColumnLayout {
id: playerContent
width: 484
height: 370
spacing: Theme.spacingXS

View File

@@ -12,7 +12,7 @@ Item {
LayoutMirroring.childrenInherit: true
implicitWidth: 700
implicitHeight: 410
implicitHeight: root.available ? mainColumn.implicitHeight : unavailableColumn.implicitHeight + Theme.spacingXL * 2
property bool syncing: false
function syncFrom(type) {
@@ -52,6 +52,7 @@ Item {
property bool available: WeatherService.weather.available
Column {
id: unavailableColumn
anchors.centerIn: parent
spacing: Theme.spacingL
visible: !root.available
@@ -141,6 +142,7 @@ Item {
}
Column {
id: mainColumn
anchors.fill: parent
visible: root.available
spacing: Theme.spacingXS
@@ -164,7 +166,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
// anchors.verticalCenter: parent.verticalCenter
width: weatherIcon.width + tempColumn.width + sunriseColumn.width + Theme.spacingM * 2
height: 70
height: Math.max(weatherIcon.height, tempColumn.height, sunriseColumn.height)
DankIcon {
id: weatherIcon
@@ -325,7 +327,7 @@ Item {
Item {
id: dateStepper
anchors.horizontalCenter: parent.horizontalCenter
height: 60
height: dateStepperInner.height + Theme.spacingM * 2
width: dateStepperInner.width
property var currentDate: new Date()
@@ -354,10 +356,11 @@ Item {
Item {
id: dateStepperInner
anchors.fill: parent
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
readonly property var space: Theme.spacingXS
width: yearStepper.width + monthStepper.width + dayStepper.width + hourStepper.width + minuteStepper.width + (suffix.visible ? suffix.width : 0) + 10.5 * space + 2 * dateStepperInnerPadding.width
height: Math.max(yearStepper.height, monthStepper.height, dayStepper.height, hourStepper.height, minuteStepper.height)
Item {
id: dateStepperInnerPadding
@@ -444,20 +447,15 @@ Item {
text: ":"
}
}
Rectangle {
StyledText {
id: suffix
visible: !SettingsData.use24HourClock
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenter: minuteStepper.verticalCenter
anchors.left: minuteStepper.right
anchors.leftMargin: 2 * parent.space
StyledText {
isMonospace: true
anchors.horizontalCenter: parent.horizontalCenter
text: dateStepper.splitDate[5] ?? ""
font.pixelSize: Theme.fontSizeSmall
x: -Theme.fontSizeSmall / 2
y: -Theme.fontSizeSmall / 2
}
isMonospace: true
text: dateStepper.splitDate[5] ?? ""
font.pixelSize: Theme.fontSizeSmall
}
DankActionButton {
id: dateResetButton
@@ -898,7 +896,7 @@ Item {
Row {
width: parent.width
height: 32
height: Math.max(hourlyHeader.height, denseButton.height) + Theme.spacingS
spacing: Theme.spacingS
StyledText {
@@ -928,7 +926,7 @@ Item {
Item {
width: parent.width
height: 100 + Theme.spacingXS
height: (hourlyLoader.item?.cardHeight ?? (Theme.fontSizeLarge * 6)) + Theme.spacingXS
Loader {
id: hourlyLoader
@@ -962,7 +960,7 @@ Item {
contentHeight: cardHeight
contentWidth: cardWidth
property var cardHeight: 100
property var cardHeight: Theme.fontSizeLarge * 6
property var cardWidth: ((hourlyList.width + hourlyList.spacing) / hourlyList.visibleCount) - hourlyList.spacing
property int initialIndex: (new Date()).getHours()
property bool dense: !SessionData.weatherHourlyDetailed
@@ -1038,7 +1036,7 @@ Item {
Row {
width: parent.width
height: 32
height: dailyHeader.height + Theme.spacingS
spacing: Theme.spacingS
StyledText {
@@ -1060,7 +1058,7 @@ Item {
Item {
width: parent.width
height: 100 + Theme.spacingXS
height: (dailyLoader.item?.cardHeight ?? (Theme.fontSizeLarge * 6)) + Theme.spacingXS
Loader {
id: dailyLoader
@@ -1094,7 +1092,7 @@ Item {
contentHeight: cardHeight
contentWidth: cardWidth
property var cardHeight: 100
property var cardHeight: Theme.fontSizeLarge * 6
property var cardWidth: ((dailyList.width + dailyList.spacing) / dailyList.visibleCount) - dailyList.spacing
property int initialIndex: 0
property bool dense: false