refactor: 部分控件用enabled替代disabled进行逻辑判断,提升使用原生enabled属性时的兼容性

This commit is contained in:
Polaris-Night 2025-05-11 22:27:48 +08:00
parent b2fd3acda3
commit a787a733c4
8 changed files with 14 additions and 14 deletions

View File

@ -55,7 +55,7 @@ T.ComboBox {
font:control.font
readOnly: control.down
color: {
if(control.disabled) {
if(!control.enabled) {
return FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
}
return FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)
@ -97,7 +97,7 @@ T.ComboBox {
anchors.margins: -2
}
color:{
if(disabled){
if(!enabled){
return disableColor
}
return hovered ? hoverColor :normalColor

View File

@ -6,7 +6,7 @@ T.MenuBarItem {
property bool disabled: false
property color textColor: {
if(FluTheme.dark){
if(disabled){
if(!enabled){
return Qt.rgba(131/255,131/255,131/255,1)
}
if(pressed){
@ -14,7 +14,7 @@ T.MenuBarItem {
}
return Qt.rgba(1,1,1,1)
}else{
if(disabled){
if(!enabled){
return Qt.rgba(160/255,160/255,160/255,1)
}
if(pressed){

View File

@ -139,13 +139,13 @@ T.SpinBox {
radius: 4
border.width: 1
border.color: {
if(contentItem.disabled){
if(!contentItem.enabled){
return FluTheme.dark ? Qt.rgba(73/255,73/255,73/255,1) : Qt.rgba(237/255,237/255,237/255,1)
}
return FluTheme.dark ? Qt.rgba(76/255,76/255,76/255,1) : Qt.rgba(240/255,240/255,240/255,1)
}
color: {
if(contentItem.disabled){
if(!contentItem.enabled){
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
}
if(contentItem.activeFocus){

View File

@ -6,7 +6,7 @@ FluControlBackground{
property Item inputItem
id:control
color: {
if(inputItem && inputItem.disabled){
if(inputItem && !inputItem.enabled){
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
}
if(inputItem && inputItem.activeFocus){

View File

@ -55,7 +55,7 @@ T.ComboBox {
font:control.font
readOnly: control.down
color: {
if(control.disabled) {
if(!control.enabled) {
return FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
}
return FluTheme.dark ? Qt.rgba(255/255,255/255,255/255,1) : Qt.rgba(27/255,27/255,27/255,1)
@ -97,7 +97,7 @@ T.ComboBox {
anchors.margins: -2
}
color:{
if(disabled){
if(!enabled){
return disableColor
}
return hovered ? hoverColor :normalColor

View File

@ -7,7 +7,7 @@ T.MenuBarItem {
property bool disabled: false
property color textColor: {
if(FluTheme.dark){
if(disabled){
if(!enabled){
return Qt.rgba(131/255,131/255,131/255,1)
}
if(pressed){
@ -15,7 +15,7 @@ T.MenuBarItem {
}
return Qt.rgba(1,1,1,1)
}else{
if(disabled){
if(!enabled){
return Qt.rgba(160/255,160/255,160/255,1)
}
if(pressed){

View File

@ -140,13 +140,13 @@ T.SpinBox {
radius: 4
border.width: 1
border.color: {
if(contentItem.disabled){
if(!contentItem.enabled){
return FluTheme.dark ? Qt.rgba(73/255,73/255,73/255,1) : Qt.rgba(237/255,237/255,237/255,1)
}
return FluTheme.dark ? Qt.rgba(76/255,76/255,76/255,1) : Qt.rgba(240/255,240/255,240/255,1)
}
color: {
if(contentItem.disabled){
if(!contentItem.enabled){
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
}
if(contentItem.activeFocus){

View File

@ -6,7 +6,7 @@ FluControlBackground{
property Item inputItem
id:control
color: {
if(inputItem && inputItem.disabled){
if(inputItem && !inputItem.enabled){
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
}
if(inputItem && inputItem.activeFocus){