From 82f4eceb1ed006ab459e2c81d518ed37df12d99b Mon Sep 17 00:00:00 2001 From: hewenfei Date: Fri, 2 Feb 2024 15:42:23 +0800 Subject: [PATCH] =?UTF-8?q?ui:=20=E8=B0=83=E6=95=B4=E6=89=80=E6=9C=89?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E9=A2=9C=E8=89=B2=E8=B7=9F=E9=9A=8F=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/AppControls2/RoundButton.qml | 2 +- qml/AppUI/AppLabelPage.qml | 2 +- qml/AppUI/PluginSelectButton.qml | 4 ++-- qml/AppUI/SearchInputBar.qml | 6 +++--- qml/AppUI/Sidebar.qml | 2 +- qml/main.qml | 3 ++- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/qml/AppControls2/RoundButton.qml b/qml/AppControls2/RoundButton.qml index 74c8ac7..b0b065f 100644 --- a/qml/AppControls2/RoundButton.qml +++ b/qml/AppControls2/RoundButton.qml @@ -14,7 +14,7 @@ MouseArea { UkuiItems.StyleBackground { id: buttonBase useStyleTransparency: false - paletteRole: mainWindow.isFullScreen ? Platform.Theme.Light : Platform.Theme.Text + paletteRole: Platform.Theme.Text anchors.fill: parent radius: height / 2 alpha: buttonMouseArea.containsPress ? 0.20 : buttonMouseArea.containsMouse ? 0.16 : 0.10 diff --git a/qml/AppUI/AppLabelPage.qml b/qml/AppUI/AppLabelPage.qml index 0c372ca..9cba8c3 100644 --- a/qml/AppUI/AppLabelPage.qml +++ b/qml/AppUI/AppLabelPage.qml @@ -65,7 +65,7 @@ GridView { border.width: (parent.GridView.isCurrentItem && !mainWindow.isFullScreen) ? 2 : 0 borderColor: Platform.Theme.Highlight - Text { + UkuiItems.StyleText { anchors.fill: parent visible: modelData.type === LabelItem.Text text: modelData.display diff --git a/qml/AppUI/PluginSelectButton.qml b/qml/AppUI/PluginSelectButton.qml index 7d29790..56b7017 100644 --- a/qml/AppUI/PluginSelectButton.qml +++ b/qml/AppUI/PluginSelectButton.qml @@ -61,7 +61,7 @@ UkuiItems.StyleBackground { ToolTip.visible: containsMouse background.radius: width / 2 - icon.mode: parent.currentId === 0 ? mainWindow.isFullScreen ? UkuiItems.Icon.AutoHighlight : UkuiItems.Icon.Normal : UkuiItems.Icon.Disabled + icon.mode: parent.currentId === 0 ? UkuiItems.Icon.AutoHighlight : UkuiItems.Icon.Disabled icon.source: pluginSortButtonRoot.model.getProviderIcon(0); background.paletteRole: Platform.Theme.Light background.alpha: parent.currentId === 0 ? 0.7 : 0 @@ -89,7 +89,7 @@ UkuiItems.StyleBackground { ToolTip.visible: containsMouse background.radius: width / 2 - icon.mode: parent.currentId === 1 ? mainWindow.isFullScreen ? UkuiItems.Icon.AutoHighlight : UkuiItems.Icon.Normal : UkuiItems.Icon.Disabled + icon.mode: parent.currentId === 1 ? UkuiItems.Icon.AutoHighlight : UkuiItems.Icon.Disabled icon.source: pluginSortButtonRoot.model.getProviderIcon(1); background.paletteRole: Platform.Theme.Light background.alpha: parent.currentId === 1 ? 0.7 : 0 diff --git a/qml/AppUI/SearchInputBar.qml b/qml/AppUI/SearchInputBar.qml index 7b1f566..ce1c306 100644 --- a/qml/AppUI/SearchInputBar.qml +++ b/qml/AppUI/SearchInputBar.qml @@ -60,7 +60,7 @@ UkuiItems.StyleBackground { anchors.centerIn: parent width: parent.height / 2; height: width source: "search-symbolic" - mode: mainWindow.isFullScreen ? UkuiItems.Icon.Highlight : UkuiItems.Icon.AutoHighlight + mode: UkuiItems.Icon.AutoHighlight } } @@ -71,7 +71,7 @@ UkuiItems.StyleBackground { anchors.left: searchIcon.right text: qsTr("Search App") visible: textInput.contentWidth === 0 - paletteRole: mainWindow.isFullScreen ? Platform.Theme.HighlightedText : Platform.Theme.Text + paletteRole: Platform.Theme.Text verticalAlignment: TextInput.AlignVCenter alpha: 0.25 } @@ -145,7 +145,7 @@ UkuiItems.StyleBackground { background.radius: width/2 background.border.width: 1 icon.source: "edit-clear-symbolic" - icon.mode: mainWindow.isFullScreen ? UkuiItems.Icon.Highlight : UkuiItems.Icon.AutoHighlight + icon.mode: UkuiItems.Icon.AutoHighlight onClicked: { textInput.clear(); diff --git a/qml/AppUI/Sidebar.qml b/qml/AppUI/Sidebar.qml index 8deb81c..e35d849 100644 --- a/qml/AppUI/Sidebar.qml +++ b/qml/AppUI/Sidebar.qml @@ -64,7 +64,7 @@ Item { } background.radius: Platform.Theme.minRadius - icon.mode: mainWindow.isFullScreen ? UkuiItems.Icon.Highlight : UkuiItems.Icon.AutoHighlight + icon.mode: UkuiItems.Icon.AutoHighlight icon.source: mainWindow.isFullScreen ? "view-restore-symbolic" : "view-fullscreen-symbolic" } diff --git a/qml/main.qml b/qml/main.qml index e7e6308..c864220 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -21,6 +21,7 @@ import AppUI 1.0 as AppUI import AppControls2 1.0 as AppControls2 import org.ukui.menu.core 1.0 import org.ukui.quick.items 1.0 as UkuiItems +import org.ukui.quick.platform 1.0 as Platform Item { id: root @@ -109,7 +110,7 @@ Item { x: 0; y: 0 height: normalScreenGeometry.normalGeometry.height width: normalScreenGeometry.normalGeometry.width - radius: 12 + radius: Platform.Theme.windowRadius onHeightChanged: { if (root.transparency <= 0.6 && root.onComlpeted) {