From 12255d2fc81bb43fd01a941cd015ef17adfa0f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Thu, 19 Sep 2019 22:31:01 +0800 Subject: Make HomeForm UI independent from implementation-dependent TaskList --- Home.qml | 4 ++++ TaskList.qml | 14 ++++++++++++++ kelakon.qrc | 4 ++-- pages/HomeForm.ui.qml | 11 +---------- pages/TaskList.qml | 13 ------------- pages/TaskListForm.ui.qml | 21 +++++++++++++-------- 6 files changed, 34 insertions(+), 33 deletions(-) create mode 100644 TaskList.qml delete mode 100644 pages/TaskList.qml diff --git a/Home.qml b/Home.qml index 99448d2..27f1fd0 100644 --- a/Home.qml +++ b/Home.qml @@ -3,4 +3,8 @@ import "pages" HomeForm { menuButton.onClicked: drawer.visible = !drawer.visible + + TaskList { + anchors.top: toolbar.bottom + } } diff --git a/TaskList.qml b/TaskList.qml new file mode 100644 index 0000000..042fcad --- /dev/null +++ b/TaskList.qml @@ -0,0 +1,14 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import "pages" + +TaskListForm { + objectName: "taskList" + model: taskList + delegate: TaskForm { + width: parent.width + height: task.height + checkBox.text: subject + } + ScrollBar.vertical: ScrollBar {} +} diff --git a/kelakon.qrc b/kelakon.qrc index e216def..667ac33 100644 --- a/kelakon.qrc +++ b/kelakon.qrc @@ -24,9 +24,9 @@ pages/CreateProfileForm.ui.qml Home.qml pages/HomeForm.ui.qml - pages/TaskForm.ui.qml - pages/TaskList.qml + TaskList.qml pages/TaskListForm.ui.qml + pages/TaskForm.ui.qml assets/photo_camera_24px.svg assets/menu-24px.svg assets/check-box-outline-24px.svg diff --git a/pages/HomeForm.ui.qml b/pages/HomeForm.ui.qml index c0c95f2..6c34617 100644 --- a/pages/HomeForm.ui.qml +++ b/pages/HomeForm.ui.qml @@ -7,6 +7,7 @@ Rectangle { id: rectangle property alias menuButton: menuButton + property alias toolbar: toolbar ToolBar { id: toolbar @@ -55,16 +56,6 @@ Rectangle { } } - TaskList { - height: parent.height - anchors.top: toolbar.bottom - anchors.topMargin: 8 - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.left: parent.left - anchors.leftMargin: 0 - } - RoundButton { id: roundButton width: 64 diff --git a/pages/TaskList.qml b/pages/TaskList.qml deleted file mode 100644 index 07a10ba..0000000 --- a/pages/TaskList.qml +++ /dev/null @@ -1,13 +0,0 @@ -import QtQuick 2.12 -import QtQuick.Controls 2.12 - -TaskListForm { - objectName: "taskList" - model: taskList - delegate: TaskForm { - width: parent.width - height: task.height - checkBox.text: subject - } - ScrollBar.vertical: ScrollBar {} -} diff --git a/pages/TaskListForm.ui.qml b/pages/TaskListForm.ui.qml index 3dfd6cc..87f1b1c 100644 --- a/pages/TaskListForm.ui.qml +++ b/pages/TaskListForm.ui.qml @@ -1,15 +1,20 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 -import QtQuick.Layouts 1.12 ListView { - width: 362 - spacing: 12 + width: 362 + height: parent.height + anchors.topMargin: 8 + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + spacing: 12 - Rectangle { - id: rectangle - anchors.fill: parent - z: -1 - } + Rectangle { + id: rectangle + anchors.fill: parent + z: -1 + } } -- cgit v1.2.3