初始化界面布局
This commit is contained in:
parent
ac481f4321
commit
bcada80b0d
|
@ -1,8 +0,0 @@
|
||||||
import QtQuick 2.0
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
color: "blue";
|
|
||||||
Text {
|
|
||||||
text: "AppUI"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +1,9 @@
|
||||||
import QtQuick 2.12
|
import QtQuick 2.0
|
||||||
import QtQuick.Controls 2.0 as QQC2
|
|
||||||
|
|
||||||
import AppUI 1.0 as AppUI
|
|
||||||
import AppControls2 1.0 as AppControls2
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
AppUI.AppTest {
|
|
||||||
width: 200
|
|
||||||
height: 480
|
|
||||||
}
|
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
x: 200
|
anchors.fill: parent
|
||||||
width: 200
|
|
||||||
height: 480
|
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
model: modelManager.getAppModel()
|
model: modelManager.getAppModel()
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
width: ListView.view.width;
|
width: ListView.view.width;
|
||||||
|
@ -30,9 +18,4 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AppControls2.AppTest {
|
|
||||||
x: 400
|
|
||||||
width: 200
|
|
||||||
height: 480
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "yellow"
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent;
|
||||||
|
onClicked: {
|
||||||
|
mainWindow.isFullScreen = !mainWindow.isFullScreen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
import QtQuick 2.12
|
||||||
|
import QtQuick.Controls 2.0 as QQC2
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Row {
|
||||||
|
anchors.fill: parent;
|
||||||
|
|
||||||
|
AppPage {
|
||||||
|
width: 300
|
||||||
|
height: parent.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
Sidebar {
|
||||||
|
width: parent.width - 300;
|
||||||
|
height: parent.height;
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent;
|
||||||
|
onClicked: {
|
||||||
|
mainWindow.isFullScreen = !mainWindow.isFullScreen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import AppControls2 1.0 as AppControls2
|
||||||
|
|
||||||
|
Item {
|
||||||
|
AppControls2.AppTest {
|
||||||
|
anchors.fill: parent;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,2 +1,5 @@
|
||||||
module AppUI
|
module AppUI
|
||||||
AppTest 1.0 App.qml
|
AppPage 1.0 AppPage.qml
|
||||||
|
Sidebar 1.0 Sidebar.qml
|
||||||
|
NormalUI 1.0 NormalUI.qml
|
||||||
|
FullScreenUI 1.0 FullScreenUI.qml
|
||||||
|
|
17
qml/main.qml
17
qml/main.qml
|
@ -1,6 +1,7 @@
|
||||||
import QtQuick 2.12
|
import QtQuick 2.12
|
||||||
import org.ukui.menu.core 1.0
|
import org.ukui.menu.core 1.0
|
||||||
|
|
||||||
|
import AppUI 1.0 as AppUI
|
||||||
|
|
||||||
MenuMainWindow {
|
MenuMainWindow {
|
||||||
id: mainWindow
|
id: mainWindow
|
||||||
|
@ -12,10 +13,22 @@ MenuMainWindow {
|
||||||
|
|
||||||
onIsFullScreenChanged: {
|
onIsFullScreenChanged: {
|
||||||
console.log("full screen", isFullScreen)
|
console.log("full screen", isFullScreen)
|
||||||
|
//loader.source = isFullScreen ? "qrc:/qml/FullScreenUI.qml" : "qrc:/qml/NormalUI.qml";
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
AppUI.NormalUI {
|
||||||
anchors.fill: mainWindow.contentItem;
|
anchors.fill: mainWindow.contentItem;
|
||||||
source: "qrc:/qml/UkuiMenuUI.qml"
|
transitions: Transition {
|
||||||
|
NumberAnimation {
|
||||||
|
easing.type: Easing.OutBounce;
|
||||||
|
properties: "width,height";
|
||||||
|
duration: 4000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on width {
|
||||||
|
PropertyAnimation {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/qml">
|
<qresource prefix="/qml">
|
||||||
<file>main.qml</file>
|
<file>main.qml</file>
|
||||||
<file>UkuiMenuUI.qml</file>
|
|
||||||
<file>AppUI/qmldir</file>
|
<file>AppUI/qmldir</file>
|
||||||
<file>AppUI/App.qml</file>
|
<file>AppUI/NormalUI.qml</file>
|
||||||
|
<file>AppUI/FullScreenUI.qml</file>
|
||||||
|
<file>AppUI/AppPage.qml</file>
|
||||||
|
<file>AppUI/Sidebar.qml</file>
|
||||||
<file>AppControls2/qmldir</file>
|
<file>AppControls2/qmldir</file>
|
||||||
<file>AppControls2/App.qml</file>
|
<file>AppControls2/App.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
|
Loading…
Reference in New Issue