Restore compact status icon spacing
This commit is contained in:
@@ -44,4 +44,8 @@ BarIconButton {
|
|||||||
maintainIndicatorReveal: indicatorBlock === "inactive"
|
maintainIndicatorReveal: indicatorBlock === "inactive"
|
||||||
revealHost: indicatorHost
|
revealHost: indicatorHost
|
||||||
fontSize: Style.font.caption
|
fontSize: Style.font.caption
|
||||||
|
horizontalMargin: 5
|
||||||
|
verticalPadding: 5
|
||||||
|
fixedWidth: -1
|
||||||
|
fixedHeight: -1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ BarWidget {
|
|||||||
property bool indicatorItemHovered: false
|
property bool indicatorItemHovered: false
|
||||||
readonly property bool alwaysShowIndicators: setting("alwaysShow", false) === true
|
readonly property bool alwaysShowIndicators: setting("alwaysShow", false) === true
|
||||||
readonly property bool revealInactiveIndicators: alwaysShowIndicators || indicatorAreaHovered || indicatorItemHovered || (bar && bar.centerSectionRevealHeld === true && bar.centerHoverRevealSuppressed !== true)
|
readonly property bool revealInactiveIndicators: alwaysShowIndicators || indicatorAreaHovered || indicatorItemHovered || (bar && bar.centerSectionRevealHeld === true && bar.centerHoverRevealSuppressed !== true)
|
||||||
|
readonly property bool hasVisibleIndicators: activeIndicatorIds.length > 0 || revealInactiveIndicators
|
||||||
|
|
||||||
signal refreshRequested()
|
signal refreshRequested()
|
||||||
|
|
||||||
@@ -187,6 +188,8 @@ BarWidget {
|
|||||||
|
|
||||||
visible: !root.vertical
|
visible: !root.vertical
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
leftPadding: root.hasVisibleIndicators ? Style.spacing.sm : 0
|
||||||
|
rightPadding: leftPadding
|
||||||
|
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
onHoveredChanged: root.setIndicatorAreaHovered(hovered)
|
onHoveredChanged: root.setIndicatorAreaHovered(hovered)
|
||||||
@@ -229,6 +232,8 @@ BarWidget {
|
|||||||
|
|
||||||
visible: root.vertical
|
visible: root.vertical
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
topPadding: root.hasVisibleIndicators ? Style.spaceReal(1.5) : 0
|
||||||
|
bottomPadding: topPadding
|
||||||
|
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
onHoveredChanged: root.setIndicatorAreaHovered(hovered)
|
onHoveredChanged: root.setIndicatorAreaHovered(hovered)
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ BarWidget {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
bar: root.bar
|
bar: root.bar
|
||||||
text: "\uf021"
|
text: "\uf021"
|
||||||
|
fontSize: Style.font.caption
|
||||||
tooltipText: ""
|
tooltipText: ""
|
||||||
onPressed: root.runUpdate()
|
onPressed: root.runUpdate()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ ShellRoot {
|
|||||||
fail("vertical icon does not use the shared slot")
|
fail("vertical icon does not use the shared slot")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (verticalIndicator.implicitWidth !== Style.bar.sizeVertical || verticalIndicator.implicitHeight !== Style.bar.iconSlot) {
|
if (verticalIndicator.implicitWidth !== Style.bar.sizeVertical || verticalIndicator.implicitHeight >= Style.bar.iconSlot) {
|
||||||
fail("vertical indicator does not use the shared slot")
|
fail("vertical indicator does not retain compact spacing")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (verticalIndicator.glyphFontSize !== Style.font.caption) {
|
if (verticalIndicator.glyphFontSize !== Style.font.caption) {
|
||||||
@@ -81,6 +81,15 @@ ShellRoot {
|
|||||||
fail("vertical indicator is not optically centered")
|
fail("vertical indicator is not optically centered")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (horizontalIndicator.implicitWidth >= Style.bar.iconSlot) {
|
||||||
|
fail("horizontal indicator does not retain compact spacing")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (horizontalIndicatorPair.implicitWidth >= Style.bar.iconSlot * 2
|
||||||
|
|| verticalIndicatorPair.implicitHeight >= Style.bar.iconSlot * 2) {
|
||||||
|
fail("indicator groups do not retain compact internal spacing")
|
||||||
|
return
|
||||||
|
}
|
||||||
console.log("RESULT pass")
|
console.log("RESULT pass")
|
||||||
Qt.quit()
|
Qt.quit()
|
||||||
})
|
})
|
||||||
@@ -124,7 +133,16 @@ ShellRoot {
|
|||||||
iconComponent: Component { Rectangle { width: 12; height: 12 } }
|
iconComponent: Component { Rectangle { width: 12; height: 12 } }
|
||||||
}
|
}
|
||||||
BarIconButton { id: verticalIcon; bar: verticalBar; text: "\uf021" }
|
BarIconButton { id: verticalIcon; bar: verticalBar; text: "\uf021" }
|
||||||
BarIndicator { id: verticalIndicator; bar: verticalBar; active: true; activeText: "" }
|
Row {
|
||||||
|
id: horizontalIndicatorPair
|
||||||
|
BarIndicator { id: horizontalIndicator; bar: testBar; active: true; activeText: "" }
|
||||||
|
BarIndicator { bar: testBar; active: true; activeText: "" }
|
||||||
|
}
|
||||||
|
Column {
|
||||||
|
id: verticalIndicatorPair
|
||||||
|
BarIndicator { id: verticalIndicator; bar: verticalBar; active: true; activeText: "" }
|
||||||
|
BarIndicator { bar: verticalBar; active: true; activeText: "" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
QML
|
QML
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user