fix: lock fetch scaling tokens

This commit is contained in:
2 * r + 2 * t 2026-06-02 21:58:51 +10:00
parent afb52ec506
commit decd0ad654
2 changed files with 15 additions and 9 deletions

View file

@ -68,8 +68,6 @@ StyledRect {
} }
RowLayout { RowLayout {
Layout.topMargin: -Tokens.spacing.extraSmall
Layout.bottomMargin: Tokens.spacing.small
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
spacing: Tokens.spacing.extraLarge spacing: Tokens.spacing.extraLarge
@ -78,7 +76,7 @@ StyledRect {
id: iconLoader id: iconLoader
Layout.fillHeight: true Layout.fillHeight: true
active: root.width > 320 active: root.width > Tokens.sizes.lock.largeLogoWidth
sourceComponent: SysInfo.isDefaultLogo ? caelestiaLogo : distroIcon sourceComponent: SysInfo.isDefaultLogo ? caelestiaLogo : distroIcon
} }
@ -86,7 +84,7 @@ StyledRect {
ColumnLayout { ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: Tokens.padding.medium Layout.topMargin: Tokens.padding.medium
Layout.bottomMargin: Tokens.padding.medium Layout.bottomMargin: iconLoader.active || colourRowLoader.active ? Tokens.padding.medium : 0
spacing: Tokens.spacing.medium spacing: Tokens.spacing.medium
Repeater { Repeater {
@ -95,13 +93,13 @@ StyledRect {
const hasBatt = UPower.displayDevice.isLaptopBattery; const hasBatt = UPower.displayDevice.isLaptopBattery;
const rHeight = root.rootHeight; const rHeight = root.rootHeight;
if (!hasBatt && rHeight > 200) if (!hasBatt && rHeight > Tokens.sizes.lock.fetch4LinesHeight)
items.push(`OS : ${SysInfo.osPrettyName || SysInfo.osName}`); items.push(`OS : ${SysInfo.osPrettyName || SysInfo.osName}`);
if (rHeight > (hasBatt ? 200 : 110)) if (rHeight > (hasBatt ? Tokens.sizes.lock.fetch4LinesHeight : Tokens.sizes.lock.fetch3LinesHeight))
items.push(`WM : ${SysInfo.wm}`); items.push(`WM : ${SysInfo.wm}`);
if (!hasBatt || rHeight > 110) if (!hasBatt || rHeight > Tokens.sizes.lock.fetch3LinesHeight)
items.push(`USER: ${SysInfo.user}`); items.push(`USER: ${SysInfo.user}`);
items.push(`UP : ${SysInfo.uptime}`); items.push(`UP : ${SysInfo.uptime}`);
@ -124,8 +122,11 @@ StyledRect {
} }
WrappedLoader { WrappedLoader {
id: colourRowLoader
Layout.topMargin: iconLoader.active ? Tokens.spacing.small : 0
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
active: root.rootHeight > 180 active: root.rootHeight > Tokens.sizes.lock.showColourBoxRowHeight
sourceComponent: RowLayout { sourceComponent: RowLayout {
id: coloursRow id: coloursRow
@ -173,6 +174,6 @@ StyledRect {
} }
component MonoText: StyledText { component MonoText: StyledText {
font: root.width > 400 ? Tokens.font.mono.medium : Tokens.font.mono.small font: root.width > Tokens.sizes.lock.largeFontWidth ? Tokens.font.mono.medium : Tokens.font.mono.small
} }
} }

View file

@ -287,6 +287,11 @@ class LockTokens : public ConfigObject {
CONFIG_PROPERTY(int, centerWidth, 600) CONFIG_PROPERTY(int, centerWidth, 600)
CONFIG_PROPERTY(int, showForecastHeight, 975) CONFIG_PROPERTY(int, showForecastHeight, 975)
CONFIG_PROPERTY(int, forecastItemWidth, 51) CONFIG_PROPERTY(int, forecastItemWidth, 51)
CONFIG_PROPERTY(int, largeLogoWidth, 320)
CONFIG_PROPERTY(int, largeFontWidth, 400)
CONFIG_PROPERTY(int, fetch4LinesHeight, 600)
CONFIG_PROPERTY(int, fetch3LinesHeight, 500)
CONFIG_PROPERTY(int, showColourBoxRowHeight, 570)
public: public:
explicit LockTokens(QObject* parent = nullptr) explicit LockTokens(QObject* parent = nullptr)