diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-12 14:08:04 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-12 14:08:04 +0200 |
commit | 0f3dc1273f2124269d19c0d1771447739b7a80f6 (patch) | |
tree | ce7abcb3667928a15202cffe81fd21a4d5e02eff | |
parent | d272cff709bbcc1d498d3f4db9ddc3bf190320e0 (diff) | |
download | kube-0f3dc1273f2124269d19c0d1771447739b7a80f6.tar.gz kube-0f3dc1273f2124269d19c0d1771447739b7a80f6.zip |
Try again to size the icons correctly.
With this I get pixel perfext icons that are properly sized (as opposed
to tiny). The toolbuttons in the messagelist still look a bit out of
place though.
Closer investigation showed that I get most icons rendered at 22px size
(that's a grid unit for me). The full button ends up being 32px.
The mark as unread button has only 24px size source and is therefore
scaled which then ends up looking blurry.
-rw-r--r-- | framework/qml/AttachmentDelegate.qml | 1 | ||||
-rw-r--r-- | framework/qml/Icon.qml | 8 | ||||
-rw-r--r-- | framework/qml/IconButton.qml | 6 |
3 files changed, 6 insertions, 9 deletions
diff --git a/framework/qml/AttachmentDelegate.qml b/framework/qml/AttachmentDelegate.qml index d4e025dc..46cf76f9 100644 --- a/framework/qml/AttachmentDelegate.qml +++ b/framework/qml/AttachmentDelegate.qml | |||
@@ -63,6 +63,7 @@ Item { | |||
63 | width: height | 63 | width: height |
64 | iconName: Kube.Icons.save_inverted | 64 | iconName: Kube.Icons.save_inverted |
65 | onClicked: root.download() | 65 | onClicked: root.download() |
66 | padding: 0 | ||
66 | } | 67 | } |
67 | } | 68 | } |
68 | } | 69 | } |
diff --git a/framework/qml/Icon.qml b/framework/qml/Icon.qml index 6dc9529f..947e69ef 100644 --- a/framework/qml/Icon.qml +++ b/framework/qml/Icon.qml | |||
@@ -22,11 +22,9 @@ Item { | |||
22 | id: root | 22 | id: root |
23 | property string iconName | 23 | property string iconName |
24 | property url iconSource | 24 | property url iconSource |
25 | property alias implicitHeight: image.implicitHeight | ||
26 | property alias implicitWidth: image.implicitWidth | ||
27 | property alias status: image.status | 25 | property alias status: image.status |
28 | width: implicitWidth | 26 | property alias implicitWidth: image.implicitWidth |
29 | height: implicitHeight | 27 | property alias implicitHeight: image.implicitHeight |
30 | 28 | ||
31 | onIconNameChanged: setImageSource() | 29 | onIconNameChanged: setImageSource() |
32 | 30 | ||
@@ -39,7 +37,7 @@ Item { | |||
39 | 37 | ||
40 | Image { | 38 | Image { |
41 | id: image | 39 | id: image |
42 | anchors.centerIn: parent | 40 | anchors.fill: parent |
43 | sourceSize.width: width | 41 | sourceSize.width: width |
44 | sourceSize.height: height | 42 | sourceSize.height: height |
45 | cache: true | 43 | cache: true |
diff --git a/framework/qml/IconButton.qml b/framework/qml/IconButton.qml index a2a9245d..b9b20102 100644 --- a/framework/qml/IconButton.qml +++ b/framework/qml/IconButton.qml | |||
@@ -24,7 +24,7 @@ import org.kube.framework 1.0 as Kube | |||
24 | T.Button { | 24 | T.Button { |
25 | id: root | 25 | id: root |
26 | 26 | ||
27 | property var iconName | 27 | property alias iconName: icon.iconName |
28 | 28 | ||
29 | width: Kube.Units.gridUnit + padding * 2 | 29 | width: Kube.Units.gridUnit + padding * 2 |
30 | height: Kube.Units.gridUnit + padding * 2 | 30 | height: Kube.Units.gridUnit + padding * 2 |
@@ -48,9 +48,7 @@ T.Button { | |||
48 | } | 48 | } |
49 | 49 | ||
50 | contentItem: Kube.Icon { | 50 | contentItem: Kube.Icon { |
51 | width: root.height - Kube.Units.smallSpacing * 2 | 51 | id: icon |
52 | height: width | ||
53 | iconName: root.iconName | ||
54 | } | 52 | } |
55 | } | 53 | } |
56 | 54 | ||