Reload Aurorae buttons when the button settings changed

icc-effect-5.14.5
Martin Gräßlin 2012-01-13 12:21:28 +01:00
parent a1bee6f8a7
commit 5f5499a74f
1 changed files with 17 additions and 9 deletions

View File

@ -18,15 +18,7 @@ import QtQuick 1.1
import org.kde.plasma.core 0.1 as PlasmaCore
Item {
id: group
property string buttons
states: [
State { name: "normal" },
State { name: "maximized" }
]
Component.onCompleted: {
group.state = decoration.maximized ? "maximized" : "normal";
function createButtons() {
var component = Qt.createComponent("AuroraeButton.qml");
for (var i=0; i<buttons.length; 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 {
id: groupRow
spacing: auroraeTheme.buttonSpacing
@ -51,4 +53,10 @@ Item {
target: decoration
onMaximizedChanged: group.state = decoration.maximized ? "maximized" : "normal"
}
onButtonsChanged: {
for (i = 0; i < groupRow.children.length; i++) {
groupRow.children[i].destroy();
}
createButtons();
}
}