mobile, QML: scale font from the buttons

After the work in the previous commit, it gets very simple to implement
font scaling. Just assign a the new desired font scale to the used
font metrics. The QML engine does all the work.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2018-09-25 13:05:02 +02:00
parent c2c751c164
commit b332dd108a

View file

@ -262,6 +262,7 @@ Kirigami.ScrollablePage {
enabled: PrefDisplay.mobile_scale !== 0.85
onClicked: {
PrefDisplay.mobile_scale = 0.85
fontMetrics.font.pointSize = subsurfaceTheme.basePointSize * PrefDisplay.mobile_scale;
}
}
SsrfButton {
@ -269,6 +270,7 @@ Kirigami.ScrollablePage {
enabled: PrefDisplay.mobile_scale !== 1.0
onClicked: {
PrefDisplay.mobile_scale = 1.0
fontMetrics.font.pointSize = subsurfaceTheme.basePointSize * PrefDisplay.mobile_scale;
}
}
SsrfButton {
@ -276,6 +278,7 @@ Kirigami.ScrollablePage {
enabled: PrefDisplay.mobile_scale !== 1.15
onClicked: {
PrefDisplay.mobile_scale = 1.15
fontMetrics.font.pointSize = subsurfaceTheme.basePointSize * PrefDisplay.mobile_scale;
}
}
}