Changeset View
Changeset View
Standalone View
Standalone View
desktoppackage/contents/configuration/panelconfiguration/ToolBar.qml
Show All 24 Lines | |||||
25 | import org.kde.kirigami 2.0 as Kirigami | 25 | import org.kde.kirigami 2.0 as Kirigami | ||
26 | 26 | | |||
27 | Item { | 27 | Item { | ||
28 | id: root | 28 | id: root | ||
29 | state: parent.state | 29 | state: parent.state | ||
30 | implicitWidth: Math.max(buttonsLayout_1.width, buttonsLayout_2.width, row.width) + units.smallSpacing * 2 | 30 | implicitWidth: Math.max(buttonsLayout_1.width, buttonsLayout_2.width, row.width) + units.smallSpacing * 2 | ||
31 | implicitHeight: row.height + 20 | 31 | implicitHeight: row.height + 20 | ||
32 | 32 | | |||
33 | readonly property string removePanelButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "Remove Panel") | | |||
34 | readonly property string addWidgetsButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "Add Widgets...") | 33 | readonly property string addWidgetsButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "Add Widgets...") | ||
35 | readonly property string addSpacerButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "Add Spacer") | 34 | readonly property string addSpacerButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "Add Spacer") | ||
36 | readonly property string settingsButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "More Settings...") | 35 | readonly property string settingsButtonText: i18nd("plasma_shell_org.kde.plasma.desktop", "More Settings...") | ||
37 | 36 | | |||
38 | QQC2.Action { | 37 | QQC2.Action { | ||
39 | shortcut: "Escape" | 38 | shortcut: "Escape" | ||
40 | onTriggered: { | 39 | onTriggered: { | ||
41 | // avoid leaving the panel in an inconsistent state when escaping while dragging it | 40 | // avoid leaving the panel in an inconsistent state when escaping while dragging it | ||
Show All 20 Lines | 54 | GridLayout { | |||
62 | anchors.topMargin: plasmoid.formFactor === PlasmaCore.Types.Vertical ? rowSpacing + closeButton.height : rowSpacing | 61 | anchors.topMargin: plasmoid.formFactor === PlasmaCore.Types.Vertical ? rowSpacing + closeButton.height : rowSpacing | ||
63 | 62 | | |||
64 | property bool showText: plasmoid.formFactor === PlasmaCore.Types.Vertical || (row.x + row.width < root.width - placeHolder.width - units.iconSizes.small*4 - units.largeSpacing*5) | 63 | property bool showText: plasmoid.formFactor === PlasmaCore.Types.Vertical || (row.x + row.width < root.width - placeHolder.width - units.iconSizes.small*4 - units.largeSpacing*5) | ||
65 | 64 | | |||
66 | rowSpacing: units.smallSpacing | 65 | rowSpacing: units.smallSpacing | ||
67 | columnSpacing: units.smallSpacing | 66 | columnSpacing: units.smallSpacing | ||
68 | 67 | | |||
69 | PlasmaComponents.Button { | 68 | PlasmaComponents.Button { | ||
70 | iconSource: "delete" | 69 | text: buttonsLayout_2.showText ? root.addWidgetsButtonText : "" | ||
71 | text: buttonsLayout_1.showText ? root.removePanelButtonText : "" | 70 | tooltip: buttonsLayout_2.showText ? "" : root.addWidgetsButtonText | ||
72 | tooltip: buttonsLayout_1.showText ? "" : root.removePanelButtonText | 71 | iconSource: "list-add" | ||
72 | Layout.fillWidth: true | ||||
73 | onClicked: { | ||||
74 | configDialog.close(); | ||||
75 | configDialog.showAddWidgetDialog(); | ||||
76 | } | ||||
77 | } | ||||
78 | | ||||
79 | PlasmaComponents.Button { | ||||
80 | iconSource: "distribute-horizontal-x" | ||||
81 | text: buttonsLayout_2.showText ? root.addSpacerButtonText : "" | ||||
82 | tooltip: buttonsLayout_2.showText ? "" : root.addSpacerButtonText | ||||
73 | Layout.fillWidth: true | 83 | Layout.fillWidth: true | ||
74 | onClicked: { | 84 | onClicked: { | ||
75 | plasmoid.action("remove").trigger(); | 85 | configDialog.addPanelSpacer(); | ||
76 | } | 86 | } | ||
77 | } | 87 | } | ||
78 | } | 88 | } | ||
79 | 89 | | |||
80 | GridLayout { | 90 | GridLayout { | ||
81 | id: row | 91 | id: row | ||
82 | columns: dialogRoot.vertical ? 1 : 2 | 92 | columns: dialogRoot.vertical ? 1 : 2 | ||
83 | rows: dialogRoot.vertical ? 2 : 1 | 93 | rows: dialogRoot.vertical ? 2 : 1 | ||
Show All 36 Lines | 124 | GridLayout { | |||
120 | anchors.margins: rowSpacing | 130 | anchors.margins: rowSpacing | ||
121 | 131 | | |||
122 | property bool showText: plasmoid.formFactor === PlasmaCore.Types.Vertical || (row.x + row.width < root.width - placeHolder.width - units.iconSizes.small*4 - units.largeSpacing*5) | 132 | property bool showText: plasmoid.formFactor === PlasmaCore.Types.Vertical || (row.x + row.width < root.width - placeHolder.width - units.iconSizes.small*4 - units.largeSpacing*5) | ||
123 | 133 | | |||
124 | rowSpacing: units.smallSpacing | 134 | rowSpacing: units.smallSpacing | ||
125 | columnSpacing: units.smallSpacing | 135 | columnSpacing: units.smallSpacing | ||
126 | 136 | | |||
127 | PlasmaComponents.Button { | 137 | PlasmaComponents.Button { | ||
128 | text: buttonsLayout_2.showText ? root.addWidgetsButtonText : "" | | |||
129 | tooltip: buttonsLayout_2.showText ? "" : root.addWidgetsButtonText | | |||
130 | iconSource: "list-add" | | |||
131 | Layout.fillWidth: true | | |||
132 | onClicked: { | | |||
133 | configDialog.close(); | | |||
134 | configDialog.showAddWidgetDialog(); | | |||
135 | } | | |||
136 | } | | |||
137 | | ||||
138 | PlasmaComponents.Button { | | |||
139 | iconSource: "distribute-horizontal-x" | | |||
140 | text: buttonsLayout_2.showText ? root.addSpacerButtonText : "" | | |||
141 | tooltip: buttonsLayout_2.showText ? "" : root.addSpacerButtonText | | |||
142 | Layout.fillWidth: true | | |||
143 | onClicked: { | | |||
144 | configDialog.addPanelSpacer(); | | |||
145 | } | | |||
146 | } | | |||
147 | | ||||
148 | PlasmaComponents.Button { | | |||
149 | id: settingsButton | 138 | id: settingsButton | ||
150 | iconSource: "configure" | 139 | iconSource: "configure" | ||
151 | text: buttonsLayout_2.showText ? root.settingsButtonText : "" | 140 | text: buttonsLayout_2.showText ? root.settingsButtonText : "" | ||
152 | tooltip: buttonsLayout_2.showText ? "" : root.settingsButtonText | 141 | tooltip: buttonsLayout_2.showText ? "" : root.settingsButtonText | ||
153 | Layout.fillWidth: true | 142 | Layout.fillWidth: true | ||
154 | checkable: true | 143 | checkable: true | ||
155 | onCheckedChanged: { | 144 | onCheckedChanged: { | ||
156 | if (checked) { | 145 | if (checked) { | ||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |