Changeset View
Changeset View
Standalone View
Standalone View
applets/kickoff/package/contents/ui/KickoffItem.qml
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Line(s) | 89 | ActionMenu { | |||
---|---|---|---|---|---|
94 | } | 94 | } | ||
95 | } | 95 | } | ||
96 | 96 | | |||
97 | PlasmaCore.IconItem { | 97 | PlasmaCore.IconItem { | ||
98 | id: elementIcon | 98 | id: elementIcon | ||
99 | 99 | | |||
100 | anchors { | 100 | anchors { | ||
101 | left: parent.left | 101 | left: parent.left | ||
102 | leftMargin: (units.gridUnit * 4) - units.iconSizes.medium | 102 | leftMargin: units.smallSpacing * 6 | ||
ngraham: Don't multiply by non-integer values. `units.gridUnit * 1.5` is 27, so to get roughly this… | |||||
103 | verticalCenter: parent.verticalCenter | 103 | verticalCenter: parent.verticalCenter | ||
104 | } | 104 | } | ||
105 | width: units.iconSizes.medium | 105 | width: units.iconSizes.medium | ||
106 | height: width | 106 | height: width | ||
107 | 107 | | |||
108 | animated: false | 108 | animated: false | ||
109 | usesPlasmaTheme: false | 109 | usesPlasmaTheme: false | ||
110 | 110 | | |||
111 | source: model.decoration | 111 | source: model.decoration | ||
112 | } | 112 | } | ||
113 | 113 | | |||
114 | PlasmaComponents.Label { | 114 | PlasmaComponents.Label { | ||
115 | id: titleElement | 115 | id: titleElement | ||
116 | 116 | | |||
117 | y: Math.round((parent.height - titleElement.height - ( (subTitleElement.text != "") ? subTitleElement.implicitHeight : 0) ) / 2) | 117 | y: Math.round((parent.height - titleElement.height - ( (subTitleElement.text != "") ? subTitleElement.implicitHeight : 0) ) / 2) | ||
118 | anchors { | 118 | anchors { | ||
119 | //bottom: elementIcon.verticalCenter | 119 | //bottom: elementIcon.verticalCenter | ||
120 | left: elementIcon.right | 120 | left: elementIcon.right | ||
121 | right: arrow.left | 121 | right: arrow.left | ||
122 | leftMargin: units.gridUnit | 122 | leftMargin: units.smallSpacing * 4 | ||
123 | rightMargin: units.gridUnit * 2 | 123 | rightMargin: units.smallSpacing * 6 | ||
124 | } | 124 | } | ||
125 | height: implicitHeight //undo PC2 height override, remove when porting to PC3 | 125 | height: implicitHeight //undo PC2 height override, remove when porting to PC3 | ||
126 | // TODO: games should always show the by name! | 126 | // TODO: games should always show the by name! | ||
127 | text: model.display | 127 | text: model.display | ||
128 | elide: Text.ElideRight | 128 | elide: Text.ElideRight | ||
129 | horizontalAlignment: Text.AlignLeft | 129 | horizontalAlignment: Text.AlignLeft | ||
130 | } | 130 | } | ||
131 | 131 | | |||
132 | PlasmaComponents.Label { | 132 | PlasmaComponents.Label { | ||
133 | id: subTitleElement | 133 | id: subTitleElement | ||
134 | 134 | | |||
135 | anchors { | 135 | anchors { | ||
136 | left: titleElement.left | 136 | left: titleElement.left | ||
137 | right: arrow.left | 137 | right: arrow.left | ||
138 | rightMargin: units.gridUnit * 2 | 138 | rightMargin: units.smallSpacing * 4 | ||
139 | top: titleElement.bottom | 139 | top: titleElement.bottom | ||
140 | } | 140 | } | ||
141 | height: implicitHeight | 141 | height: implicitHeight | ||
142 | 142 | | |||
143 | text: model.description | 143 | text: model.description | ||
144 | opacity: isCurrent ? 0.8 : 0.6 | 144 | opacity: isCurrent ? 0.8 : 0.6 | ||
145 | font.pointSize: theme.smallestFont.pointSize | 145 | font.pointSize: theme.smallestFont.pointSize | ||
146 | elide: Text.ElideMiddle | 146 | elide: Text.ElideMiddle | ||
147 | horizontalAlignment: Text.AlignLeft | 147 | horizontalAlignment: Text.AlignLeft | ||
148 | } | 148 | } | ||
149 | 149 | | |||
150 | PlasmaCore.SvgItem { | 150 | PlasmaCore.SvgItem { | ||
151 | id: arrow | 151 | id: arrow | ||
152 | 152 | | |||
153 | anchors { | 153 | anchors { | ||
154 | right: parent.right | 154 | right: parent.right | ||
155 | rightMargin: units.gridUnit * 2 | 155 | rightMargin: units.smallSpacing * 6 | ||
ngraham: Ditto | |||||
156 | verticalCenter: parent.verticalCenter | 156 | verticalCenter: parent.verticalCenter | ||
157 | } | 157 | } | ||
158 | 158 | | |||
159 | width: visible ? units.iconSizes.small : 0 | 159 | width: visible ? units.iconSizes.small : 0 | ||
160 | height: width | 160 | height: width | ||
161 | 161 | | |||
162 | visible: (model.hasChildren === true) | 162 | visible: (model.hasChildren === true) | ||
163 | opacity: (listItem.ListView.view.currentIndex === index) ? 1.0 : 0.4 | 163 | opacity: (listItem.ListView.view.currentIndex === index) ? 1.0 : 0.4 | ||
Show All 17 Lines |
Don't multiply by non-integer values. units.gridUnit * 1.5 is 27, so to get roughly this value without hardcoding anything, you could use units.smallSpacing * 7 (28).