Font: added reset button for scaling

This commit is contained in:
ItsLemmy
2025-09-29 21:42:47 -04:00
parent 602d79c98e
commit d2e5d0664a
4 changed files with 58 additions and 17 deletions
+1
View File
@@ -56,6 +56,7 @@
}
},
"fonts": {
"reset-scaling": "Reset scaling",
"section": {
"label": "Fonts",
"description": "Choose the fonts used throughout the interface."
+2 -2
View File
@@ -126,7 +126,7 @@ ColumnLayout {
// Reset button container
Item {
Layout.preferredWidth: 40 * scaling
Layout.preferredWidth: 30 * scaling
Layout.preferredHeight: 30 * scaling
NIconButton {
@@ -168,7 +168,7 @@ ColumnLayout {
// Empty container to match scale row layout
Item {
Layout.preferredWidth: 40 * scaling
Layout.preferredWidth: 30 * scaling
Layout.preferredHeight: 30 * scaling
// Method text positioned in the button area
+54 -14
View File
@@ -243,14 +243,34 @@ ColumnLayout {
description: I18n.tr("settings.general.fonts.default.scale.description")
}
NValueSlider {
RowLayout {
spacing: Style.marginL * scaling
Layout.fillWidth: true
from: 0.75
to: 1.25
stepSize: 0.01
value: Settings.data.ui.fontDefaultScale
onMoved: value => Settings.data.ui.fontDefaultScale = value
text: Math.floor(Settings.data.ui.fontDefaultScale * 100) + "%"
NValueSlider {
Layout.fillWidth: true
from: 0.75
to: 1.25
stepSize: 0.01
value: Settings.data.ui.fontDefaultScale
onMoved: value => Settings.data.ui.fontDefaultScale = value
text: Math.floor(Settings.data.ui.fontDefaultScale * 100) + "%"
}
// Reset button container
Item {
Layout.preferredWidth: 30 * scaling
Layout.preferredHeight: 30 * scaling
NIconButton {
icon: "refresh"
baseSize: Style.baseWidgetSize * 0.9
tooltipText: I18n.tr("settings.general.fonts.reset-scaling")
onClicked: Settings.data.ui.fontDefaultScale = 1.0
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
@@ -260,14 +280,34 @@ ColumnLayout {
description: I18n.tr("settings.general.fonts.monospace.scale.description")
}
NValueSlider {
RowLayout {
spacing: Style.marginL * scaling
Layout.fillWidth: true
from: 0.75
to: 1.25
stepSize: 0.01
value: Settings.data.ui.fontFixedScale
onMoved: value => Settings.data.ui.fontFixedScale = value
text: Math.floor(Settings.data.ui.fontFixedScale * 100) + "%"
NValueSlider {
Layout.fillWidth: true
from: 0.75
to: 1.25
stepSize: 0.01
value: Settings.data.ui.fontFixedScale
onMoved: value => Settings.data.ui.fontFixedScale = value
text: Math.floor(Settings.data.ui.fontFixedScale * 100) + "%"
}
// Reset button container
Item {
Layout.preferredWidth: 30 * scaling
Layout.preferredHeight: 30 * scaling
NIconButton {
icon: "refresh"
baseSize: Style.baseWidgetSize * 0.9
tooltipText: I18n.tr("settings.general.fonts.reset-scaling")
onClicked: Settings.data.ui.fontFixedScale = 1.0
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ RowLayout {
text: root.text
family: Settings.data.ui.fontFixed
Layout.alignment: Qt.AlignVCenter
Layout.preferredWidth: 50 * scaling
Layout.preferredWidth: 45 * scaling
horizontalAlignment: Text.AlignRight
}
}