From 34a48b989a31aa88f8c29f532a08e2d1c2f1bd23 Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Tue, 30 Jan 2024 13:55:41 +0000 Subject: [PATCH] sync: from linuxdeepin/dtkdeclarative Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: https://github.com/linuxdeepin/dtkdeclarative/pull/287 --- qt6/src/qml/BoxPanel.qml | 2 +- qt6/src/qml/ButtonBox.qml | 2 ++ qt6/src/qml/FlowStyle.qml | 47 ++++++++++++++++++++++----------- qt6/src/qml/InsideBoxBorder.qml | 2 +- qt6/src/qml/ItemDelegate.qml | 1 + qt6/src/qml/ToolButton.qml | 1 + src/qml/BoxPanel.qml | 2 +- src/qml/ButtonBox.qml | 2 ++ src/qml/FlowStyle.qml | 47 ++++++++++++++++++++++----------- src/qml/InsideBoxBorder.qml | 2 +- src/qml/ItemDelegate.qml | 1 + src/qml/ToolButton.qml | 1 + 12 files changed, 76 insertions(+), 34 deletions(-) diff --git a/qt6/src/qml/BoxPanel.qml b/qt6/src/qml/BoxPanel.qml index 98ad5872..8b7fe06b 100644 --- a/qt6/src/qml/BoxPanel.qml +++ b/qt6/src/qml/BoxPanel.qml @@ -45,7 +45,7 @@ Item { id: backgroundGradient // Use the backgroundRect's colorselecor can filter the hovered state. GradientStop { position: 0.0; color: backgroundRect.D.ColorSelector.color1} - GradientStop { position: 0.96; color: backgroundRect.D.ColorSelector.color2} + GradientStop { position: 1.0; color: backgroundRect.D.ColorSelector.color2} } anchors.fill: parent diff --git a/qt6/src/qml/ButtonBox.qml b/qt6/src/qml/ButtonBox.qml index c7a19fed..7502dba9 100644 --- a/qt6/src/qml/ButtonBox.qml +++ b/qt6/src/qml/ButtonBox.qml @@ -28,5 +28,7 @@ Control { implicitWidth: DS.Style.buttonBox.width implicitHeight: DS.Style.buttonBox.height backgroundFlowsHovered: D.ColorSelector.family === D.Palette.CrystalColor + outsideBorderColor: null + color2: color1 } } diff --git a/qt6/src/qml/FlowStyle.qml b/qt6/src/qml/FlowStyle.qml index 9a97c91d..0da28424 100644 --- a/qt6/src/qml/FlowStyle.qml +++ b/qt6/src/qml/FlowStyle.qml @@ -106,6 +106,10 @@ QtObject { common: ("#f7f7f7") crystal: Qt.rgba(0, 0, 0, 0.1) } + normalDark { + common: Qt.rgba(1, 1, 1, 0.1) + crystal: Qt.rgba(1, 1, 1, 0.1) + } hovered { common: ("#e1e1e1") crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.2) @@ -121,6 +125,10 @@ QtObject { common: ("#f0f0f0") crystal: Qt.rgba(0, 0, 0, 0.1) } + normalDark { + common: Qt.rgba(1, 1, 1, 0.1) + crystal: Qt.rgba(1, 1, 1, 0.1) + } hovered { common: ("#d2d2d2") crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.2) @@ -152,8 +160,18 @@ QtObject { common: Qt.rgba(1, 1, 1, 0.1) crystal: Qt.rgba(1, 1, 1, 0.1) } - hovered: Qt.rgba(1, 1, 1, 0.2) - pressed: Qt.rgba(0, 0, 0, 0.03) + normalDark { + common: Qt.rgba(1, 1, 1, 0.1) + crystal: Qt.rgba(1, 1, 1, 0.1) + } + hovered { + common: Qt.rgba(1, 1, 1, 0.2) + crystal: Qt.rgba(0, 0, 0, 0.05) + } + pressed { + common: Qt.rgba(1, 1, 1, 0.03) + crystal: Qt.rgba(0, 0, 0, 0.03) + } } property D.Palette outsideBorder: D.Palette { @@ -167,8 +185,8 @@ QtObject { property D.Palette text: D.Palette { normal { - common: Qt.rgba(0, 0, 0, 0.7) - crystal: Qt.rgba(0, 0, 0, 0.9) + common: Qt.rgba(0, 0, 0, 1) + crystal: Qt.rgba(0, 0, 0, 1) } pressed { common: D.DTK.makeColor(D.Color.Highlight) @@ -238,12 +256,11 @@ QtObject { property D.Palette dropShadow: D.Palette { normal { - common: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+30) + common: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(-60) crystal: Qt.rgba(0, 0, 0, 0.1) } normalDark: D.DTK.makeColor(D.Color.Highlight).saturation(+15).lightness(+12).opacity(+20) - hovered: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+30) - pressed: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+20) + pressed: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(-80) disabled: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+30) } @@ -356,14 +373,14 @@ QtObject { property QtObject iconButton: QtObject { property int backgroundSize: 36 - property int iconSize: 18 + property int iconSize: 16 property int padding: 9 } property QtObject toolButton: QtObject { - property int width: 36 - property int height: 36 - property int iconSize: 14 + property int width: 30 + property int height: 30 + property int iconSize: 16 property int indicatorRightMargin: 6 } @@ -385,10 +402,10 @@ QtObject { } property QtObject buttonBox: QtObject { - property int width: 80 - property int height: 36 - property int padding: 3 - property int spacing: 6 + property int width: 60 + property int height: 30 + property int padding: 0 + property int spacing: 0 } property QtObject comboBox: QtObject { diff --git a/qt6/src/qml/InsideBoxBorder.qml b/qt6/src/qml/InsideBoxBorder.qml index c42c30f6..154748db 100644 --- a/qt6/src/qml/InsideBoxBorder.qml +++ b/qt6/src/qml/InsideBoxBorder.qml @@ -6,7 +6,7 @@ import QtQuick 2.0 Item { property real borderWidth: 1 - property color color: "white" + property color color: Qt.rgba(1, 1, 1, 0.15) property alias radius: rect.radius Rectangle { diff --git a/qt6/src/qml/ItemDelegate.qml b/qt6/src/qml/ItemDelegate.qml index 9e810c96..f8deb11f 100644 --- a/qt6/src/qml/ItemDelegate.qml +++ b/qt6/src/qml/ItemDelegate.qml @@ -44,6 +44,7 @@ T.ItemDelegate { width: DS.Style.itemDelegate.iconSize height: DS.Style.itemDelegate.iconSize } + font: D.DTK.fontManager.t9 indicator: Loader { x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) diff --git a/qt6/src/qml/ToolButton.qml b/qt6/src/qml/ToolButton.qml index 6f47f015..5fc097c3 100644 --- a/qt6/src/qml/ToolButton.qml +++ b/qt6/src/qml/ToolButton.qml @@ -70,5 +70,6 @@ T.ToolButton { implicitWidth: DS.Style.toolButton.width implicitHeight: DS.Style.toolButton.height button: control + outsideBorderColor: null } } diff --git a/src/qml/BoxPanel.qml b/src/qml/BoxPanel.qml index 6c061d13..e3089ae8 100644 --- a/src/qml/BoxPanel.qml +++ b/src/qml/BoxPanel.qml @@ -45,7 +45,7 @@ Item { id: backgroundGradient // Use the backgroundRect's colorselecor can filter the hovered state. GradientStop { position: 0.0; color: backgroundRect.D.ColorSelector.color1} - GradientStop { position: 0.96; color: backgroundRect.D.ColorSelector.color2} + GradientStop { position: 1.0; color: backgroundRect.D.ColorSelector.color2} } anchors.fill: parent diff --git a/src/qml/ButtonBox.qml b/src/qml/ButtonBox.qml index 6bd82d3f..34a45502 100644 --- a/src/qml/ButtonBox.qml +++ b/src/qml/ButtonBox.qml @@ -28,5 +28,7 @@ Control { implicitWidth: DS.Style.buttonBox.width implicitHeight: DS.Style.buttonBox.height backgroundFlowsHovered: D.ColorSelector.family === D.Palette.CrystalColor + outsideBorderColor: null + color2: color1 } } diff --git a/src/qml/FlowStyle.qml b/src/qml/FlowStyle.qml index b34140ac..dbe607b4 100644 --- a/src/qml/FlowStyle.qml +++ b/src/qml/FlowStyle.qml @@ -106,6 +106,10 @@ QtObject { common: ("#f7f7f7") crystal: Qt.rgba(0, 0, 0, 0.1) } + normalDark { + common: Qt.rgba(1, 1, 1, 0.1) + crystal: Qt.rgba(1, 1, 1, 0.1) + } hovered { common: ("#e1e1e1") crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.2) @@ -121,6 +125,10 @@ QtObject { common: ("#f0f0f0") crystal: Qt.rgba(0, 0, 0, 0.1) } + normalDark { + common: Qt.rgba(1, 1, 1, 0.1) + crystal: Qt.rgba(1, 1, 1, 0.1) + } hovered { common: ("#d2d2d2") crystal: Qt.rgba(16.0 / 255, 16.0 / 255, 16.0 / 255, 0.2) @@ -152,8 +160,18 @@ QtObject { common: Qt.rgba(1, 1, 1, 0.1) crystal: Qt.rgba(1, 1, 1, 0.1) } - hovered: Qt.rgba(1, 1, 1, 0.2) - pressed: Qt.rgba(0, 0, 0, 0.03) + normalDark { + common: Qt.rgba(1, 1, 1, 0.1) + crystal: Qt.rgba(1, 1, 1, 0.1) + } + hovered { + common: Qt.rgba(1, 1, 1, 0.2) + crystal: Qt.rgba(0, 0, 0, 0.05) + } + pressed { + common: Qt.rgba(1, 1, 1, 0.03) + crystal: Qt.rgba(0, 0, 0, 0.03) + } } property D.Palette outsideBorder: D.Palette { @@ -167,8 +185,8 @@ QtObject { property D.Palette text: D.Palette { normal { - common: Qt.rgba(0, 0, 0, 0.7) - crystal: Qt.rgba(0, 0, 0, 0.9) + common: Qt.rgba(0, 0, 0, 1) + crystal: Qt.rgba(0, 0, 0, 1) } pressed { common: D.DTK.makeColor(D.Color.Highlight) @@ -238,12 +256,11 @@ QtObject { property D.Palette dropShadow: D.Palette { normal { - common: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+30) + common: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(-60) crystal: Qt.rgba(0, 0, 0, 0.1) } normalDark: D.DTK.makeColor(D.Color.Highlight).saturation(+15).lightness(+12).opacity(+20) - hovered: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+30) - pressed: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+20) + pressed: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(-80) disabled: D.DTK.makeColor(D.Color.Highlight).saturation(+50).lightness(-10).opacity(+30) } @@ -356,14 +373,14 @@ QtObject { property QtObject iconButton: QtObject { property int backgroundSize: 36 - property int iconSize: 18 + property int iconSize: 16 property int padding: 9 } property QtObject toolButton: QtObject { - property int width: 36 - property int height: 36 - property int iconSize: 14 + property int width: 30 + property int height: 30 + property int iconSize: 16 property int indicatorRightMargin: 6 } @@ -385,10 +402,10 @@ QtObject { } property QtObject buttonBox: QtObject { - property int width: 80 - property int height: 36 - property int padding: 3 - property int spacing: 6 + property int width: 30 + property int height: 30 + property int padding: 0 + property int spacing: 0 } property QtObject comboBox: QtObject { diff --git a/src/qml/InsideBoxBorder.qml b/src/qml/InsideBoxBorder.qml index c42c30f6..154748db 100644 --- a/src/qml/InsideBoxBorder.qml +++ b/src/qml/InsideBoxBorder.qml @@ -6,7 +6,7 @@ import QtQuick 2.0 Item { property real borderWidth: 1 - property color color: "white" + property color color: Qt.rgba(1, 1, 1, 0.15) property alias radius: rect.radius Rectangle { diff --git a/src/qml/ItemDelegate.qml b/src/qml/ItemDelegate.qml index 6b7ef13f..ed7cd1be 100644 --- a/src/qml/ItemDelegate.qml +++ b/src/qml/ItemDelegate.qml @@ -44,6 +44,7 @@ T.ItemDelegate { width: DS.Style.itemDelegate.iconSize height: DS.Style.itemDelegate.iconSize } + font: D.DTK.fontManager.t9 indicator: Loader { x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) diff --git a/src/qml/ToolButton.qml b/src/qml/ToolButton.qml index c001c559..aaf31f69 100644 --- a/src/qml/ToolButton.qml +++ b/src/qml/ToolButton.qml @@ -69,5 +69,6 @@ T.ToolButton { implicitWidth: DS.Style.toolButton.width implicitHeight: DS.Style.toolButton.height button: control + outsideBorderColor: null } }