Changeset View
Changeset View
Standalone View
Standalone View
kded/qml/OsdSelector.qml
Show All 40 Lines | 39 | Row { | |||
---|---|---|---|---|---|
41 | spacing: theme.defaultFont.pointSize | 41 | spacing: theme.defaultFont.pointSize | ||
42 | 42 | | |||
43 | height: parent.height - label.height - ((units.smallSpacing/2) * 3) | 43 | height: parent.height - label.height - ((units.smallSpacing/2) * 3) | ||
44 | width: (actionRepeater.count * height) + ((actionRepeater.count - 1) * buttonRow.spacing); | 44 | width: (actionRepeater.count * height) + ((actionRepeater.count - 1) * buttonRow.spacing); | ||
45 | 45 | | |||
46 | Repeater { | 46 | Repeater { | ||
47 | id: actionRepeater | 47 | id: actionRepeater | ||
48 | property int currentIndex: 0 | 48 | property int currentIndex: 0 | ||
49 | model: [ | 49 | model: { | ||
50 | { | 50 | return OsdAction.actionOrder().map(function (layout) { | ||
51 | iconSource: "osd-shutd-laptop", | 51 | return { | ||
52 | label: i18n("Switch to external screen"), | 52 | iconSource: OsdAction.actionIconName(layout), | ||
53 | action: OsdAction.SwitchToExternal | 53 | label: OsdAction.actionLabel(layout), | ||
54 | }, | 54 | action: layout | ||
55 | { | 55 | } | ||
56 | iconSource: "osd-shutd-screen", | 56 | }); | ||
57 | label: i18n("Switch to laptop screen"), | | |||
58 | action: OsdAction.SwitchToInternal | | |||
59 | }, | | |||
60 | { | | |||
61 | iconSource: "osd-duplicate", | | |||
62 | label: i18n("Unify outputs"), | | |||
63 | action: OsdAction.Clone | | |||
64 | }, | | |||
65 | { | | |||
66 | iconSource: "osd-sbs-left", | | |||
67 | label: i18n("Extend to left"), | | |||
68 | action: OsdAction.ExtendLeft | | |||
69 | }, | | |||
70 | { | | |||
71 | iconSource: "osd-sbs-sright", | | |||
72 | label: i18n("Extend to right"), | | |||
73 | action: OsdAction.ExtendRight | | |||
74 | }, | | |||
75 | { | | |||
76 | iconSource: "dialog-cancel", | | |||
77 | label: i18n("Leave unchanged"), | | |||
78 | action: OsdAction.NoAction | | |||
79 | } | 57 | } | ||
80 | ] | | |||
81 | delegate: PlasmaComponents.Button { | 58 | delegate: PlasmaComponents.Button { | ||
82 | property var action: modelData.action | 59 | property var action: modelData.action | ||
83 | Accessible.name: modelData.label | 60 | Accessible.name: modelData.label | ||
84 | PlasmaCore.IconItem { | 61 | PlasmaCore.IconItem { | ||
85 | source: modelData.iconSource | 62 | source: modelData.iconSource | ||
86 | height: buttonRow.height - ((units.smallSpacing / 2) * 3) | 63 | height: buttonRow.height - ((units.smallSpacing / 2) * 3) | ||
87 | width: height | 64 | width: height | ||
88 | anchors.centerIn: parent | 65 | anchors.centerIn: parent | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |