mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
NIconButton: better disabled state
This commit is contained in:
@@ -32,7 +32,8 @@ Rectangle {
|
||||
implicitWidth: size
|
||||
implicitHeight: size
|
||||
|
||||
color: root.hovering ? colorBgHover : colorBg
|
||||
opacity: root.enabled ? Style.opacityFull : Style.opacityMedium
|
||||
color: root.enabled && root.hovering ? colorBgHover : colorBg
|
||||
radius: width * 0.5
|
||||
border.color: root.hovering ? colorBorderHover : colorBorder
|
||||
border.width: Math.max(1, Style.borderS * scaling)
|
||||
@@ -41,7 +42,6 @@ Rectangle {
|
||||
text: root.icon
|
||||
font.pointSize: root.fontPointSize * scaling
|
||||
color: root.hovering ? colorFgHover : colorFg
|
||||
opacity: root.enabled ? Style.opacityFull : Style.opacityMedium
|
||||
// Center horizontally
|
||||
x: (root.width - width) / 2
|
||||
// Center vertically accounting for font metrics
|
||||
@@ -56,8 +56,9 @@ Rectangle {
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
enabled: root.enabled
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
hoverEnabled: true
|
||||
onEntered: {
|
||||
|
||||
@@ -87,13 +87,14 @@ NBox {
|
||||
colorFg: Color.mOnPrimary
|
||||
colorBgHover: Color.mSecondary
|
||||
colorFgHover: Color.mOnSecondary
|
||||
enabled: comboBox.selectedKey !== ""
|
||||
enabled: comboBox.currentKey !== ""
|
||||
tooltipText: "Add widget to this section"
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.leftMargin: Style.marginS * scaling
|
||||
onClicked: {
|
||||
if (comboBox.currentKey !== "") {
|
||||
addWidget(comboBox.currentKey, sectionName.toLowerCase())
|
||||
comboBox.currentKey = "battery"
|
||||
comboBox.currentKey = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user