Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindecoration/package/contents/ui/Buttons.qml
Show All 33 Lines | 33 | KDecoration.Bridge { | |||
---|---|---|---|---|---|
34 | id: bridgeItem | 34 | id: bridgeItem | ||
35 | plugin: "org.kde.breeze" | 35 | plugin: "org.kde.breeze" | ||
36 | } | 36 | } | ||
37 | KDecoration.Settings { | 37 | KDecoration.Settings { | ||
38 | id: settingsItem | 38 | id: settingsItem | ||
39 | bridge: bridgeItem.bridge | 39 | bridge: bridgeItem.bridge | ||
40 | } | 40 | } | ||
41 | 41 | | |||
42 | KDecoration.DecorationPalete { | ||||
43 | id: decoPalette | ||||
44 | bridge: bridgeItem.bridge | ||||
45 | } | ||||
46 | | ||||
42 | Rectangle { | 47 | Rectangle { | ||
43 | Layout.fillWidth: true | 48 | Layout.fillWidth: true | ||
44 | color: palette.base | 49 | color: palette.base | ||
45 | radius: units.smallSpacing | 50 | radius: units.smallSpacing | ||
46 | height: fakeWindow.height | 51 | height: fakeWindow.height | ||
47 | Layout.margins: units.smallSpacing | 52 | Layout.margins: units.smallSpacing | ||
48 | 53 | | |||
49 | ColumnLayout { | 54 | ColumnLayout { | ||
50 | id: fakeWindow | 55 | id: fakeWindow | ||
51 | width: parent.width | 56 | width: parent.width | ||
52 | 57 | | |||
53 | Rectangle { | 58 | Rectangle { | ||
54 | id: titleBar | 59 | id: titleBar | ||
55 | Layout.fillWidth: true | 60 | Layout.fillWidth: true | ||
56 | height: buttonPreviewRow.height + 2 * titleBarSpacing | 61 | height: buttonPreviewRow.height + 2 * titleBarSpacing | ||
57 | radius: units.smallSpacing | 62 | radius: units.smallSpacing | ||
58 | gradient: Gradient { | 63 | color: decoPalette.titleBarColor | ||
59 | GradientStop { position: 0.0; color: palette.midlight } | | |||
60 | GradientStop { position: 1.0; color: palette.window } | | |||
61 | } | | |||
62 | 64 | | |||
63 | RowLayout { | 65 | RowLayout { | ||
64 | id: buttonPreviewRow | 66 | id: buttonPreviewRow | ||
65 | anchors { | 67 | anchors { | ||
66 | margins: titleBarSpacing | 68 | margins: titleBarSpacing | ||
67 | left: parent.left | 69 | left: parent.left | ||
68 | right: parent.right | 70 | right: parent.right | ||
69 | top: parent.top | 71 | top: parent.top | ||
70 | } | 72 | } | ||
71 | 73 | | |||
72 | ButtonGroup { | 74 | ButtonGroup { | ||
73 | id: leftButtonsView | 75 | id: leftButtonsView | ||
74 | iconSize: buttonIconSize | 76 | iconSize: buttonIconSize | ||
75 | model: kcm.leftButtonsModel | 77 | model: kcm.leftButtonsModel | ||
76 | key: "decoButtonLeft" | 78 | key: "decoButtonLeft" | ||
77 | } | 79 | } | ||
78 | Controls.Label { | 80 | Controls.Label { | ||
79 | id: titleBarLabel | 81 | id: titleBarLabel | ||
80 | Layout.fillWidth: true | 82 | Layout.fillWidth: true | ||
81 | horizontalAlignment: Text.AlignHCenter | 83 | horizontalAlignment: Text.AlignHCenter | ||
82 | font.bold: true | 84 | font.bold: true | ||
85 | color: decoPalette.foregroundColor | ||||
83 | text: i18n("Titlebar") | 86 | text: i18n("Titlebar") | ||
84 | } | 87 | } | ||
85 | ButtonGroup { | 88 | ButtonGroup { | ||
86 | id: rightButtonsView | 89 | id: rightButtonsView | ||
87 | iconSize: buttonIconSize | 90 | iconSize: buttonIconSize | ||
88 | model: kcm.rightButtonsModel | 91 | model: kcm.rightButtonsModel | ||
89 | key: "decoButtonRight" | 92 | key: "decoButtonRight" | ||
90 | } | 93 | } | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 161 | delegate: Item { | |||
159 | id: availableDelegate | 162 | id: availableDelegate | ||
160 | Layout.margins: units.largeSpacing | 163 | Layout.margins: units.largeSpacing | ||
161 | width: availableButtonsGrid.cellWidth | 164 | width: availableButtonsGrid.cellWidth | ||
162 | height: availableButtonsGrid.cellHeight | 165 | height: availableButtonsGrid.cellHeight | ||
163 | opacity: (leftButtonsView.dragging || rightButtonsView.dragging) ? 0.25 : 1.0 | 166 | opacity: (leftButtonsView.dragging || rightButtonsView.dragging) ? 0.25 : 1.0 | ||
164 | Rectangle { | 167 | Rectangle { | ||
165 | id: availableButtonFrame | 168 | id: availableButtonFrame | ||
166 | anchors.horizontalCenter: parent.horizontalCenter | 169 | anchors.horizontalCenter: parent.horizontalCenter | ||
167 | color: palette.window | | |||
168 | radius: units.smallSpacing | 170 | radius: units.smallSpacing | ||
169 | width: buttonIconSize + units.largeSpacing | 171 | width: buttonIconSize + units.largeSpacing | ||
170 | height: buttonIconSize + units.largeSpacing | 172 | height: buttonIconSize + units.largeSpacing | ||
173 | color: decoPalette.titleBarColor | ||||
171 | 174 | | |||
172 | KDecoration.Button { | 175 | KDecoration.Button { | ||
173 | id: availableButton | 176 | id: availableButton | ||
174 | anchors.centerIn: Drag.active ? undefined : availableButtonFrame | 177 | anchors.centerIn: Drag.active ? undefined : availableButtonFrame | ||
175 | bridge: bridgeItem.bridge | 178 | bridge: bridgeItem.bridge | ||
176 | settings: settingsItem | 179 | settings: settingsItem | ||
177 | type: model["button"] | 180 | type: model["button"] | ||
178 | width: buttonIconSize | 181 | width: buttonIconSize | ||
179 | height: buttonIconSize | 182 | height: buttonIconSize | ||
180 | Drag.keys: [ "decoButtonAdd" ] | 183 | Drag.keys: [ "decoButtonAdd" ] | ||
181 | Drag.active: dragArea.drag.active | 184 | Drag.active: dragArea.drag.active | ||
182 | color: palette.windowText | | |||
183 | } | 185 | } | ||
184 | MouseArea { | 186 | MouseArea { | ||
185 | id: dragArea | 187 | id: dragArea | ||
186 | anchors.fill: availableButton | 188 | anchors.fill: availableButton | ||
187 | drag.target: availableButton | 189 | drag.target: availableButton | ||
188 | cursorShape: Qt.SizeAllCursor | 190 | cursorShape: Qt.SizeAllCursor | ||
189 | onReleased: { | 191 | onReleased: { | ||
190 | if (availableButton.Drag.target) { | 192 | if (availableButton.Drag.target) { | ||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |