From 3d0c6f0eb189f1c5eb0555f1a2ccfd05035c7ae2 Mon Sep 17 00:00:00 2001 From: reionwong Date: Sun, 31 Oct 2021 00:00:00 +0800 Subject: [PATCH] Optimize about window --- src/controls/AboutDialog.qml | 19 ++++++++++++++++--- src/controls/Theme.qml | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/controls/AboutDialog.qml b/src/controls/AboutDialog.qml index c52af33..214007d 100644 --- a/src/controls/AboutDialog.qml +++ b/src/controls/AboutDialog.qml @@ -8,7 +8,10 @@ FishUI.Window { id: control width: 300 - height: 300 + height: contentHeight + + maximumHeight: contentHeight + minimumHeight: contentHeight modality: Qt.WindowModal @@ -17,10 +20,19 @@ FishUI.Window { property var iconSource property string name property string description + property var contentHeight: _mainLayout.implicitHeight + control.header.height * 2 + + DragHandler { + target: null + acceptedDevices: PointerDevice.GenericPointer + grabPermissions: PointerHandler.CanTakeOverFromItems | PointerHandler.CanTakeOverFromHandlersOfDifferentType | PointerHandler.ApprovesTakeOverByAnything + onActiveChanged: if (active) { control.helper.startSystemMove(control) } + } ColumnLayout { + id: _mainLayout anchors.fill: parent - anchors.topMargin: FishUI.Units.largeSpacing * 2 + anchors.bottomMargin: control.header.height Image { width: 64 @@ -31,12 +43,13 @@ FishUI.Window { } Item { - height: FishUI.Units.largeSpacing * 2 + height: FishUI.Units.largeSpacing } Label { text: control.name Layout.alignment: Qt.AlignHCenter + font.pointSize: 14 } Label { diff --git a/src/controls/Theme.qml b/src/controls/Theme.qml index 8c9ee1d..afca1b2 100644 --- a/src/controls/Theme.qml +++ b/src/controls/Theme.qml @@ -41,7 +41,7 @@ QtObject { property color secondBackgroundColor: darkMode ? "#2C2C2D" : "#FFFFFF" property color alternateBackgroundColor: darkMode ? "#3C3C3D" : "#F2F4F5" - property color textColor: darkMode ? "#FFFFFF" : "#4E5668" + property color textColor: darkMode ? "#FFFFFF" : "#323238" property color disabledTextColor: darkMode ? "#888888" : "#64646E" property color highlightColor: FishUICore.ThemeManager.accentColor