bar: some internal fixes
This commit is contained in:
parent
147564a002
commit
1bd92b4740
2 changed files with 6 additions and 8 deletions
|
|
@ -13,7 +13,7 @@ Item {
|
|||
required property PersistentProperties visibilities
|
||||
required property BarPopouts.Wrapper popouts
|
||||
|
||||
readonly property int exclusiveZone: Config.bar.persistent || (visibilities.bar && !isHovered) ? content.implicitWidth : Config.border.thickness
|
||||
readonly property int exclusiveZone: Config.bar.persistent || visibilities.bar ? content.implicitWidth : Config.border.thickness
|
||||
property bool isHovered
|
||||
|
||||
function checkPopout(y: real): void {
|
||||
|
|
@ -26,7 +26,7 @@ Item {
|
|||
|
||||
states: State {
|
||||
name: "visible"
|
||||
when: Config.bar.persistent || root.visibilities.bar
|
||||
when: Config.bar.persistent || root.visibilities.bar || root.isHovered
|
||||
|
||||
PropertyChanges {
|
||||
root.implicitWidth: content.implicitWidth
|
||||
|
|
@ -63,7 +63,7 @@ Item {
|
|||
Loader {
|
||||
id: content
|
||||
|
||||
Component.onCompleted: active = Qt.binding(() => root.visibilities.bar || root.visible)
|
||||
Component.onCompleted: active = Qt.binding(() => Config.bar.persistent || root.visibilities.bar || root.isHovered || root.visible)
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ MouseArea {
|
|||
}
|
||||
popouts.hasCurrent = false;
|
||||
|
||||
if (bar.isHovered && Config.bar.showOnHover)
|
||||
visibilities.bar = false;
|
||||
if (Config.bar.showOnHover)
|
||||
bar.isHovered = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +72,6 @@ MouseArea {
|
|||
|
||||
// Show bar in non-exclusive mode on hover
|
||||
if (!visibilities.bar && Config.bar.showOnHover && x < bar.implicitWidth) {
|
||||
visibilities.bar = true;
|
||||
bar.isHovered = true;
|
||||
}
|
||||
|
||||
|
|
@ -81,8 +80,7 @@ MouseArea {
|
|||
const dragX = x - dragStart.x;
|
||||
if (dragX > Config.bar.dragThreshold) {
|
||||
visibilities.bar = true;
|
||||
bar.isHovered = false;
|
||||
} else if (!bar.isHovered && dragX < -Config.bar.dragThreshold) {
|
||||
} else if (dragX < -Config.bar.dragThreshold) {
|
||||
visibilities.bar = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue