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 PersistentProperties visibilities
|
||||||
required property BarPopouts.Wrapper popouts
|
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
|
property bool isHovered
|
||||||
|
|
||||||
function checkPopout(y: real): void {
|
function checkPopout(y: real): void {
|
||||||
|
|
@ -26,7 +26,7 @@ Item {
|
||||||
|
|
||||||
states: State {
|
states: State {
|
||||||
name: "visible"
|
name: "visible"
|
||||||
when: Config.bar.persistent || root.visibilities.bar
|
when: Config.bar.persistent || root.visibilities.bar || root.isHovered
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
root.implicitWidth: content.implicitWidth
|
root.implicitWidth: content.implicitWidth
|
||||||
|
|
@ -63,7 +63,7 @@ Item {
|
||||||
Loader {
|
Loader {
|
||||||
id: content
|
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.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,8 @@ MouseArea {
|
||||||
}
|
}
|
||||||
popouts.hasCurrent = false;
|
popouts.hasCurrent = false;
|
||||||
|
|
||||||
if (bar.isHovered && Config.bar.showOnHover)
|
if (Config.bar.showOnHover)
|
||||||
visibilities.bar = false;
|
bar.isHovered = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,7 +72,6 @@ MouseArea {
|
||||||
|
|
||||||
// Show bar in non-exclusive mode on hover
|
// Show bar in non-exclusive mode on hover
|
||||||
if (!visibilities.bar && Config.bar.showOnHover && x < bar.implicitWidth) {
|
if (!visibilities.bar && Config.bar.showOnHover && x < bar.implicitWidth) {
|
||||||
visibilities.bar = true;
|
|
||||||
bar.isHovered = true;
|
bar.isHovered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -81,8 +80,7 @@ MouseArea {
|
||||||
const dragX = x - dragStart.x;
|
const dragX = x - dragStart.x;
|
||||||
if (dragX > Config.bar.dragThreshold) {
|
if (dragX > Config.bar.dragThreshold) {
|
||||||
visibilities.bar = true;
|
visibilities.bar = true;
|
||||||
bar.isHovered = false;
|
} else if (dragX < -Config.bar.dragThreshold) {
|
||||||
} else if (!bar.isHovered && dragX < -Config.bar.dragThreshold) {
|
|
||||||
visibilities.bar = false;
|
visibilities.bar = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue