RibbonSwitchButton,RibbonCheckBox: Improved.

This commit is contained in:
Mentalflow 2024-06-22 18:05:45 +08:00
parent fc4c1bade1
commit 40197a4387
Signed by: Mentalflow
GPG Key ID: 5AE68D4401A2EE71
4 changed files with 10 additions and 10 deletions

View File

@ -12,13 +12,13 @@ Button {
checkable: true checkable: true
property bool isDarkMode: RibbonTheme.isDarkMode property bool isDarkMode: RibbonTheme.isDarkMode
property int btnSize: 20 property int btnSize: 16
property string borderColor: isDarkMode ? "white" : "black" property string borderColor: isDarkMode ? "white" : "black"
property real borderWidth: 1.4 property real borderWidth: 1.4
property string iconColor: "white" property string iconColor: "white"
property string iconFilledBgColor: "#2143AB" property string iconFilledBgColor: "#2143AB"
property string textColor: isDarkMode ? "white" : "black" property string textColor: isDarkMode ? "white" : "black"
property int textSize: 11 property int textSize: 12
property bool textBold: false property bool textBold: false
property bool textOnLeft: false property bool textOnLeft: false
property bool showTooltip: false property bool showTooltip: false
@ -43,12 +43,12 @@ Button {
color: control.borderColor color: control.borderColor
width: control.borderWidth width: control.borderWidth
} }
radius: 4.5 radius: 0.225 * btnSize
Rectangle{ Rectangle{
id: bg_fill id: bg_fill
anchors.fill: parent anchors.fill: parent
scale: control.hovered || control.pressed ? 0.6 : 1.05 scale: control.hovered || control.pressed ? 0.6 : 1.05
radius: 4.5 radius: 0.225 * btnSize
color: !control.pressed?control.iconFilledBgColor:Qt.darker(control.iconFilledBgColor) color: !control.pressed?control.iconFilledBgColor:Qt.darker(control.iconFilledBgColor)
visible: control.hovered || control.pressed || control.checked visible: control.hovered || control.pressed || control.checked
Behavior on scale{ Behavior on scale{

View File

@ -15,7 +15,7 @@ Button {
property bool showGrabberText: true property bool showGrabberText: true
property string grabberText: control.checked ? qsTr("Open") : qsTr("Close") property string grabberText: control.checked ? qsTr("Open") : qsTr("Close")
property string textColor: isDarkMode ? "white" : "black" property string textColor: isDarkMode ? "white" : "black"
property int textSize: 11 property int textSize: 12
property string grabberCheckedColor: isDarkMode ? "#8AAAEB" : "#2850A4" property string grabberCheckedColor: isDarkMode ? "#8AAAEB" : "#2850A4"
property string grabberUncheckedColor: isDarkMode ? "#292929" : "white" property string grabberUncheckedColor: isDarkMode ? "#292929" : "white"
property string grabberTextCheckedColor: isDarkMode ? "black" : "white" property string grabberTextCheckedColor: isDarkMode ? "black" : "white"

View File

@ -12,13 +12,13 @@ Button {
checkable: true checkable: true
property bool isDarkMode: RibbonTheme.isDarkMode property bool isDarkMode: RibbonTheme.isDarkMode
property int btnSize: 20 property int btnSize: 16
property string borderColor: isDarkMode ? "white" : "black" property string borderColor: isDarkMode ? "white" : "black"
property real borderWidth: 1.4 property real borderWidth: 1.4
property string iconColor: "white" property string iconColor: "white"
property string iconFilledBgColor: "#2143AB" property string iconFilledBgColor: "#2143AB"
property string textColor: isDarkMode ? "white" : "black" property string textColor: isDarkMode ? "white" : "black"
property int textSize: 11 property int textSize: 12
property bool textBold: false property bool textBold: false
property bool textOnLeft: false property bool textOnLeft: false
property bool showTooltip: false property bool showTooltip: false
@ -43,12 +43,12 @@ Button {
color: control.borderColor color: control.borderColor
width: control.borderWidth width: control.borderWidth
} }
radius: 4.5 radius: 0.225 * btnSize
Rectangle{ Rectangle{
id: bg_fill id: bg_fill
anchors.fill: parent anchors.fill: parent
scale: control.hovered || control.pressed ? 0.6 : 1.05 scale: control.hovered || control.pressed ? 0.6 : 1.05
radius: 4.5 radius: 0.225 * btnSize
color: !control.pressed?control.iconFilledBgColor:Qt.darker(control.iconFilledBgColor) color: !control.pressed?control.iconFilledBgColor:Qt.darker(control.iconFilledBgColor)
visible: control.hovered || control.pressed || control.checked visible: control.hovered || control.pressed || control.checked
Behavior on scale{ Behavior on scale{

View File

@ -15,7 +15,7 @@ Button {
property bool showGrabberText: true property bool showGrabberText: true
property string grabberText: control.checked ? qsTr("Open") : qsTr("Close") property string grabberText: control.checked ? qsTr("Open") : qsTr("Close")
property string textColor: isDarkMode ? "white" : "black" property string textColor: isDarkMode ? "white" : "black"
property int textSize: 11 property int textSize: 12
property string grabberCheckedColor: isDarkMode ? "#8AAAEB" : "#2850A4" property string grabberCheckedColor: isDarkMode ? "#8AAAEB" : "#2850A4"
property string grabberUncheckedColor: isDarkMode ? "#292929" : "white" property string grabberUncheckedColor: isDarkMode ? "#292929" : "white"
property string grabberTextCheckedColor: isDarkMode ? "black" : "white" property string grabberTextCheckedColor: isDarkMode ? "black" : "white"