|
|
|
@ -53,88 +53,6 @@ PlasmaComponents.Page {
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
Layout.leftMargin: units.smallSpacing * 2
|
|
|
|
|
|
|
|
|
|
//! BEGIN: Layout
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: units.smallSpacing
|
|
|
|
|
spacing: units.smallSpacing
|
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
|
|
LatteComponents.Header {
|
|
|
|
|
text: i18n("Layout")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.leftMargin: units.smallSpacing * 2
|
|
|
|
|
Layout.rightMargin: units.smallSpacing * 2
|
|
|
|
|
spacing: units.smallSpacing
|
|
|
|
|
|
|
|
|
|
LatteComponents.ComboBox {
|
|
|
|
|
id: layoutCmb
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
|
|
property var layoutTexts: [];
|
|
|
|
|
property var layouts;
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: loadLayouts();
|
|
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
|
target:layoutsManager
|
|
|
|
|
onMenuLayoutsChanged: layoutCmb.loadLayouts();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function loadLayouts(){
|
|
|
|
|
layouts = layoutsManager.menuLayouts;
|
|
|
|
|
layoutTexts = [];
|
|
|
|
|
|
|
|
|
|
//if current layout isnt at the menu layouts
|
|
|
|
|
if (layouts.indexOf(layoutsManager.currentLayoutName) === -1) {
|
|
|
|
|
if (Qt.application.layoutDirection === Qt.RightToLeft) {
|
|
|
|
|
layoutTexts.push( layoutsManager.currentLayoutName + " ✔ ");
|
|
|
|
|
} else {
|
|
|
|
|
layoutTexts.push( " ✔ "+layoutsManager.currentLayoutName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var activeLayout = 0;
|
|
|
|
|
|
|
|
|
|
for(var i=0; i<layouts.length; ++i){
|
|
|
|
|
var selText1 = " ";
|
|
|
|
|
var selText2 = " ";
|
|
|
|
|
|
|
|
|
|
if (layouts[i] === layoutsManager.currentLayoutName) {
|
|
|
|
|
selText1 = " ✔ ";
|
|
|
|
|
activeLayout = i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Qt.application.layoutDirection === Qt.RightToLeft) {
|
|
|
|
|
layoutTexts.push(selText2+layouts[i]+selText1);
|
|
|
|
|
} else {
|
|
|
|
|
layoutTexts.push(selText1+layouts[i]+selText2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model = layoutTexts;
|
|
|
|
|
currentIndex = activeLayout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onActivated: {
|
|
|
|
|
layoutsManager.switchToLayout(layouts[index]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PlasmaComponents.Button {
|
|
|
|
|
text: i18nc("opens the layout manager window","Configure...")
|
|
|
|
|
iconSource: "document-edit"
|
|
|
|
|
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
|
|
|
|
|
|
|
|
|
onClicked: layoutsManager.showLatteSettingsDialog()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//! END: Layout
|
|
|
|
|
|
|
|
|
|
//! BEGIN: Items
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|