From 66bad01b68e286191ca7fa4650d08d02d3ddd5da Mon Sep 17 00:00:00 2001 From: reionwong Date: Wed, 30 Jun 2021 00:02:20 +0800 Subject: [PATCH] Add the default application, but not completed --- src/qml/Appearance/Main.qml | 30 ++++++------ src/qml/Application/Main.qml | 86 +++++++++++++++++++++++++++++++++++ src/qml/Battery/Main.qml | 37 ++++++++++----- src/qml/Display/Main.qml | 50 ++++++++++++-------- src/qml/Dock/Main.qml | 46 +++++++++++-------- src/qml/HorizontalDivider.qml | 2 +- src/qml/ItemPage.qml | 8 ++-- src/qml/RoundedItem.qml | 4 +- src/qml/SideBar.qml | 9 ++++ src/resources.qrc | 1 + 10 files changed, 204 insertions(+), 69 deletions(-) create mode 100644 src/qml/Application/Main.qml diff --git a/src/qml/Appearance/Main.qml b/src/qml/Appearance/Main.qml index 7e0bb11..b1d9433 100644 --- a/src/qml/Appearance/Main.qml +++ b/src/qml/Appearance/Main.qml @@ -41,15 +41,15 @@ ItemPage { id: layout anchors.fill: parent // anchors.bottomMargin: FishUI.Units.largeSpacing - spacing: FishUI.Units.largeSpacing * 2 + spacing: FishUI.Units.smallSpacing - RoundedItem { - Label { - text: qsTr("Theme") - color: FishUI.Theme.disabledTextColor - bottomPadding: FishUI.Units.smallSpacing - } + Label { + text: qsTr("Theme") + color: FishUI.Theme.disabledTextColor + leftPadding: FishUI.Units.largeSpacing + } + RoundedItem { // Light Mode and Dark Mode RowLayout { spacing: FishUI.Units.largeSpacing * 2 @@ -96,13 +96,17 @@ ItemPage { } } - RoundedItem { - Label { - text: qsTr("Accent color") - color: FishUI.Theme.disabledTextColor - bottomPadding: FishUI.Units.smallSpacing - } + Item { + height: FishUI.Units.largeSpacing + } + Label { + text: qsTr("Accent color") + color: FishUI.Theme.disabledTextColor + leftPadding: FishUI.Units.largeSpacing + } + + RoundedItem { GridView { id: accentColorView height: itemSize diff --git a/src/qml/Application/Main.qml b/src/qml/Application/Main.qml new file mode 100644 index 0000000..e8351fd --- /dev/null +++ b/src/qml/Application/Main.qml @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2021 CutefishOS Team. + * + * Author: revenmartin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 +import QtQuick.Controls 2.4 +import QtQuick.Layouts 1.3 +import QtGraphicalEffects 1.0 + +import FishUI 1.0 as FishUI +import "../" + +ItemPage { + id: control + headerTitle: qsTr("Application") + + Scrollable { + anchors.fill: parent + contentHeight: layout.implicitHeight + + ColumnLayout { + id: layout + anchors.fill: parent + spacing: FishUI.Units.smallSpacing + + Label { + text: qsTr("Default application") + leftPadding: FishUI.Units.largeSpacing + } + + RoundedItem { + GridLayout { + columns: 2 + columnSpacing: FishUI.Units.largeSpacing * 2 + + Label { + text: qsTr("Web browser") + } + + ComboBox { + Layout.fillWidth: true + } + + Label { + text: qsTr("File manager") + } + + ComboBox { + Layout.fillWidth: true + } + + Label { + text: qsTr("Email") + } + + ComboBox { + Layout.fillWidth: true + } + + Label { + text: qsTr("Terminal emulator") + } + + ComboBox { + Layout.fillWidth: true + } + } + } + } + } +} diff --git a/src/qml/Battery/Main.qml b/src/qml/Battery/Main.qml index f916dc8..b217004 100644 --- a/src/qml/Battery/Main.qml +++ b/src/qml/Battery/Main.qml @@ -64,7 +64,7 @@ ItemPage { ColumnLayout { id: layout anchors.fill: parent - spacing: FishUI.Units.largeSpacing * 2 + spacing: FishUI.Units.smallSpacing // Battery Info BatteryItem { @@ -118,15 +118,20 @@ ItemPage { } } + Item { + height: FishUI.Units.largeSpacing + } + + Label { + text: qsTr("History") + color: FishUI.Theme.disabledTextColor + leftPadding: FishUI.Units.largeSpacing + } + RoundedItem { visible: history.count > 2 spacing: 0 - Label { - text: qsTr("History") - color: FishUI.Theme.disabledTextColor - } - HistoryGraph { Layout.fillWidth: true height: 300 @@ -168,15 +173,19 @@ ItemPage { } } + Item { + height: FishUI.Units.largeSpacing + } + + Label { + text: qsTr("Health") + color: FishUI.Theme.disabledTextColor + leftPadding: FishUI.Units.largeSpacing + } + RoundedItem { visible: battery.capacity - Label { - text: qsTr("Health") - color: FishUI.Theme.disabledTextColor - bottomPadding: FishUI.Units.largeSpacing - } - RowLayout { spacing: FishUI.Units.largeSpacing * 4 @@ -279,6 +288,10 @@ ItemPage { } } + Item { + height: FishUI.Units.largeSpacing + } + RoundedItem { RowLayout { Label { diff --git a/src/qml/Display/Main.qml b/src/qml/Display/Main.qml index bb992d4..9223141 100644 --- a/src/qml/Display/Main.qml +++ b/src/qml/Display/Main.qml @@ -57,16 +57,20 @@ ItemPage { ColumnLayout { id: layout anchors.fill: parent - spacing: FishUI.Units.largeSpacing * 2 + spacing: FishUI.Units.smallSpacing + + Label { + text: qsTr("Brightness") + color: FishUI.Theme.disabledTextColor + leftPadding: FishUI.Units.largeSpacing + } RoundedItem { Layout.fillWidth: true visible: brightness.enabled - Label { - text: qsTr("Brightness") - color: FishUI.Theme.disabledTextColor - bottomPadding: FishUI.Units.largeSpacing + Item { + height: FishUI.Units.smallSpacing / 2 } RowLayout { @@ -100,19 +104,23 @@ ItemPage { } Item { - height: FishUI.Units.smallSpacing + height: FishUI.Units.smallSpacing / 2 } } - RoundedItem { + Item { + height: FishUI.Units.largeSpacing + } + + Label { + text: qsTr("Screen") + color: FishUI.Theme.disabledTextColor + leftPadding: FishUI.Units.largeSpacing visible: _screenView.count > 0 + } - Label { - text: qsTr("Screen") - color: FishUI.Theme.disabledTextColor - bottomPadding: FishUI.Units.smallSpacing - visible: _screenView.count > 0 - } + RoundedItem { + visible: _screenView.count > 0 ListView { id: _screenView @@ -269,13 +277,17 @@ ItemPage { } } - RoundedItem { - Label { - text: qsTr("Scale") - color: FishUI.Theme.disabledTextColor - bottomPadding: FishUI.Units.smallSpacing - } + Item { + height: FishUI.Units.largeSpacing + } + + Label { + text: qsTr("Scale") + color: FishUI.Theme.disabledTextColor + leftPadding: FishUI.Units.largeSpacing + } + RoundedItem { TabBar { id: dockSizeTabbar Layout.fillWidth: true diff --git a/src/qml/Dock/Main.qml b/src/qml/Dock/Main.qml index a27aded..57d9973 100644 --- a/src/qml/Dock/Main.qml +++ b/src/qml/Dock/Main.qml @@ -38,16 +38,16 @@ ItemPage { ColumnLayout { id: layout anchors.fill: parent - spacing: FishUI.Units.largeSpacing * 2 + spacing: FishUI.Units.smallSpacing + + Label { + text: qsTr("Position on screen") + color: FishUI.Theme.disabledTextColor + leftPadding: FishUI.Units.largeSpacing + } RoundedItem { // Dock - Label { - text: qsTr("Position on screen") - color: FishUI.Theme.disabledTextColor - bottomPadding: FishUI.Units.smallSpacing - } - RowLayout { spacing: FishUI.Units.largeSpacing * 2 @@ -74,14 +74,18 @@ ItemPage { } } + Item { + height: FishUI.Units.largeSpacing + } + + Label { + text: qsTr("Size") + color: FishUI.Theme.disabledTextColor + leftPadding: FishUI.Units.largeSpacing + } + // Dock Size RoundedItem { - Label { - text: qsTr("Size") - color: FishUI.Theme.disabledTextColor - bottomPadding: FishUI.Units.smallSpacing - } - TabBar { id: dockSizeTabbar Layout.fillWidth: true @@ -141,14 +145,18 @@ ItemPage { } } + Item { + height: FishUI.Units.largeSpacing + } + + Label { + text: qsTr("Display mode") + color: FishUI.Theme.disabledTextColor + leftPadding: FishUI.Units.largeSpacing + } + // Visibility RoundedItem { - Label { - text: qsTr("Visibility") - color: FishUI.Theme.disabledTextColor - bottomPadding: FishUI.Units.smallSpacing - } - TabBar { Layout.fillWidth: true currentIndex: appearance.dockVisibility diff --git a/src/qml/HorizontalDivider.qml b/src/qml/HorizontalDivider.qml index 6ff86d2..71e03f0 100644 --- a/src/qml/HorizontalDivider.qml +++ b/src/qml/HorizontalDivider.qml @@ -32,6 +32,6 @@ Item { height: 1 width: control.width color: FishUI.Theme.disabledTextColor - opacity: FishUI.Theme.darkMode ? 0.3 : 0.15 + opacity: FishUI.Theme.darkMode ? 0.3 : 0.1 } } diff --git a/src/qml/ItemPage.qml b/src/qml/ItemPage.qml index b21ce23..e05a5b8 100644 --- a/src/qml/ItemPage.qml +++ b/src/qml/ItemPage.qml @@ -35,11 +35,13 @@ Page { height: rootWindow.header.height Label { - anchors.fill: parent - leftPadding: FishUI.Units.largeSpacing * 2 + anchors.horizontalCenter: parent.horizontalCenter + +// anchors.fill: parent +// leftPadding: FishUI.Units.largeSpacing * 2 topPadding: FishUI.Units.largeSpacing bottomPadding: 0 - font.pointSize: 15 + font.pointSize: 12 text: page.headerTitle } } diff --git a/src/qml/RoundedItem.qml b/src/qml/RoundedItem.qml index a9ce84d..4ca92b7 100644 --- a/src/qml/RoundedItem.qml +++ b/src/qml/RoundedItem.qml @@ -37,8 +37,8 @@ Rectangle { ColumnLayout { id: _mainLayout anchors.fill: parent - anchors.leftMargin: FishUI.Units.largeSpacing * 1.5 - anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 + anchors.leftMargin: FishUI.Units.largeSpacing + anchors.rightMargin: FishUI.Units.largeSpacing anchors.topMargin: FishUI.Units.largeSpacing anchors.bottomMargin: FishUI.Units.largeSpacing } diff --git a/src/qml/SideBar.qml b/src/qml/SideBar.qml index f7f77e2..179b16d 100644 --- a/src/qml/SideBar.qml +++ b/src/qml/SideBar.qml @@ -136,6 +136,15 @@ Item { category: qsTr("System") } +// ListElement { +// title: qsTr("Application") +// name: "application" +// page: "qrc:/qml/Application/Main.qml" +// iconSource: "accounts.svg" +// iconColor: "#DA7C43" +// category: qsTr("System") +// } + ListElement { title: qsTr("Language") name: "language" diff --git a/src/resources.qrc b/src/resources.qrc index d598176..2617613 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -107,5 +107,6 @@ images/sidebar/dark/fonts.svg qml/Hotspot/Main.qml images/sidebar/dark/hotspot.svg + qml/Application/Main.qml