left-bar working, bottom bar semi-broken
This commit is contained in:
@@ -10,9 +10,7 @@ QtObject {
|
||||
readonly property bool barOnBottom: position === "bottom"
|
||||
readonly property bool barOnLeft: position === "left"
|
||||
readonly property bool barOnTop: position === "top"
|
||||
required property string configDashboardPosition
|
||||
required property string configPosition
|
||||
readonly property bool dashboardOnLeft: configDashboardPosition === "left" ? !barOnLeft : barOnTop
|
||||
readonly property bool horizontal: position !== "left"
|
||||
readonly property string position: configPosition === "top" || configPosition === "bottom" ? configPosition : "left"
|
||||
required property var win
|
||||
|
||||
+10
-15
@@ -22,7 +22,8 @@ Item {
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
function inBottomPanel(panel: Item, x: real, y: real): bool {
|
||||
return y > root.height - panel.height - geometry.insetBottom(borderThickness) && withinPanelWidth(panel, x, y);
|
||||
const panelHeight = panel.height * (1 - (panel.offsetScale ?? 0));
|
||||
return y > root.height - (panelHeight + geometry.insetBottom(borderThickness)) && withinPanelWidth(panel, x, y);
|
||||
}
|
||||
|
||||
function inLeftPanel(panel: Item, x: real, y: real): bool {
|
||||
@@ -37,17 +38,12 @@ Item {
|
||||
}
|
||||
|
||||
function inRightPanel(panel: Item, x: real, y: real): bool {
|
||||
return x > panel.x - geometry.insetLeft(borderThickness) && withinPanelHeight(panel, x, y);
|
||||
return x > panel.x + geometry.insetLeft(borderThickness) && withinPanelHeight(panel, x, y);
|
||||
}
|
||||
|
||||
function inTopPanel(panel: Item, x: real, y: real): bool {
|
||||
return y < geometry.insetTop(borderThickness) + panel.height && withinPanelWidth(panel, x, y);
|
||||
}
|
||||
|
||||
function onWheel(event: WheelEvent): void {
|
||||
if (event.x < bar.implicitWidth) {
|
||||
bar.handleWheel(event.y, event.angleDelta);
|
||||
}
|
||||
const panelHeight = panel.height * (1 - (panel.offsetScale ?? 0));
|
||||
return y < geometry.insetTop(borderThickness) + panelHeight && withinPanelWidth(panel, x, y);
|
||||
}
|
||||
|
||||
function withinPanelHeight(panel: Item, x: real, y: real): bool {
|
||||
@@ -89,12 +85,11 @@ Item {
|
||||
if (root.singleGestureTriggered)
|
||||
return;
|
||||
|
||||
if (root.geometry.barContains(centroid.pressPosition.x, centroid.pressPosition.y, true)) {
|
||||
const barDrag = root.geometry.inwardDrag(dragX, dragY);
|
||||
if (barDrag > 20) {
|
||||
if (root.geometry.insetTop(root.borderThickness) > centroid.pressPosition.y) {
|
||||
if (dragY > 20) {
|
||||
root.visibilities.settings = true;
|
||||
root.singleGestureTriggered = true;
|
||||
} else if (barDrag < -20) {
|
||||
} else if (dragY < -20) {
|
||||
root.visibilities.settings = false;
|
||||
root.singleGestureTriggered = true;
|
||||
}
|
||||
@@ -228,8 +223,8 @@ Item {
|
||||
if (Config.dock.enable && Config.dock.hoverToReveal && !root.visibilities.dock && !root.visibilities.launcher && root.inBottomPanel(root.panels.dock, x, y))
|
||||
root.visibilities.dock = true;
|
||||
|
||||
if (y < root.bar.implicitHeight)
|
||||
root.bar.checkPopout(x);
|
||||
if (root.geometry.barContains(x, y))
|
||||
root.bar.checkPopout(root.geometry.axisPos(x, y));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
-10
@@ -27,6 +27,7 @@ Item {
|
||||
readonly property alias dock: dock
|
||||
readonly property alias drawing: drawing
|
||||
required property var drawingItem
|
||||
required property EdgeGeometry geometry
|
||||
readonly property alias launcher: launcher
|
||||
readonly property alias notifications: notifications
|
||||
readonly property alias osd: osd
|
||||
@@ -43,9 +44,11 @@ Item {
|
||||
readonly property alias utilities: utilities
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
anchors.bottomMargin: geometry.insetBottom(borderThickness)
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: geometry.insetLeft(borderThickness)
|
||||
anchors.margins: borderThickness
|
||||
anchors.topMargin: bar.implicitHeight
|
||||
anchors.topMargin: geometry.insetTop(borderThickness)
|
||||
|
||||
Item {
|
||||
id: resourcesWrapper
|
||||
@@ -53,14 +56,15 @@ Item {
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
clip: true
|
||||
implicitHeight: resources.implicitHeight * (1 - resources.offsetScale)
|
||||
implicitWidth: resources.implicitWidth
|
||||
implicitHeight: root.geometry.horizontal ? resources.implicitHeight * (1 - resources.offsetScale) : resources.implicitHeight
|
||||
implicitWidth: root.geometry.horizontal ? resources.implicitWidth : resources.implicitWidth * (1 - resources.offsetScale)
|
||||
|
||||
Resources.Wrapper {
|
||||
id: resources
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
horizontal: root.geometry.horizontal
|
||||
visibilities: root.visibilities
|
||||
}
|
||||
}
|
||||
@@ -99,8 +103,8 @@ Item {
|
||||
Modules.ClipWrapper {
|
||||
id: popouts
|
||||
|
||||
anchors.top: parent.top
|
||||
borderThickness: root.borderThickness
|
||||
position: root.geometry.position
|
||||
screen: root.screen
|
||||
}
|
||||
|
||||
@@ -147,11 +151,13 @@ Item {
|
||||
|
||||
property real offsetScale: dashboard.shouldBeActive ? 0 : 1
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: root.geometry.barOnLeft || root.geometry.barOnBottom ? parent.bottom : undefined
|
||||
anchors.left: root.geometry.barOnLeft ? parent.left : undefined
|
||||
anchors.right: root.geometry.barOnLeft ? undefined : parent.right
|
||||
anchors.top: root.geometry.barOnBottom || root.geometry.barOnLeft ? undefined : parent.top
|
||||
clip: true
|
||||
implicitHeight: dashboard.implicitHeight * (1 - offsetScale)
|
||||
implicitWidth: dashboard.implicitWidth
|
||||
implicitHeight: root.geometry.horizontal ? dashboard.implicitHeight * (1 - offsetScale) : dashboard.implicitHeight
|
||||
implicitWidth: root.geometry.horizontal ? dashboard.implicitWidth : dashboard.implicitWidth * (1 - offsetScale)
|
||||
|
||||
Behavior on offsetScale {
|
||||
Anim {
|
||||
@@ -164,8 +170,7 @@ Item {
|
||||
id: dashboard
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: (-implicitHeight - 5) * offsetScale
|
||||
horizontal: root.geometry.horizontal
|
||||
offsetScale: dashboardWrapper.offsetScale
|
||||
visibilities: root.visibilities
|
||||
}
|
||||
|
||||
+13
-8
@@ -7,17 +7,18 @@ import qs.Modules.Bar as Bar
|
||||
Region {
|
||||
id: root
|
||||
|
||||
required property Bar.BarLoader bar
|
||||
// required property Bar.BarLoader bar
|
||||
readonly property real borderThickness: win.borderThickness
|
||||
required property EdgeGeometry geometry
|
||||
readonly property alias menuPopoutRegion: menuPopoutRegion
|
||||
required property Panels panels
|
||||
required property var win
|
||||
|
||||
height: win.height - bar.implicitHeight - win.borderThickness - win.dragMaskPadding * 2
|
||||
height: win.height - geometry.insetTop(borderThickness, true) - geometry.insetBottom(borderThickness, true) - win.dragMaskPadding * 2
|
||||
intersection: Intersection.Xor
|
||||
width: win.width - win.borderThickness * 2 - win.dragMaskPadding * 2
|
||||
x: win.borderThickness + win.dragMaskPadding
|
||||
y: bar.implicitHeight + win.dragMaskPadding
|
||||
width: win.width - geometry.insetLeft(borderThickness, true) * 2 - win.dragMaskPadding * 2
|
||||
x: geometry.insetLeft(borderThickness, true) + win.dragMaskPadding
|
||||
y: geometry.insetTop(borderThickness, true) + win.dragMaskPadding
|
||||
|
||||
R {
|
||||
panel: root.panels.dashboardWrapper
|
||||
@@ -41,17 +42,21 @@ Region {
|
||||
}
|
||||
|
||||
R {
|
||||
height: panel.height + root.geometry.insetTop(root.borderThickness)
|
||||
panel: root.panels.notifications
|
||||
y: 0
|
||||
}
|
||||
|
||||
R {
|
||||
height: panel.height * (1 - root.panels.utilities.offsetScale) + root.borderThickness
|
||||
height: panel.height * (1 - root.panels.utilities.offsetScale) + root.geometry.insetBottom(root.borderThickness)
|
||||
panel: root.panels.utilities
|
||||
y: root.win.height - height
|
||||
}
|
||||
|
||||
R {
|
||||
height: root.geometry.horizontal ? panel.height * (1 - root.panels.popoutsWrapper.offsetScale) : panel.height
|
||||
panel: root.panels.popoutsWrapper
|
||||
width: root.geometry.horizontal ? panel.width : panel.width * (1 - root.panels.popoutsWrapper.offsetScale)
|
||||
}
|
||||
|
||||
R {
|
||||
@@ -82,7 +87,7 @@ Region {
|
||||
height: panel.height
|
||||
intersection: Intersection.Subtract
|
||||
width: panel.width
|
||||
x: panel.x + root.borderThickness
|
||||
y: panel.y + root.bar.implicitHeight
|
||||
x: panel.x + root.geometry.insetLeft(root.borderThickness)
|
||||
y: panel.y + root.geometry.insetTop(root.borderThickness)
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -212,15 +212,15 @@ CustomWindow {
|
||||
PanelBg {
|
||||
id: dashBg
|
||||
|
||||
property real extraHeight: 0.2
|
||||
property real extraExtent: 0.2
|
||||
|
||||
deformAmount: 0.06
|
||||
implicitHeight: panels.dashboard.height * (1 + extraHeight)
|
||||
implicitWidth: panels.dashboard.width
|
||||
implicitHeight: panels.dashboard.height * (geometry.horizontal ? 1 + extraExtent : 1)
|
||||
implicitWidth: panels.dashboard.width * (geometry.horizontal ? 1 : 1 + extraExtent)
|
||||
panel: panels.dashboardWrapper
|
||||
radius: Appearance.rounding.normal
|
||||
x: panels.dashboardWrapper.x + panels.dashboard.x + root.borderThickness
|
||||
y: panels.dashboardWrapper.y + panels.dashboard.y + geometry.insetTop(root.borderThickness) - panels.dashboard.height * extraHeight
|
||||
x: panels.dashboardWrapper.x + panels.dashboard.x + geometry.insetLeft(root.borderThickness) - (geometry.horizontal ? 0 : panels.dashboard.width * extraExtent)
|
||||
y: panels.dashboardWrapper.y + panels.dashboard.y + geometry.insetTop(root.borderThickness) - (geometry.horizontal ? panels.dashboard.height * extraExtent : 0)
|
||||
}
|
||||
|
||||
PanelBg {
|
||||
@@ -232,7 +232,7 @@ CustomWindow {
|
||||
implicitHeight: panels.launcher.height * (1 + extraHeight)
|
||||
panel: panels.launcher
|
||||
radius: Appearance.rounding.smallest + 5
|
||||
y: panels.launcher.y + bar.implicitHeight
|
||||
y: panels.launcher.y + geometry.insetTop(root.borderThickness)
|
||||
}
|
||||
|
||||
PanelBg {
|
||||
@@ -299,8 +299,8 @@ CustomWindow {
|
||||
implicitWidth: panels.resources.width
|
||||
panel: panels.resourcesWrapper
|
||||
radius: Appearance.rounding.large
|
||||
x: panels.resourcesWrapper.x + panels.resources.x + root.borderThickness
|
||||
y: panels.resourcesWrapper.y + panels.resources.y + bar.implicitHeight
|
||||
x: panels.resourcesWrapper.x + panels.resources.x + geometry.insetLeft(root.borderThickness)
|
||||
y: panels.resourcesWrapper.y + panels.resources.y + geometry.insetTop(root.borderThickness)
|
||||
}
|
||||
|
||||
PanelBg {
|
||||
|
||||
Reference in New Issue
Block a user