diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-11 18:17:05 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-11 18:17:05 +0200 |
commit | cc9a3b98d143b921388725b55e99ae9e151e525b (patch) | |
tree | 5d723e81315b46172b64b414a98e6169082918f5 /framework/qml | |
parent | a767ca53c0c0722223bc6c646776456f5484b31f (diff) | |
download | kube-cc9a3b98d143b921388725b55e99ae9e151e525b.tar.gz kube-cc9a3b98d143b921388725b55e99ae9e151e525b.zip |
Ensure that all items can always be centered.
I had a gridUnit of 17, which results in icons being 1 pixel off.
Diffstat (limited to 'framework/qml')
-rw-r--r-- | framework/qml/Units.qml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/framework/qml/Units.qml b/framework/qml/Units.qml index 6d66bf5c..d583c87b 100644 --- a/framework/qml/Units.qml +++ b/framework/qml/Units.qml | |||
@@ -23,7 +23,8 @@ import QtQuick 2.7 | |||
23 | import org.kube.framework 1.0 as Kube | 23 | import org.kube.framework 1.0 as Kube |
24 | 24 | ||
25 | Item { | 25 | Item { |
26 | property int gridUnit: fontMetrics.height | 26 | //Ensure the gridUnit is divisble by 4 without remainder, otherwise we'll end up with alignment issues |
27 | property int gridUnit: Math.ceil(fontMetrics.height / 4) * 4 | ||
27 | property int smallSpacing: gridUnit/4 | 28 | property int smallSpacing: gridUnit/4 |
28 | property int largeSpacing: gridUnit | 29 | property int largeSpacing: gridUnit |
29 | 30 | ||