Reload Aurorae buttons when the button settings changed
This commit is contained in:
parent
a1bee6f8a7
commit
5f5499a74f
1 changed files with 17 additions and 9 deletions
|
@ -18,15 +18,7 @@ import QtQuick 1.1
|
||||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: group
|
function createButtons() {
|
||||||
property string buttons
|
|
||||||
states: [
|
|
||||||
State { name: "normal" },
|
|
||||||
State { name: "maximized" }
|
|
||||||
]
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
group.state = decoration.maximized ? "maximized" : "normal";
|
|
||||||
var component = Qt.createComponent("AuroraeButton.qml");
|
var component = Qt.createComponent("AuroraeButton.qml");
|
||||||
for (var i=0; i<buttons.length; i++) {
|
for (var i=0; i<buttons.length; i++) {
|
||||||
if (buttons.charAt(i) == "_") {
|
if (buttons.charAt(i) == "_") {
|
||||||
|
@ -43,6 +35,16 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
id: group
|
||||||
|
property string buttons
|
||||||
|
states: [
|
||||||
|
State { name: "normal" },
|
||||||
|
State { name: "maximized" }
|
||||||
|
]
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
group.state = decoration.maximized ? "maximized" : "normal";
|
||||||
|
}
|
||||||
Row {
|
Row {
|
||||||
id: groupRow
|
id: groupRow
|
||||||
spacing: auroraeTheme.buttonSpacing
|
spacing: auroraeTheme.buttonSpacing
|
||||||
|
@ -51,4 +53,10 @@ Item {
|
||||||
target: decoration
|
target: decoration
|
||||||
onMaximizedChanged: group.state = decoration.maximized ? "maximized" : "normal"
|
onMaximizedChanged: group.state = decoration.maximized ? "maximized" : "normal"
|
||||||
}
|
}
|
||||||
|
onButtonsChanged: {
|
||||||
|
for (i = 0; i < groupRow.children.length; i++) {
|
||||||
|
groupRow.children[i].destroy();
|
||||||
|
}
|
||||||
|
createButtons();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue