/usr/share/plasma/shells/org.kde.plasma.mediacenter/contents/configuration/panelconfiguration/ToolBar.qml is in plasma-mediacenter 4:5.5.5-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | /*
* Copyright 2013 Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import QtQuick 2.0
import QtQuick.Layouts 1.0
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.configuration 2.0
Item {
id: root
state: parent.state
implicitWidth: units.gridUnit * 10
implicitHeight: row.height + 20
readonly property string addWidgetsButtonText: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Add Widgets...")
readonly property string addSpacerButtonText: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Add Spacer")
readonly property string settingsButtonText: i18nd("plasma_shell_org.kde.plasma.mediacenter", "More Settings...")
GridLayout {
id: row
columns: dialogRoot.vertical ? 1 : 2
rows: dialogRoot.vertical ? 2 : 1
anchors.centerIn: parent
rowSpacing: units.smallSpacing
columnSpacing: units.smallSpacing
EdgeHandle {}
SizeHandle {}
}
PlasmaComponents.Label {
id: placeHolder
visible: false
text: addWidgetsButtonText + addSpacerButtonText + settingsButtonText
}
Connections {
target: configDialog
onVisibleChanged: {
if (!configDialog.visible) {
contextMenu.visible = false;
}
}
}
GridLayout {
id: buttonsLayout
rows: 1
columns: 1
flow: plasmoid.formFactor == PlasmaCore.Types.Horizontal ? GridLayout.TopToBottom : GridLayout.LeftToRight
anchors.margins: rowSpacing
property bool showText: plasmoid.formFactor == PlasmaCore.Types.Vertical || (row.x + row.width < root.width - placeHolder.width - units.iconSizes.small*4 - units.largeSpacing*5)
rowSpacing: units.smallSpacing
columnSpacing: units.smallSpacing
PlasmaComponents.Button {
text: buttonsLayout.showText ? root.addWidgetsButtonText : ""
tooltip: buttonsLayout.showText ? "" : root.addWidgetsButtonText
iconSource: "list-add"
Layout.preferredWidth: panel.formFactor == PlasmaCore.Types.Vertical ? Math.max(implicitWidth, parent.width) : implicitWidth
onClicked: {
configDialog.close();
configDialog.showAddWidgetDialog();
}
}
PlasmaComponents.Button {
iconSource: "distribute-horizontal-x"
text: buttonsLayout.showText ? root.addSpacerButtonText : ""
tooltip: buttonsLayout.showText ? "" : root.addSpacerButtonText
Layout.preferredWidth: panel.formFactor == PlasmaCore.Types.Vertical ? Math.max(implicitWidth, parent.width) : implicitWidth
onClicked: {
configDialog.addPanelSpacer();
}
}
PlasmaComponents.Button {
id: settingsButton
iconSource: "configure"
text: buttonsLayout.showText ? root.settingsButtonText : ""
tooltip: buttonsLayout.showText ? "" : root.settingsButtonText
Layout.preferredWidth: panel.formFactor == PlasmaCore.Types.Vertical ? Math.max(implicitWidth, parent.width) : implicitWidth
onClicked: {
contextMenu.visible = !contextMenu.visible;
}
}
PlasmaComponents.ToolButton {
parent: plasmoid.formFactor == PlasmaCore.Types.Horizontal ? buttonsLayout : root
anchors.right: plasmoid.formFactor == PlasmaCore.Types.Horizontal ? undefined : parent.right
iconSource: "window-close"
tooltip: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Close")
onClicked: {
configDialog.close()
}
}
PlasmaCore.Dialog {
id: contextMenu
visualParent: settingsButton
location: plasmoid.location
type: PlasmaCore.Dialog.PopupMenu
flags: Qt.Popup | Qt.FramelessWindowHint | Qt.WindowDoesNotAcceptFocus
mainItem: ColumnLayout {
id: menuColumn
Layout.minimumWidth: menuColumn.implicitWidth
Layout.minimumHeight: menuColumn.implicitHeight
spacing: units.smallSpacing
PlasmaExtras.Heading {
level: 3
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Panel Alignment")
}
PlasmaComponents.ButtonColumn {
spacing: 0
Layout.fillWidth: true
PlasmaComponents.ToolButton {
anchors {
left: parent.left
right: parent.right
}
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Left")
checkable: true
checked: panel.alignment == Qt.AlignLeft
onClicked: panel.alignment = Qt.AlignLeft
flat: false
}
PlasmaComponents.ToolButton {
anchors {
left: parent.left
right: parent.right
}
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Center")
checkable: true
checked: panel.alignment == Qt.AlignCenter
onClicked: panel.alignment = Qt.AlignCenter
flat: false
}
PlasmaComponents.ToolButton {
anchors {
left: parent.left
right: parent.right
}
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Right")
checkable: true
checked: panel.alignment == Qt.AlignRight
onClicked: panel.alignment = Qt.AlignRight
flat: false
}
}
PlasmaExtras.Heading {
level: 3
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Visibility")
}
PlasmaComponents.ButtonColumn {
spacing: 0
Layout.fillWidth: true
PlasmaComponents.ToolButton {
anchors {
left: parent.left
right: parent.right
}
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Always Visible")
checkable: true
checked: configDialog.visibilityMode == 0
onClicked: configDialog.visibilityMode = 0
flat: false
}
PlasmaComponents.ToolButton {
anchors {
left: parent.left
right: parent.right
}
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Auto Hide")
checkable: true
checked: configDialog.visibilityMode == 1
onClicked: configDialog.visibilityMode = 1
flat: false
}
PlasmaComponents.ToolButton {
anchors {
left: parent.left
right: parent.right
}
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Windows Can Cover")
checkable: true
checked: configDialog.visibilityMode == 2
onClicked: configDialog.visibilityMode = 2
flat: false
}
PlasmaComponents.ToolButton {
anchors {
left: parent.left
right: parent.right
}
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Windows Go Below")
checkable: true
checked: configDialog.visibilityMode == 3
onClicked: configDialog.visibilityMode = 3
flat: false
}
}
PlasmaComponents.ToolButton {
Layout.fillWidth: true
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Maximize Panel")
iconSource: panel.formFactor == PlasmaCore.Types.Vertical ? "zoom-fit-height" : "zoom-fit-width"
onClicked: panel.maximize();
}
PlasmaComponents.ToolButton {
Layout.fillWidth: true
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Lock Widgets")
iconSource: "document-encrypt"
onClicked: {
plasmoid.action("lock widgets").trigger();
configDialog.close();
}
}
PlasmaComponents.ToolButton {
Layout.fillWidth: true
text: i18nd("plasma_shell_org.kde.plasma.mediacenter", "Remove Panel")
iconSource: "window-close"
onClicked: {
contextMenu.visible = false;
plasmoid.action("remove").trigger();
}
}
}
}
}
//BEGIN States
states: [
State {
name: "TopEdge"
PropertyChanges {
target: root
height: root.implicitHeight
}
AnchorChanges {
target: root
anchors {
top: undefined
bottom: root.parent.bottom
left: root.parent.left
right: root.parent.right
}
}
AnchorChanges {
target: buttonsLayout
anchors {
verticalCenter: root.verticalCenter
top: undefined
bottom: undefined
left: undefined
right: root.right
}
}
PropertyChanges {
target: buttonsLayout
width: buttonsLayout.implicitWidth
}
},
State {
name: "BottomEdge"
PropertyChanges {
target: root
height: root.implicitHeight
}
AnchorChanges {
target: root
anchors {
top: root.parent.top
bottom: undefined
left: root.parent.left
right: root.parent.right
}
}
AnchorChanges {
target: buttonsLayout
anchors {
verticalCenter: root.verticalCenter
top: undefined
bottom: undefined
left: undefined
right: root.right
}
}
PropertyChanges {
target: buttonsLayout
width: buttonsLayout.implicitWidth
}
},
State {
name: "LeftEdge"
PropertyChanges {
target: root
width: root.implicitWidth
}
AnchorChanges {
target: root
anchors {
top: root.parent.top
bottom: root.parent.bottom
left: undefined
right: root.parent.right
}
}
AnchorChanges {
target: buttonsLayout
anchors {
verticalCenter: undefined
top: undefined
bottom: root.bottom
left: root.left
right: root.right
}
}
},
State {
name: "RightEdge"
PropertyChanges {
target: root
width: root.implicitWidth
}
AnchorChanges {
target: root
anchors {
top: root.parent.top
bottom: root.parent.bottom
left: root.parent.left
right: undefined
}
}
AnchorChanges {
target: buttonsLayout
anchors {
verticalCenter: undefined
top: undefined
bottom: root.bottom
left: root.left
right: root.right
}
}
}
]
//END States
}
|