From 805da6762b092e663336f79b4b3133ac7b36732d Mon Sep 17 00:00:00 2001 From: reionwong Date: Mon, 16 Aug 2021 15:06:08 +0800 Subject: [PATCH] Fix control dialog height change --- qml/ControlCenter.qml | 14 +++++++++----- qml/main.qml | 6 ------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/qml/ControlCenter.qml b/qml/ControlCenter.qml index a8321ea..ac8c4ee 100644 --- a/qml/ControlCenter.qml +++ b/qml/ControlCenter.qml @@ -31,6 +31,15 @@ import FishUI 1.0 as FishUI ControlCenterDialog { id: control + width: 450 + height: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 3 + + Behavior on height { + NumberAnimation { + duration: 150 + } + } + property var margin: 4 * Screen.devicePixelRatio property point position: Qt.point(0, 0) @@ -49,11 +58,6 @@ ControlCenterDialog { LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft LayoutMirroring.childrenInherit: true - onVisibleChanged: { - control.width = 450 - control.height = _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 3 - } - Appearance { id: appearance } diff --git a/qml/main.qml b/qml/main.qml index da4acb5..4920118 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -274,12 +274,6 @@ Item { onClicked: toggleDialog() onRightClicked: toggleDialog() - Behavior on Layout.preferredWidth { - NumberAnimation { - duration: 100 - } - } - function toggleDialog() { if (controlCenter.visible) controlCenter.close()