|
|
|
@ -52,16 +52,35 @@ PlasmaComponents.Page {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
|
id: screenRow
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.leftMargin: units.smallSpacing * 2
|
|
|
|
|
Layout.rightMargin: units.smallSpacing * 2
|
|
|
|
|
spacing: 1
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
function updateScreens() {
|
|
|
|
|
if (dock.screens.length > 1)
|
|
|
|
|
visible = true;
|
|
|
|
|
screenRow.visible = true;
|
|
|
|
|
else
|
|
|
|
|
visible = false;
|
|
|
|
|
screenRow.visible = false;
|
|
|
|
|
|
|
|
|
|
var screens = []
|
|
|
|
|
|
|
|
|
|
// screens.push(i18n("On Primary"));
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < dock.screens.length; i++) {
|
|
|
|
|
screens.push(dock.screens[i].name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
screenCmb.model = screens;
|
|
|
|
|
|
|
|
|
|
screenCmb.currentIndex = screenCmb.find(dock.currentScreen);
|
|
|
|
|
console.log(dock.currentScreen);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Connections{
|
|
|
|
|
target: dockConfig
|
|
|
|
|
onShowSignal: screenRow.updateScreens();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PlasmaComponents.Label {
|
|
|
|
@ -72,24 +91,11 @@ PlasmaComponents.Page {
|
|
|
|
|
PlasmaComponents.ComboBox {
|
|
|
|
|
id: screenCmb
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
var screens = []
|
|
|
|
|
|
|
|
|
|
// screens.push(i18n("On Primary"));
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < dock.screens.length; i++) {
|
|
|
|
|
screens.push(dock.screens[i].name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model = screens;
|
|
|
|
|
|
|
|
|
|
currentIndex = find(dock.currentScreen);
|
|
|
|
|
console.log(dock.currentScreen);
|
|
|
|
|
}
|
|
|
|
|
Component.onCompleted: screenRow.updateScreens();
|
|
|
|
|
|
|
|
|
|
onCurrentIndexChanged: {
|
|
|
|
|
console.log("current index changed!!! :"+ currentIndex);
|
|
|
|
|
onActivated: {
|
|
|
|
|
if (currentIndex !== find(dock.currentScreen)) {
|
|
|
|
|
console.log("current index changed!!! :"+ currentIndex);
|
|
|
|
|
console.log("screen must be changed...");
|
|
|
|
|
dock.setCurrentScreen(currentText);
|
|
|
|
|
}
|
|
|
|
|