popout positioning fixes
This commit is contained in:
@@ -9,7 +9,8 @@ import qs.Components
|
||||
Item {
|
||||
id: root
|
||||
implicitWidth: expanded ? 300 : 150
|
||||
implicitHeight: 34
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
property bool expanded: false
|
||||
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3tertiaryFixed : "#ffffff"
|
||||
|
||||
@@ -48,7 +48,7 @@ ShapePath {
|
||||
|
||||
PathLine {
|
||||
relativeX: 0
|
||||
relativeY: -(root.wrapper.height - root.roundingY * 2)
|
||||
relativeY: -( root.wrapper.height - root.roundingY * 2 )
|
||||
}
|
||||
|
||||
PathArc {
|
||||
|
||||
+15
-25
@@ -11,8 +11,6 @@ import qs.Daemons
|
||||
RowLayout {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 5
|
||||
anchors.rightMargin: 5
|
||||
|
||||
readonly property int vPadding: 6
|
||||
required property Wrapper popouts
|
||||
@@ -34,26 +32,22 @@ RowLayout {
|
||||
|
||||
if (id === "audio" && Config.barConfig.popouts.audio) {
|
||||
popouts.currentName = "audio";
|
||||
popouts.currentCenter = Qt.binding(() => item.mapToItem(root, itemWidth / 2, 0).x);
|
||||
popouts.currentCenter = Qt.binding( () => item.mapToItem(root, itemWidth / 2, 0 ).x );
|
||||
popouts.hasCurrent = true;
|
||||
} else if ( id === "resources" && Config.barConfig.popouts.resources ) {
|
||||
popouts.currentName = "resources";
|
||||
popouts.currentCenter = Qt.binding(() => item.mapToItem(root, itemWidth / 2 + 5, 0).x);
|
||||
popouts.currentCenter = Qt.binding( () => item.mapToItem( root, itemWidth / 2, 0 ).x );
|
||||
popouts.hasCurrent = true;
|
||||
} else if (id === "tray" && Config.barConfig.popouts.tray) {
|
||||
const index = Math.floor(((x - top - 6) / item.implicitWidth) * item.items.count);
|
||||
const trayItem = item.items.itemAt(index);
|
||||
if (trayItem) {
|
||||
popouts.currentName = `traymenu${index}`;
|
||||
popouts.currentCenter = Qt.binding(() => trayItem.mapToItem(root, trayItem.implicitWidth / 2 + 4, 0).x);
|
||||
} else if ( id === "tray" && Config.barConfig.popouts.tray ) {
|
||||
const index = Math.floor((( x - top ) / item.implicitWidth ) * item.items.count );
|
||||
const trayItem = item.items.itemAt( index );
|
||||
if ( trayItem ) {
|
||||
popouts.currentName = `traymenu${ index }`;
|
||||
popouts.currentCenter = Qt.binding( () => trayItem.mapToItem( root, trayItem.implicitWidth / 2, 0 ).x );
|
||||
popouts.hasCurrent = true;
|
||||
} else {
|
||||
popouts.hasCurrent = false;
|
||||
}
|
||||
} else if (id === "activeWindow" && Config.barConfig.popouts.activeWindow) {
|
||||
popouts.currentName = id.toLowerCase();
|
||||
popouts.currentCenter = item.mapToItem(root, 0, itemHeight / 2).y;
|
||||
popouts.hasCurrent = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,17 +101,13 @@ RowLayout {
|
||||
DelegateChoice {
|
||||
roleValue: "notifBell"
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: NotifBell {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
sourceComponent: NotifBell {}
|
||||
}
|
||||
}
|
||||
DelegateChoice {
|
||||
roleValue: "clock"
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: Clock {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
sourceComponent: Clock {}
|
||||
}
|
||||
}
|
||||
DelegateChoice {
|
||||
@@ -134,6 +124,9 @@ RowLayout {
|
||||
required property string id
|
||||
required property int index
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.fillHeight: true
|
||||
|
||||
function findFirstEnabled(): Item {
|
||||
const count = repeater.count;
|
||||
for (let i = 0; i < count; i++) {
|
||||
@@ -153,11 +146,8 @@ RowLayout {
|
||||
return null;
|
||||
}
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
// Cursed ahh thing to add padding to first and last enabled components
|
||||
Layout.topMargin: findFirstEnabled() === this ? root.vPadding : 0
|
||||
Layout.bottomMargin: findLastEnabled() === this ? root.vPadding : 0
|
||||
Layout.leftMargin: findFirstEnabled() === this ? root.vPadding : 0
|
||||
Layout.rightMargin: findLastEnabled() === this ? root.vPadding : 0
|
||||
|
||||
visible: enabled
|
||||
active: enabled
|
||||
|
||||
+8
-1
@@ -4,9 +4,16 @@ import qs.Modules
|
||||
|
||||
Item {
|
||||
implicitWidth: timeText.contentWidth
|
||||
implicitHeight: timeText.contentHeight
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
Text {
|
||||
id: timeText
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
text: Time.time
|
||||
color: Config.useDynamicColors ? DynamicColors.palette.m3tertiary : "white"
|
||||
|
||||
|
||||
+3
-7
@@ -12,16 +12,13 @@ Item {
|
||||
readonly property Popout currentPopout: content.children.find(c => c.shouldBeActive) ?? null
|
||||
readonly property Item current: currentPopout?.item ?? null
|
||||
|
||||
anchors.centerIn: parent
|
||||
|
||||
implicitWidth: (currentPopout?.implicitWidth ?? 0) + 10 * 2
|
||||
implicitHeight: (currentPopout?.implicitHeight ?? 0) + 10 * 2
|
||||
implicitWidth: (currentPopout?.implicitWidth ?? 0) + 5 * 2
|
||||
implicitHeight: (currentPopout?.implicitHeight ?? 0) + 5 * 2
|
||||
|
||||
Item {
|
||||
id: content
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
|
||||
Popout {
|
||||
name: "audio"
|
||||
@@ -80,8 +77,7 @@ Item {
|
||||
required property string name
|
||||
readonly property bool shouldBeActive: root.wrapper.currentName === name
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.centerIn: parent
|
||||
|
||||
opacity: 0
|
||||
scale: 0.8
|
||||
|
||||
+11
-1
@@ -4,11 +4,21 @@ import qs.Helpers
|
||||
import qs.Components
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
implicitWidth: 20
|
||||
implicitHeight: 18
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
MaterialIcon {
|
||||
id: notificationCenterIcon
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
property color iconColor: Config.useDynamicColors ? DynamicColors.palette.m3tertiaryFixed : "white"
|
||||
|
||||
text: HasNotifications.hasNotifications ? "\uf4fe" : "\ue7f4"
|
||||
font.family: "Material Symbols Rounded"
|
||||
font.pixelSize: 20
|
||||
|
||||
@@ -14,8 +14,10 @@ Item {
|
||||
implicitWidth: rowLayout.implicitWidth + rowLayout.anchors.leftMargin + rowLayout.anchors.rightMargin
|
||||
implicitHeight: 34
|
||||
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3tertiaryFixed : "#ffffff"
|
||||
clip: true
|
||||
|
||||
Rectangle {
|
||||
id: backgroundRect
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
|
||||
@@ -7,9 +7,15 @@ import Quickshell.Services.SystemTray
|
||||
|
||||
Row {
|
||||
id: root
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
required property PanelWindow bar
|
||||
readonly property alias items: repeater
|
||||
|
||||
spacing: 0
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
model: SystemTray.items
|
||||
|
||||
@@ -6,12 +6,16 @@ import qs.Config
|
||||
Item {
|
||||
id: root
|
||||
property int countUpdates: Updates.availableUpdates
|
||||
implicitWidth: contentRow.childrenRect.width + 10
|
||||
implicitHeight: 22
|
||||
implicitWidth: textMetrics.width + contentRow.spacing + 30
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3tertiaryFixed : "#ffffff"
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitHeight: 22
|
||||
radius: height / 2
|
||||
color: Config.useDynamicColors ? DynamicColors.tPalette.m3surfaceContainer : "#40000000"
|
||||
Behavior on color {
|
||||
|
||||
+13
-21
@@ -3,10 +3,11 @@ import QtQuick.Layouts
|
||||
import Quickshell.Hyprland
|
||||
import qs.Helpers
|
||||
import qs.Config
|
||||
import qs.Components
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property string currentTitle
|
||||
property string currentTitle: Hypr.activeName
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: Math.max( titleText1.implicitWidth, titleText2.implicitWidth ) + 10
|
||||
clip: true
|
||||
@@ -14,15 +15,15 @@ Item {
|
||||
property bool showFirst: true
|
||||
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3primary : "white"
|
||||
|
||||
Component.onCompleted: {
|
||||
Hyprland.rawEvent.connect(( event ) => {
|
||||
if (event.name === "activewindow") {
|
||||
InitialTitle.getInitialTitle( function( initialTitle ) {
|
||||
root.currentTitle = initialTitle
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
// Component.onCompleted: {
|
||||
// Hyprland.rawEvent.connect(( event ) => {
|
||||
// if (event.name === "activewindow") {
|
||||
// InitialTitle.getInitialTitle( function( initialTitle ) {
|
||||
// root.currentTitle = initialTitle
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
onCurrentTitleChanged: {
|
||||
if (showFirst) {
|
||||
@@ -34,14 +35,13 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
CustomText {
|
||||
id: titleText1
|
||||
anchors.fill: parent
|
||||
anchors.margins: 5
|
||||
text: root.currentTitle
|
||||
color: root.textColor
|
||||
elide: Text.ElideRight
|
||||
font.family: "Rubik"
|
||||
font.pixelSize: 16
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
@@ -49,13 +49,9 @@ Item {
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
CustomText {
|
||||
id: titleText2
|
||||
anchors.fill: parent
|
||||
anchors.margins: 5
|
||||
@@ -68,9 +64,5 @@ Item {
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,14 +12,17 @@ import qs.Components
|
||||
Item {
|
||||
id: itemRoot
|
||||
required property PanelWindow bar
|
||||
implicitHeight: 28
|
||||
implicitWidth: root.implicitWidth
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
implicitWidth: workspacesRow.implicitWidth + 10
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
property HyprlandMonitor monitor: Hyprland.monitorFor( itemRoot.bar?.screen )
|
||||
|
||||
implicitWidth: workspacesRow.implicitWidth + 10
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitHeight: 22
|
||||
|
||||
function shouldShow(monitor) {
|
||||
|
||||
@@ -71,8 +71,6 @@ Item {
|
||||
|
||||
shouldBeActive: root.hasCurrent
|
||||
asynchronous: true
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
sourceComponent: Content {
|
||||
wrapper: root
|
||||
|
||||
Reference in New Issue
Block a user