start of refactor
This commit is contained in:
@@ -20,15 +20,15 @@ CustomMouseArea {
|
|||||||
required property PersistentProperties visibilities
|
required property PersistentProperties visibilities
|
||||||
|
|
||||||
function inBottomPanel(panel: Item, x: real, y: real): bool {
|
function inBottomPanel(panel: Item, x: real, y: real): bool {
|
||||||
return y > root.height - panel.height && withinPanelWidth(panel, x, y);
|
return y > root.height - panel.height - Config.barConfig.border && withinPanelWidth(panel, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
function inLeftPanel(panel: Item, x: real, y: real): bool {
|
function inLeftPanel(panel: Item, x: real, y: real): bool {
|
||||||
return x < panel.x + panel.width && withinPanelHeight(panel, x, y);
|
return x < panel.x + panel.width + Config.barConfig.border && withinPanelHeight(panel, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
function inRightPanel(panel: Item, x: real, y: real): bool {
|
function inRightPanel(panel: Item, x: real, y: real): bool {
|
||||||
return x > panel.x && withinPanelHeight(panel, x, y);
|
return x > panel.x - Config.barConfig.border && withinPanelHeight(panel, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
function inTopPanel(panel: Item, x: real, y: real): bool {
|
function inTopPanel(panel: Item, x: real, y: real): bool {
|
||||||
|
|||||||
+11
-12
@@ -4,7 +4,7 @@ import Quickshell
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import qs.Components
|
import qs.Components
|
||||||
import qs.Modules
|
import qs.Modules as Bar
|
||||||
import qs.Config
|
import qs.Config
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
import qs.Modules.UPower
|
import qs.Modules.UPower
|
||||||
@@ -13,7 +13,7 @@ import qs.Modules.Network
|
|||||||
RowLayout {
|
RowLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property Wrapper popouts
|
required property Bar.Wrapper popouts
|
||||||
required property ShellScreen screen
|
required property ShellScreen screen
|
||||||
readonly property int vPadding: 6
|
readonly property int vPadding: 6
|
||||||
required property PersistentProperties visibilities
|
required property PersistentProperties visibilities
|
||||||
@@ -73,7 +73,7 @@ RowLayout {
|
|||||||
roleValue: "workspaces"
|
roleValue: "workspaces"
|
||||||
|
|
||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: Workspaces {
|
sourceComponent: Bar.Workspaces {
|
||||||
screen: root.screen
|
screen: root.screen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ RowLayout {
|
|||||||
roleValue: "audio"
|
roleValue: "audio"
|
||||||
|
|
||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: AudioWidget {
|
sourceComponent: Bar.AudioWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,8 +92,7 @@ RowLayout {
|
|||||||
roleValue: "tray"
|
roleValue: "tray"
|
||||||
|
|
||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: TrayWidget {
|
sourceComponent: Bar.TrayWidget {
|
||||||
bar: root.bar
|
|
||||||
loader: root
|
loader: root
|
||||||
popouts: root.popouts
|
popouts: root.popouts
|
||||||
}
|
}
|
||||||
@@ -104,7 +103,7 @@ RowLayout {
|
|||||||
roleValue: "resources"
|
roleValue: "resources"
|
||||||
|
|
||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: Resources {
|
sourceComponent: Bar.Resources {
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -114,7 +113,7 @@ RowLayout {
|
|||||||
roleValue: "updates"
|
roleValue: "updates"
|
||||||
|
|
||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: UpdatesWidget {
|
sourceComponent: Bar.UpdatesWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +122,7 @@ RowLayout {
|
|||||||
roleValue: "notifBell"
|
roleValue: "notifBell"
|
||||||
|
|
||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: NotifBell {
|
sourceComponent: Bar.NotifBell {
|
||||||
popouts: root.popouts
|
popouts: root.popouts
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
}
|
}
|
||||||
@@ -134,7 +133,7 @@ RowLayout {
|
|||||||
roleValue: "clock"
|
roleValue: "clock"
|
||||||
|
|
||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: Clock {
|
sourceComponent: Bar.Clock {
|
||||||
loader: root
|
loader: root
|
||||||
popouts: root.popouts
|
popouts: root.popouts
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
@@ -146,7 +145,7 @@ RowLayout {
|
|||||||
roleValue: "activeWindow"
|
roleValue: "activeWindow"
|
||||||
|
|
||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: WindowTitle {
|
sourceComponent: Bar.WindowTitle {
|
||||||
bar: root
|
bar: root
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,7 +173,7 @@ RowLayout {
|
|||||||
roleValue: "media"
|
roleValue: "media"
|
||||||
|
|
||||||
delegate: WrappedLoader {
|
delegate: WrappedLoader {
|
||||||
sourceComponent: MediaWidget {
|
sourceComponent: Bar.MediaWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,17 +72,21 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
CustomClippingRect {
|
||||||
id: content
|
anchors.fill: parent
|
||||||
|
|
||||||
active: true
|
Loader {
|
||||||
anchors.bottom: parent.bottom
|
id: content
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
visible: false
|
|
||||||
|
|
||||||
sourceComponent: Content {
|
active: true
|
||||||
state: root.dashState
|
anchors.bottom: parent.bottom
|
||||||
visibilities: root.visibilities
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
visible: false
|
||||||
|
|
||||||
|
sourceComponent: Content {
|
||||||
|
state: root.dashState
|
||||||
|
visibilities: root.visibilities
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-14
@@ -113,22 +113,26 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
CustomClippingRect {
|
||||||
id: content
|
anchors.fill: parent
|
||||||
|
|
||||||
anchors.left: parent.left
|
Loader {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
id: content
|
||||||
|
|
||||||
sourceComponent: Content {
|
anchors.left: parent.left
|
||||||
brightness: root.brightness
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
monitor: root.monitor
|
|
||||||
muted: root.muted
|
sourceComponent: Content {
|
||||||
sourceMuted: root.sourceMuted
|
brightness: root.brightness
|
||||||
sourceVolume: root.sourceVolume
|
monitor: root.monitor
|
||||||
visibilities: root.visibilities
|
muted: root.muted
|
||||||
volume: root.volume
|
sourceMuted: root.sourceMuted
|
||||||
|
sourceVolume: root.sourceVolume
|
||||||
|
visibilities: root.visibilities
|
||||||
|
volume: root.volume
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: active = Qt.binding(() => root.shouldBeActive || root.visible)
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: active = Qt.binding(() => root.shouldBeActive || root.visible)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import qs.Config
|
|||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property PanelWindow bar
|
|
||||||
property bool hasLoaded: false
|
property bool hasLoaded: false
|
||||||
required property int ind
|
required property int ind
|
||||||
required property SystemTrayItem item
|
required property SystemTrayItem item
|
||||||
@@ -46,22 +45,4 @@ Item {
|
|||||||
layer.enabled: DynamicColors.light
|
layer.enabled: DynamicColors.light
|
||||||
source: root.item.icon
|
source: root.item.icon
|
||||||
}
|
}
|
||||||
|
|
||||||
// Image {
|
|
||||||
// id: icon
|
|
||||||
//
|
|
||||||
// property bool batteryHDPI: root.bar.screen.x < 0 && root.item.icon.includes("battery")
|
|
||||||
// property bool nmHDPI: root.bar.screen.x < 0 && root.item.icon.includes("nm-")
|
|
||||||
//
|
|
||||||
// anchors.centerIn: parent
|
|
||||||
// width: batteryHDPI ? 26 : ( nmHDPI ? 25 : 22 )
|
|
||||||
// height: batteryHDPI ? 26 : ( nmHDPI ? 25 : 22 )
|
|
||||||
// source: root.item.icon
|
|
||||||
// mipmap: true
|
|
||||||
// smooth: ( batteryHDPI || nmHDPI ) ? false : true
|
|
||||||
// asynchronous: true
|
|
||||||
// sourceSize.width: ( batteryHDPI || nmHDPI ) ? 16 : 22
|
|
||||||
// sourceSize.height: ( batteryHDPI || nmHDPI ) ? 16 : 22
|
|
||||||
// fillMode: Image.PreserveAspectFit
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import qs.Config
|
|||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property PanelWindow bar
|
|
||||||
readonly property alias items: repeater
|
readonly property alias items: repeater
|
||||||
required property RowLayout loader
|
required property RowLayout loader
|
||||||
required property Wrapper popouts
|
required property Wrapper popouts
|
||||||
@@ -45,7 +44,6 @@ Item {
|
|||||||
required property int index
|
required property int index
|
||||||
required property SystemTrayItem modelData
|
required property SystemTrayItem modelData
|
||||||
|
|
||||||
bar: root.bar
|
|
||||||
implicitHeight: 34
|
implicitHeight: 34
|
||||||
implicitWidth: 34
|
implicitWidth: 34
|
||||||
ind: index
|
ind: index
|
||||||
|
|||||||
Reference in New Issue
Block a user