Changeset View
Changeset View
Standalone View
Standalone View
containments/panel/contents/ui/ConfigOverlay.qml
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.1 | 19 | import QtQuick 2.1 | ||
20 | import QtQuick.Layouts 1.0 | 20 | import QtQuick.Layouts 1.0 | ||
21 | import QtQuick.Controls 1.3 | ||||
21 | 22 | | |||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | 23 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 24 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | import org.kde.kquickcontrolsaddons 2.0 | 25 | import org.kde.kquickcontrolsaddons 2.0 | ||
25 | 26 | | |||
26 | MouseArea { | 27 | MouseArea { | ||
27 | id: configurationArea | 28 | id: configurationArea | ||
28 | 29 | | |||
▲ Show 20 Lines • Show All 344 Lines • ▼ Show 20 Line(s) | 373 | PlasmaComponents.ToolButton { | |||
373 | id: configureButton | 374 | id: configureButton | ||
374 | anchors.verticalCenter: parent.verticalCenter | 375 | anchors.verticalCenter: parent.verticalCenter | ||
375 | iconSource: "configure" | 376 | iconSource: "configure" | ||
376 | onClicked: { | 377 | onClicked: { | ||
377 | tooltip.visible = false; | 378 | tooltip.visible = false; | ||
378 | currentApplet.applet.action("configure").trigger() | 379 | currentApplet.applet.action("configure").trigger() | ||
379 | } | 380 | } | ||
380 | } | 381 | } | ||
382 | PlasmaComponents.ToolButton { | ||||
383 | id: fixedSizeButton | ||||
384 | anchors.verticalCenter: parent.verticalCenter | ||||
385 | iconSource: "distribute-horizontal-x" | ||||
386 | visible: currentApplet.expandingApplet | ||||
mart: this will probably need as well
currentApplet.applet.pluginName == "org.kde.plasma.panelspacer"… | |||||
It does not, it is already in definition of expandingApplet (line 254 of main.qml). Pitel: It does not, it is already in definition of `expandingApplet` (line 254 of `main.qml`). | |||||
387 | tooltip: i18n("Make applet non-expanding size") | ||||
388 | | ||||
389 | checkable: true | ||||
390 | checked: currentApplet && currentApplet.fixedSize | ||||
391 | Connections { | ||||
392 | target: configurationArea | ||||
393 | onCurrentAppletChanged: { | ||||
394 | fixedSizeButton.checked = currentApplet && currentApplet.fixedSize | ||||
395 | } | ||||
396 | } | ||||
397 | | ||||
398 | onClicked: { | ||||
399 | if (currentApplet.applet.pluginName == "org.kde.plasma.panelspacer") { | ||||
400 | currentApplet.applet.configuration.expanding = !currentApplet.applet.configuration.expanding | ||||
401 | return | ||||
402 | } | ||||
403 | var tmp = plasmoid.configuration.fixedSizeOverride | ||||
mart: is it necessary to use a temp copy? | |||||
My reasons for temp copy were:
Pitel: My reasons for temp copy were:
- `push` method has no effect on `plasmoid.configuration. | |||||
404 | var index = tmp.indexOf(currentApplet.applet.id) | ||||
405 | if (index != -1) { | ||||
406 | tmp.splice(index, 1) | ||||
407 | } else { | ||||
408 | tmp.push(currentApplet.applet.id) | ||||
409 | } | ||||
410 | plasmoid.configuration.fixedSizeOverride = tmp | ||||
411 | } | ||||
412 | } | ||||
381 | PlasmaComponents.Label { | 413 | PlasmaComponents.Label { | ||
382 | id: label | 414 | id: label | ||
383 | anchors.verticalCenter: parent.verticalCenter | 415 | anchors.verticalCenter: parent.verticalCenter | ||
384 | textFormat: Text.PlainText | 416 | textFormat: Text.PlainText | ||
385 | maximumLineCount: 1 | 417 | maximumLineCount: 1 | ||
386 | } | 418 | } | ||
387 | PlasmaComponents.ToolButton { | 419 | PlasmaComponents.ToolButton { | ||
388 | id: closeButton | 420 | id: closeButton | ||
Show All 11 Lines |
this will probably need as well
currentApplet.applet.pluginName == "org.kde.plasma.panelspacer"
or it gets lost when the spacer is configured as not expanding and i guess the spacer is special and we want this option to be always there
(step 2 would be removing the option in the spacer and make it use this system, but it's for a next commit)