Merge branch 'main' into module/wifi
C++ / fmt (pull_request) Successful in 5s
JS/TS / fmt (pull_request) Successful in 17s
JS/TS / lint (pull_request) Successful in 16s
Python / fmt (pull_request) Successful in 31s
Python / lint (pull_request) Successful in 41s
Python / test (pull_request) Successful in 1m5s
Python / typecheck (pull_request) Successful in 1m15s
Rust / clippy (pull_request) Failing after 12m43s
Rust / fmt (pull_request) Failing after 12m57s
Rust / build (pull_request) Failing after 13m33s
Python / buildcheck (pull_request) Failing after 13m45s
C++ / clang-tidy (pull_request) Failing after 14m23s
C++ / build (pull_request) Failing after 14m25s
C++ / fmt (pull_request) Successful in 5s
JS/TS / fmt (pull_request) Successful in 17s
JS/TS / lint (pull_request) Successful in 16s
Python / fmt (pull_request) Successful in 31s
Python / lint (pull_request) Successful in 41s
Python / test (pull_request) Successful in 1m5s
Python / typecheck (pull_request) Successful in 1m15s
Rust / clippy (pull_request) Failing after 12m43s
Rust / fmt (pull_request) Failing after 12m57s
Rust / build (pull_request) Failing after 13m33s
Python / buildcheck (pull_request) Failing after 13m45s
C++ / clang-tidy (pull_request) Failing after 14m23s
C++ / build (pull_request) Failing after 14m25s
This commit is contained in:
+68
-67
@@ -4,24 +4,25 @@ import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Modules
|
||||
import qs.Config
|
||||
import ZShell.Config
|
||||
import qs.Modules.SysTray
|
||||
import qs.Modules.Updates
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
|
||||
required property bool fullscreen
|
||||
required property Wrapper popouts
|
||||
required property ClipWrapper popoutsWrapper
|
||||
required property ShellScreen screen
|
||||
required property bool fullscreen
|
||||
readonly property int vPadding: 6
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
function checkPopout(x: real): void {
|
||||
const ch = childAt(x, height / 2) as WrappedLoader;
|
||||
const ch = childAt(x, height / 2) as EntryWrapper;
|
||||
const id = ch?.entryId;
|
||||
|
||||
if (!ch || ch?.id === "spacer") {
|
||||
if (!ch || id === undefined) {
|
||||
if (!popouts.currentName.startsWith("traymenu") || Config.bar.tray.showOnHover)
|
||||
popouts.hasCurrent = false;
|
||||
return;
|
||||
@@ -30,42 +31,50 @@ RowLayout {
|
||||
if (visibilities.sidebar || visibilities.dashboard || visibilities.resources || visibilities.settings)
|
||||
return;
|
||||
|
||||
if (ch.id === "tray") {
|
||||
const tray = ch.item;
|
||||
const localPos = tray.mapFromItem(root, x, height / 2);
|
||||
const sub = tray.getHoveredSubItem(localPos.x, localPos.y);
|
||||
if (sub) {
|
||||
popouts.currentName = sub.id;
|
||||
if (id === "statusIcons" && Config.bar.popouts.statusIcons) {
|
||||
const items = (ch.item as StatusIcons).items;
|
||||
const localX = mapToItem(items, x, 0).x;
|
||||
const icon = items.childAt(localX, items.height / 2);
|
||||
if (icon) {
|
||||
popouts.currentName = icon.name;
|
||||
popouts.currentCenter = Qt.binding(() => icon.mapToItem(root, icon.implicitWidth / 2, 0).x);
|
||||
popouts.hasCurrent = true;
|
||||
}
|
||||
} else if (id === "tray" && Config.bar.popouts.tray && Config.bar.tray.showOnHover) {
|
||||
const tray = ch.item as TrayIcons;
|
||||
const layout = tray.layout;
|
||||
const localX = mapToItem(layout, x, 0).x;
|
||||
const trayItem = layout.childAt(localX, layout.height / 2);
|
||||
|
||||
if (trayItem) {
|
||||
const idx = trayItem.index;
|
||||
popouts.currentName = `traymenu${idx}`;
|
||||
popouts.currentCenter = Qt.binding(() => {
|
||||
const centerX = sub.item.mapToItem(root, sub.item.width / 2, 0).x;
|
||||
return centerX;
|
||||
const it = tray.items.itemAt(idx);
|
||||
return it ? it.mapToItem(root, it.implicitWidth / 2, 0).x : popouts.currentCenter;
|
||||
});
|
||||
popouts.hasCurrent = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!popouts.currentName.startsWith("traymenu") || Config.bar.tray.showOnHover)
|
||||
if (!popouts.currentName.startsWith("traymenu"))
|
||||
popouts.hasCurrent = false;
|
||||
}
|
||||
|
||||
const id = ch.id;
|
||||
const top = ch.x;
|
||||
const item = ch.item;
|
||||
const itemWidth = item.implicitWidth;
|
||||
|
||||
if (id === "updates") {
|
||||
popouts.currentName = "updates";
|
||||
popouts.currentCenter = Qt.binding(() => item.mapToItem(root, itemWidth / 2, 0).x);
|
||||
popouts.currentCenter = Qt.binding(() => ch.item.mapToItem(root, (ch.item as Item).implicitWidth / 2, 0).x);
|
||||
popouts.hasCurrent = true;
|
||||
}
|
||||
}
|
||||
|
||||
spacing: Appearance.spacing.small
|
||||
spacing: Tokens.spacing.small
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
|
||||
model: Config.bar.entries
|
||||
model: ScriptModel {
|
||||
values: Config.bar.entries.values.filter(e => e.enabled)
|
||||
}
|
||||
|
||||
DelegateChooser {
|
||||
role: "id"
|
||||
@@ -73,8 +82,8 @@ RowLayout {
|
||||
DelegateChoice {
|
||||
roleValue: "hyprsunset"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: HyprsunsetWidget {
|
||||
delegate: EntryWrapper {
|
||||
HyprsunsetWidget {
|
||||
visible: !root.fullscreen
|
||||
}
|
||||
}
|
||||
@@ -83,7 +92,7 @@ RowLayout {
|
||||
DelegateChoice {
|
||||
roleValue: "spacer"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
delegate: EntryWrapper {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
@@ -91,8 +100,8 @@ RowLayout {
|
||||
DelegateChoice {
|
||||
roleValue: "workspaces"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: Workspaces {
|
||||
delegate: EntryWrapper {
|
||||
Workspaces {
|
||||
screen: root.screen
|
||||
visible: !root.fullscreen
|
||||
}
|
||||
@@ -102,8 +111,8 @@ RowLayout {
|
||||
DelegateChoice {
|
||||
roleValue: "tray"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: TrayWidget {
|
||||
delegate: EntryWrapper {
|
||||
TrayIcons {
|
||||
loader: root
|
||||
popouts: root.popouts
|
||||
visible: !root.fullscreen
|
||||
@@ -111,11 +120,20 @@ RowLayout {
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: "statusIcons"
|
||||
|
||||
delegate: EntryWrapper {
|
||||
StatusIcons {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: "resources"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: Resources {
|
||||
delegate: EntryWrapper {
|
||||
Resources {
|
||||
visibilities: root.visibilities
|
||||
visible: !root.fullscreen
|
||||
}
|
||||
@@ -125,8 +143,8 @@ RowLayout {
|
||||
DelegateChoice {
|
||||
roleValue: "updates"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: UpdatesWidget {
|
||||
delegate: EntryWrapper {
|
||||
UpdatesWidget {
|
||||
visible: !root.fullscreen
|
||||
}
|
||||
}
|
||||
@@ -135,8 +153,8 @@ RowLayout {
|
||||
DelegateChoice {
|
||||
roleValue: "notifBell"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: NotifBell {
|
||||
delegate: EntryWrapper {
|
||||
NotifBell {
|
||||
popouts: root.popouts
|
||||
visibilities: root.visibilities
|
||||
visible: !root.fullscreen
|
||||
@@ -147,8 +165,8 @@ RowLayout {
|
||||
DelegateChoice {
|
||||
roleValue: "clock"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: Clock {
|
||||
delegate: EntryWrapper {
|
||||
Clock {
|
||||
loader: root
|
||||
popouts: root.popouts
|
||||
visibilities: root.visibilities
|
||||
@@ -160,8 +178,8 @@ RowLayout {
|
||||
DelegateChoice {
|
||||
roleValue: "activeWindow"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: WindowTitle {
|
||||
delegate: EntryWrapper {
|
||||
WindowTitle {
|
||||
bar: root
|
||||
visible: !root.fullscreen
|
||||
}
|
||||
@@ -171,8 +189,8 @@ RowLayout {
|
||||
DelegateChoice {
|
||||
roleValue: "media"
|
||||
|
||||
delegate: WrappedLoader {
|
||||
sourceComponent: MediaWidget {
|
||||
delegate: EntryWrapper {
|
||||
MediaWidget {
|
||||
visible: !root.fullscreen
|
||||
}
|
||||
}
|
||||
@@ -180,34 +198,17 @@ RowLayout {
|
||||
}
|
||||
}
|
||||
|
||||
component WrappedLoader: Loader {
|
||||
required property bool enabled
|
||||
required property string id
|
||||
component EntryWrapper: Item {
|
||||
readonly property string entryId: modelData.id
|
||||
required property int index
|
||||
|
||||
function findFirstEnabled(): Item {
|
||||
const count = repeater.count;
|
||||
for (let i = 0; i < count; i++) {
|
||||
const item = repeater.itemAt(i);
|
||||
if (item?.enabled)
|
||||
return item;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function findLastEnabled(): Item {
|
||||
for (let i = repeater.count - 1; i >= 0; i--) {
|
||||
const item = repeater.itemAt(i);
|
||||
if (item?.enabled)
|
||||
return item;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
default property Item item
|
||||
required property var modelData
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.leftMargin: findFirstEnabled() === this ? root.vPadding : 0
|
||||
Layout.rightMargin: findLastEnabled() === this ? root.vPadding : 0
|
||||
active: enabled
|
||||
visible: enabled
|
||||
Layout.leftMargin: index === 0 ? root.vPadding : (entryId === "statusIcons") ? -root.spacing + Tokens.spacing.extraSmall : 0
|
||||
Layout.rightMargin: index === repeater.count - 1 ? root.vPadding : 0
|
||||
children: item
|
||||
implicitHeight: item?.implicitHeight ?? 0
|
||||
implicitWidth: item?.implicitWidth ?? 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Components
|
||||
import qs.Modules
|
||||
import qs.Config
|
||||
import ZShell.Config
|
||||
import qs.Helpers
|
||||
import qs.Modules.SysTray
|
||||
import qs.Modules.SysTray.Widgets
|
||||
@@ -18,7 +18,7 @@ Item {
|
||||
readonly property int exclusiveZone: Config.bar.autoHide ? Config.bar.border : contentHeight
|
||||
required property bool fullscreen
|
||||
property bool isHovered
|
||||
readonly property int padding: Math.max(Appearance.padding.smaller, Config.bar.border)
|
||||
readonly property int padding: Math.max(Tokens.padding.smaller, Config.bar.border)
|
||||
required property Wrapper popouts
|
||||
required property ClipWrapper popoutsWrapper
|
||||
required property ShellScreen screen
|
||||
@@ -47,8 +47,6 @@ Item {
|
||||
to: "visible"
|
||||
|
||||
Anim {
|
||||
duration: MaterialEasing.expressiveEffectsTime
|
||||
easing.bezierCurve: MaterialEasing.expressiveEffects
|
||||
property: "implicitHeight"
|
||||
target: root
|
||||
}
|
||||
@@ -58,8 +56,6 @@ Item {
|
||||
to: ""
|
||||
|
||||
Anim {
|
||||
duration: MaterialEasing.expressiveEffectsTime
|
||||
easing.bezierCurve: MaterialEasing.expressiveEffects
|
||||
property: "implicitHeight"
|
||||
target: root
|
||||
}
|
||||
|
||||
@@ -3,8 +3,9 @@ pragma ComponentBehavior: Bound
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import qs.Config
|
||||
import ZShell.Config
|
||||
import qs.Components
|
||||
import qs.Services
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -17,7 +18,7 @@ Item {
|
||||
CustomRect {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -1
|
||||
color: DynamicColors.palette.m3surface
|
||||
color: Colors.palette.m3surface
|
||||
layer.enabled: true
|
||||
|
||||
layer.effect: MultiEffect {
|
||||
|
||||
Reference in New Issue
Block a user