mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Theme tweaks
- gridUnits is dynamic again, using FontMetrics now - Add a page to display some sizing-relevant details, so we can debug dpi problems a bit better on Android Signed-off-by: Sebastian Kügler <sebas@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9dc8f13a0a
commit
6d3a5e6bd4
4 changed files with 35 additions and 7 deletions
15
qt-mobile/ThemeTest.qml
Normal file
15
qt-mobile/ThemeTest.qml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: themetest
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "units.gridUnit is: " + units.gridUnit
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "units.devicePixelRatio: " + units.devicePixelRatio
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -72,6 +72,13 @@ ApplicationWindow {
|
||||||
stackView.push(logWindow)
|
stackView.push(logWindow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
text: "Theme Information"
|
||||||
|
onTriggered: {
|
||||||
|
stackView.push(themetest)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StackView {
|
StackView {
|
||||||
|
@ -201,6 +208,11 @@ ApplicationWindow {
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThemeTest {
|
||||||
|
id: themetest
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
print("units.gridUnit is: " + units.gridUnit);
|
print("units.gridUnit is: " + units.gridUnit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<file>DownloadFromDiveComputer.qml</file>
|
<file>DownloadFromDiveComputer.qml</file>
|
||||||
<file>Log.qml</file>
|
<file>Log.qml</file>
|
||||||
<file>TopBar.qml</file>
|
<file>TopBar.qml</file>
|
||||||
|
<file>ThemeTest.qml</file>
|
||||||
<file alias="subsurface-mobile-icon.png">../icons/subsurface-mobile-icon.png</file>
|
<file alias="subsurface-mobile-icon.png">../icons/subsurface-mobile-icon.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/qml/theme">
|
<qresource prefix="/qml/theme">
|
||||||
|
|
|
@ -31,7 +31,7 @@ QtObject {
|
||||||
* Given the screen has an accurate DPI settings, it corresponds to a width of
|
* Given the screen has an accurate DPI settings, it corresponds to a width of
|
||||||
* the capital letter M
|
* the capital letter M
|
||||||
*/
|
*/
|
||||||
property int gridUnit: 20
|
property int gridUnit: fontMetrics.height
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* units.iconSizes provides access to platform-dependent icon sizing
|
* units.iconSizes provides access to platform-dependent icon sizing
|
||||||
|
@ -95,8 +95,8 @@ QtObject {
|
||||||
*/
|
*/
|
||||||
property int shortDuration: 150
|
property int shortDuration: 150
|
||||||
|
|
||||||
// property QtObject fontMetrics: FontMetrics {
|
property QtObject fontMetrics: FontMetrics {
|
||||||
// //id: textSpacer
|
//id: textSpacer
|
||||||
// //text: "M"
|
//text: "M"
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue