refactor: 部分控件用enabled替代disabled进行逻辑判断,提升使用原生enabled属性时的兼容性
This commit is contained in:
parent
b2fd3acda3
commit
a787a733c4
|
@ -55,7 +55,7 @@ T.ComboBox {
|
||||||
font:control.font
|
font:control.font
|
||||||
readOnly: control.down
|
readOnly: control.down
|
||||||
color: {
|
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(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)
|
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
|
anchors.margins: -2
|
||||||
}
|
}
|
||||||
color:{
|
color:{
|
||||||
if(disabled){
|
if(!enabled){
|
||||||
return disableColor
|
return disableColor
|
||||||
}
|
}
|
||||||
return hovered ? hoverColor :normalColor
|
return hovered ? hoverColor :normalColor
|
||||||
|
|
|
@ -6,7 +6,7 @@ T.MenuBarItem {
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property color textColor: {
|
property color textColor: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
if(disabled){
|
if(!enabled){
|
||||||
return Qt.rgba(131/255,131/255,131/255,1)
|
return Qt.rgba(131/255,131/255,131/255,1)
|
||||||
}
|
}
|
||||||
if(pressed){
|
if(pressed){
|
||||||
|
@ -14,7 +14,7 @@ T.MenuBarItem {
|
||||||
}
|
}
|
||||||
return Qt.rgba(1,1,1,1)
|
return Qt.rgba(1,1,1,1)
|
||||||
}else{
|
}else{
|
||||||
if(disabled){
|
if(!enabled){
|
||||||
return Qt.rgba(160/255,160/255,160/255,1)
|
return Qt.rgba(160/255,160/255,160/255,1)
|
||||||
}
|
}
|
||||||
if(pressed){
|
if(pressed){
|
||||||
|
|
|
@ -139,13 +139,13 @@ T.SpinBox {
|
||||||
radius: 4
|
radius: 4
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: {
|
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(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)
|
return FluTheme.dark ? Qt.rgba(76/255,76/255,76/255,1) : Qt.rgba(240/255,240/255,240/255,1)
|
||||||
}
|
}
|
||||||
color: {
|
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)
|
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
||||||
}
|
}
|
||||||
if(contentItem.activeFocus){
|
if(contentItem.activeFocus){
|
||||||
|
|
|
@ -6,7 +6,7 @@ FluControlBackground{
|
||||||
property Item inputItem
|
property Item inputItem
|
||||||
id:control
|
id:control
|
||||||
color: {
|
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)
|
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){
|
if(inputItem && inputItem.activeFocus){
|
||||||
|
|
|
@ -55,7 +55,7 @@ T.ComboBox {
|
||||||
font:control.font
|
font:control.font
|
||||||
readOnly: control.down
|
readOnly: control.down
|
||||||
color: {
|
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(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)
|
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
|
anchors.margins: -2
|
||||||
}
|
}
|
||||||
color:{
|
color:{
|
||||||
if(disabled){
|
if(!enabled){
|
||||||
return disableColor
|
return disableColor
|
||||||
}
|
}
|
||||||
return hovered ? hoverColor :normalColor
|
return hovered ? hoverColor :normalColor
|
||||||
|
|
|
@ -7,7 +7,7 @@ T.MenuBarItem {
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property color textColor: {
|
property color textColor: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
if(disabled){
|
if(!enabled){
|
||||||
return Qt.rgba(131/255,131/255,131/255,1)
|
return Qt.rgba(131/255,131/255,131/255,1)
|
||||||
}
|
}
|
||||||
if(pressed){
|
if(pressed){
|
||||||
|
@ -15,7 +15,7 @@ T.MenuBarItem {
|
||||||
}
|
}
|
||||||
return Qt.rgba(1,1,1,1)
|
return Qt.rgba(1,1,1,1)
|
||||||
}else{
|
}else{
|
||||||
if(disabled){
|
if(!enabled){
|
||||||
return Qt.rgba(160/255,160/255,160/255,1)
|
return Qt.rgba(160/255,160/255,160/255,1)
|
||||||
}
|
}
|
||||||
if(pressed){
|
if(pressed){
|
||||||
|
|
|
@ -140,13 +140,13 @@ T.SpinBox {
|
||||||
radius: 4
|
radius: 4
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: {
|
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(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)
|
return FluTheme.dark ? Qt.rgba(76/255,76/255,76/255,1) : Qt.rgba(240/255,240/255,240/255,1)
|
||||||
}
|
}
|
||||||
color: {
|
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)
|
return FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
||||||
}
|
}
|
||||||
if(contentItem.activeFocus){
|
if(contentItem.activeFocus){
|
||||||
|
|
|
@ -6,7 +6,7 @@ FluControlBackground{
|
||||||
property Item inputItem
|
property Item inputItem
|
||||||
id:control
|
id:control
|
||||||
color: {
|
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)
|
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){
|
if(inputItem && inputItem.activeFocus){
|
||||||
|
|
Loading…
Reference in New Issue