Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/ListItemBase.qml
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 34 | PlasmaComponents.ListItem { | |||
---|---|---|---|---|---|
47 | ListView.delayRemove: dragArea.dragActive | 47 | ListView.delayRemove: dragArea.dragActive | ||
48 | 48 | | |||
49 | Item { | 49 | Item { | ||
50 | width: parent.width | 50 | width: parent.width | ||
51 | height: rowLayout.height | 51 | height: rowLayout.height | ||
52 | 52 | | |||
53 | RowLayout { | 53 | RowLayout { | ||
54 | id: rowLayout | 54 | id: rowLayout | ||
55 | width: parent.width | 55 | anchors.left: parent.left | ||
56 | anchors.right: parent.right | ||||
57 | anchors.rightMargin: LayoutMirroring.enabled ? 0 : units.smallSpacing | ||||
58 | anchors.leftMargin: LayoutMirroring.enabled ? units.smallSpacing : 0 | ||||
56 | spacing: units.smallSpacing | 59 | spacing: units.smallSpacing | ||
57 | 60 | | |||
58 | PlasmaCore.IconItem { | 61 | PlasmaCore.IconItem { | ||
59 | id: clientIcon | 62 | id: clientIcon | ||
60 | Layout.alignment: Qt.AlignHCenter | 63 | Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter | ||
61 | Layout.preferredHeight: column.height * 0.75 | 64 | Layout.preferredHeight: column.height * 0.75 | ||
62 | Layout.preferredWidth: Layout.preferredHeight | 65 | Layout.preferredWidth: Layout.preferredHeight | ||
63 | source: "unknown" | 66 | source: "unknown" | ||
64 | 67 | | |||
65 | onSourceChanged: { | 68 | onSourceChanged: { | ||
66 | if (!valid && source != "unknown") { | 69 | if (!valid && source != "unknown") { | ||
67 | source = "unknown"; | 70 | source = "unknown"; | ||
68 | } | 71 | } | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 113 | PlasmaExtras.Heading { | |||
111 | id: textLabel | 114 | id: textLabel | ||
112 | Layout.fillWidth: true | 115 | Layout.fillWidth: true | ||
113 | height: undefined | 116 | height: undefined | ||
114 | level: 5 | 117 | level: 5 | ||
115 | opacity: 0.6 | 118 | opacity: 0.6 | ||
116 | wrapMode: Text.NoWrap | 119 | wrapMode: Text.NoWrap | ||
117 | elide: Text.ElideRight | 120 | elide: Text.ElideRight | ||
118 | } | 121 | } | ||
122 | | ||||
119 | SmallToolButton { | 123 | SmallToolButton { | ||
120 | id: contextMenuButton | 124 | id: contextMenuButton | ||
ndavis: According to the HIG, this should have title style capitalization.
https://hig.kde. | |||||
121 | icon: "application-menu" | 125 | icon: "application-menu" | ||
122 | checkable: true | 126 | checkable: true | ||
123 | onClicked: contextMenu.show() | 127 | onClicked: contextMenu.show() | ||
124 | tooltip: i18n("Show additional options for %1", textLabel.text) | 128 | tooltip: i18n("Show additional options for %1", textLabel.text) | ||
125 | } | 129 | } | ||
126 | } | 130 | } | ||
127 | 131 | | |||
128 | RowLayout { | 132 | RowLayout { | ||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | |||||
209 | } | 213 | } | ||
210 | 214 | | |||
211 | TextMetrics { | 215 | TextMetrics { | ||
212 | id: percentMetrics | 216 | id: percentMetrics | ||
213 | font: percentText.font | 217 | font: percentText.font | ||
214 | text: i18nc("only used for sizing, should be widest possible string", "100%") | 218 | text: i18nc("only used for sizing, should be widest possible string", "100%") | ||
215 | } | 219 | } | ||
216 | } | 220 | } | ||
221 | | ||||
222 | RowLayout { | ||||
223 | Layout.fillWidth: true | ||||
224 | | ||||
225 | Item { | ||||
226 | Layout.fillWidth: true | ||||
227 | } | ||||
228 | | ||||
229 | PlasmaComponents.Button { | ||||
230 | text: PulseObject.default ? i18n("Default Device") : i18n("Make Default") | ||||
GB_2: "Default Device" | |||||
231 | iconName: PulseObject.default ? "favorite" : "" | ||||
GB_2: What about always showing the icon? | |||||
I tried that, but it looked sort of weird. I kind of like how the presence of the icon helps to show what's the default device. ngraham: I tried that, but it looked sort of weird. I kind of like how the presence of the icon helps to… | |||||
GB_2: Maybe you can also use `star-shape` | |||||
232 | enabled: !PulseObject.default | ||||
233 | visible: (type == "sink" && sinkView.model.count > 1) || (type == "source" && sourceView.model.count > 1) | ||||
234 | onClicked: PulseObject.default = true; | ||||
235 | } | ||||
236 | } | ||||
217 | } | 237 | } | ||
218 | } | 238 | } | ||
219 | 239 | | |||
220 | DragAndDrop.DropArea { | 240 | DragAndDrop.DropArea { | ||
221 | id: dropArea | 241 | id: dropArea | ||
222 | anchors.fill: parent | 242 | anchors.fill: parent | ||
223 | enabled: draggedStream | 243 | enabled: draggedStream | ||
224 | 244 | | |||
Show All 35 Lines | 266 | PlasmaComponents.ContextMenu { | |||
260 | } | 280 | } | ||
261 | function newMenuItem() { | 281 | function newMenuItem() { | ||
262 | return Qt.createQmlObject("import org.kde.plasma.components 2.0 as PlasmaComponents; PlasmaComponents.MenuItem {}", contextMenu); | 282 | return Qt.createQmlObject("import org.kde.plasma.components 2.0 as PlasmaComponents; PlasmaComponents.MenuItem {}", contextMenu); | ||
263 | } | 283 | } | ||
264 | 284 | | |||
265 | function loadDynamicActions() { | 285 | function loadDynamicActions() { | ||
266 | contextMenu.clearMenuItems(); | 286 | contextMenu.clearMenuItems(); | ||
267 | 287 | | |||
268 | // Mute | | |||
269 | var menuItem = newMenuItem(); | | |||
270 | menuItem.text = i18nc("Checkable switch for (un-)muting sound output.", "Mute"); | | |||
271 | menuItem.checkable = true; | | |||
272 | menuItem.checked = Muted; | | |||
273 | menuItem.clicked.connect(function() { | | |||
274 | Muted = !Muted | | |||
275 | }); | | |||
276 | contextMenu.addMenuItem(menuItem); | | |||
277 | | ||||
278 | // Default | | |||
279 | if (typeof PulseObject.default === "boolean") { | | |||
280 | var menuItem = newMenuItem(); | | |||
281 | menuItem.text = i18nc("Checkable switch to change the current default output.", "Default"); | | |||
282 | menuItem.checkable = true; | | |||
283 | menuItem.checked = PulseObject.default | | |||
284 | menuItem.clicked.connect(function() { | | |||
285 | PulseObject.default = true | | |||
286 | }); | | |||
287 | contextMenu.addMenuItem(menuItem); | | |||
288 | } | | |||
289 | | ||||
290 | // Raise max volume | 288 | // Raise max volume | ||
291 | menuItem = newMenuItem(); | 289 | menuItem = newMenuItem(); | ||
292 | menuItem.text = i18n("Raise maximum volume"); | 290 | menuItem.text = i18n("Raise maximum volume"); | ||
293 | menuItem.checkable = true; | 291 | menuItem.checkable = true; | ||
294 | menuItem.checked = slider.forceRaiseMaxVolume; | 292 | menuItem.checked = slider.forceRaiseMaxVolume; | ||
295 | menuItem.clicked.connect(function() { | 293 | menuItem.clicked.connect(function() { | ||
296 | slider.forceRaiseMaxVolume = !slider.forceRaiseMaxVolume; | 294 | slider.forceRaiseMaxVolume = !slider.forceRaiseMaxVolume; | ||
297 | if (!slider.forceRaiseMaxVolume && Volume > PulseAudio.NormalVolume) { | 295 | if (!slider.forceRaiseMaxVolume && Volume > PulseAudio.NormalVolume) { | ||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |
According to the HIG, this should have title style capitalization.
https://hig.kde.org/style/writing/capitalization.html