auto load first page
This commit is contained in:
parent
3a5e5f931b
commit
fd9282d22f
@ -60,8 +60,6 @@ ConfigView::ConfigView(AppletInterface *interface, QWindow *parent)
|
|||||||
engine()->rootContext()->setContextProperty("plasmoid", interface);
|
engine()->rootContext()->setContextProperty("plasmoid", interface);
|
||||||
engine()->rootContext()->setContextProperty("configDialog", this);
|
engine()->rootContext()->setContextProperty("configDialog", this);
|
||||||
setSource(QUrl::fromLocalFile(m_appletInterface->applet()->containment()->corona()->package().filePath("ui", "Configuration.qml")));
|
setSource(QUrl::fromLocalFile(m_appletInterface->applet()->containment()->corona()->package().filePath("ui", "Configuration.qml")));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigView::~ConfigView()
|
ConfigView::~ConfigView()
|
||||||
|
@ -44,6 +44,11 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
main.sourceComponent = configDialog.configPages[0].component
|
||||||
|
root.restoreConfig()
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
Row {
|
Row {
|
||||||
@ -74,6 +79,10 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
width: childrenRect.width
|
width: childrenRect.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
visible: (main.sourceComponent == configDialog.configPages[modelData].component)
|
||||||
|
}
|
||||||
Column {
|
Column {
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
@ -96,8 +105,12 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
main.sourceComponent = configDialog.configPages[modelData].component
|
if (main.sourceComponent == configDialog.configPages[modelData].component) {
|
||||||
root.restoreConfig()
|
return
|
||||||
|
} else {
|
||||||
|
main.sourceComponent = configDialog.configPages[modelData].component
|
||||||
|
root.restoreConfig()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user