From f670515d911df9d0c0a3405fc2d932b31c2aa863 Mon Sep 17 00:00:00 2001 From: reionwong Date: Tue, 17 Aug 2021 09:56:41 +0800 Subject: [PATCH] Set window icon --- src/background.cpp | 1 + src/main.cpp | 7 ++++++- src/qml/Appearance/Main.qml | 3 ++- src/qml/DateTime/TimeZoneDialog.qml | 19 ++++++++++++++++--- src/qml/Fonts/Main.qml | 2 +- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/background.cpp b/src/background.cpp index fbdd5ab..ce47a30 100644 --- a/src/background.cpp +++ b/src/background.cpp @@ -9,6 +9,7 @@ static QVariantList getBackgroundPaths() QString bg = it.next(); list.append(QVariant(bg)); } + std::sort(list.begin(), list.end()); return list; } diff --git a/src/main.cpp b/src/main.cpp index 30b093a..66f5fa0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,10 +19,15 @@ #include "application.h" #include +#include int main(int argc, char *argv[]) { - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); + Application app(argc, argv); + app.setWindowIcon(QIcon::fromTheme("cutefish-settings")); + return 0; } diff --git a/src/qml/Appearance/Main.qml b/src/qml/Appearance/Main.qml index 75f7896..882b1e6 100644 --- a/src/qml/Appearance/Main.qml +++ b/src/qml/Appearance/Main.qml @@ -41,7 +41,7 @@ ItemPage { id: layout anchors.fill: parent // anchors.bottomMargin: FishUI.Units.largeSpacing - spacing: FishUI.Units.largeSpacing * 2 + spacing: FishUI.Units.largeSpacing RoundedItem { Label { @@ -76,6 +76,7 @@ ItemPage { Label { id: dimsTipsLabel text: qsTr("Dim the wallpaper in dark theme") + bottomPadding: FishUI.Units.smallSpacing Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft } diff --git a/src/qml/DateTime/TimeZoneDialog.qml b/src/qml/DateTime/TimeZoneDialog.qml index 96c6067..205d9f2 100644 --- a/src/qml/DateTime/TimeZoneDialog.qml +++ b/src/qml/DateTime/TimeZoneDialog.qml @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -import QtQuick 2.0 +import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Window 2.12 import QtQuick.Layouts 1.12 @@ -28,9 +28,11 @@ FishUI.Window { title: "Hello World" width: 900 height: 600 + minimumWidth: 800 + minimumHeight: 500 visible: false - background.opacity: 0.5 + background.opacity: control.compositing ? 0.5 : 1.0 contentTopMargin: 0 onWidthChanged: control.reset() @@ -63,6 +65,17 @@ FishUI.Window { enabled: true } + Item { + z: -1 + anchors.fill: parent + + DragHandler { + acceptedDevices: PointerDevice.GenericPointer + grabPermissions: PointerHandler.CanTakeOverFromItems | PointerHandler.CanTakeOverFromHandlersOfDifferentType | PointerHandler.ApprovesTakeOverByAnything + onActiveChanged: if (active) control.helper.startSystemMove(control) + } + } + ColumnLayout { anchors.fill: parent anchors.margins: FishUI.Units.largeSpacing @@ -118,7 +131,7 @@ FishUI.Window { MouseArea { anchors.fill: parent - onPressed: { + onClicked: { timeZoneMap.clicked(mouse.x, mouse.y, _worldMap.width, _worldMap.height) dot.show(mouse.x, mouse.y) diff --git a/src/qml/Fonts/Main.qml b/src/qml/Fonts/Main.qml index 38d5691..feadbd3 100644 --- a/src/qml/Fonts/Main.qml +++ b/src/qml/Fonts/Main.qml @@ -86,7 +86,7 @@ ItemPage { columns: 2 columnSpacing: FishUI.Units.largeSpacing * 1.5 - rowSpacing: FishUI.Units.largeSpacing * 2 + rowSpacing: FishUI.Units.largeSpacing * 1.5 Label { text: qsTr("General Font")