Apply the saved tree style to native desktop participant rows

This commit is contained in:
omar committed 2026-11-27 05:05:11 +03:00
1 parent faf9f957e7
commit 3db0766339
6 files changed
+67 -4

No files matched your search

+6 -4
View File
@@ -15,6 +15,7 @@ export struct ShellCommand { id: string, label: string, enabled: bool, reason: s
export struct ShellInfo { label: string, value: string }
export struct ShellStream { id: string, title: string, status: string, frame: image, has-frame: bool, volume: float, actions: [ShellCommand] }
export global ShellBridge {
in-out property <bool> compact-tree;
in-out property <[ShellTab]> tabs;
in-out property <[ShellRow]> tree;
in-out property <[ShellRow]> bookmarks;
@@ -365,13 +366,14 @@ component DesktopTreeRow inherits Rectangle {
property <bool> server: root.item.kind == 0;
property <bool> channel: root.item.kind == 1;
property <bool> client: root.item.kind == 2;
property <bool> compact-client: root.client && ShellBridge.compact-tree;
property <bool> spacer: root.item.spacer > 0;
property <length> indent: min(max(0px, self.width - 90px), min(item.depth, 4) * 10px + max(item.depth - 4, 0) * 5px);
property <bool> row-hover: parity-tree-hit.has-hover || more.hovered || (root.item.expandable && arrow.hovered);
property <bool> highlighted: root.active || root.row-hover;
property <length> banner-tools-right: root.width - 27px;
property <bool> has-banner-tools: ShellBridge.save-bookmark-command != "" || ShellBridge.server-chat-command != "";
height: root.server ? 100px : root.channel ? 44px : 40px;
height: root.server ? 100px : root.channel ? 44px : root.compact-client ? 28px : 40px;
accessible-role: list-item;
accessible-label: root.item.title + (root.item.password ? ", " + ShellBridge.label-password : "") + (root.item.away ? ", " + ShellBridge.label-away : "");
accessible-item-selectable: true;
@@ -400,14 +402,14 @@ component DesktopTreeRow inherits Rectangle {
ink: root.client ? (root.item.talking && !root.item.muted ? Theme.success : root.item.away ? ShellColors.subtitle : Theme.dark ? #a3b4b3 : #445d77) : root.channel ? (root.item.full ? Theme.error : root.item.password ? Theme.warning : Theme.dark ? #dbeaf7 : #445d77) : Theme.fg;
x: root.indent + (root.server ? 30px : root.client ? 25px : 20px);
y: root.server ? 28px : (root.height - self.height) / 2;
width: root.server ? 55px : root.client ? 33px : 22px; height: self.width;
width: root.server ? 55px : root.client && !root.compact-client ? 33px : 22px; height: self.width;
}
title := Text {
x: root.indent + (root.server ? 105px : root.spacer ? 20px : root.client ? 68px : 52px);
x: root.indent + (root.server ? 105px : root.spacer ? 20px : root.compact-client ? 57px : root.client ? 68px : 52px);
y: root.server ? 17px : 0px;
height: root.server ? 74px : root.height;
width: max(0px, (root.server ? root.banner-tools-right - 26px * (1 + (ShellBridge.save-bookmark-command == "" ? 0 : 1) + (ShellBridge.server-chat-command == "" ? 0 : 1)) : status.x) - self.x - 4px);
text: root.item.title; font-size: root.server ? 16px : root.channel && !root.spacer ? 13px : 14px;
text: root.item.title; font-size: root.server ? 16px : root.channel && !root.spacer ? 13px : root.compact-client ? 15px : 14px;
font-weight: root.server ? 700 : root.item.own ? 500 : root.item.contact || root.spacer ? 600 : Theme.normal-weight;
color: root.item.own || root.item.contact ? (Theme.high-contrast ? Theme.fg : Theme.tint) : root.client ? ShellColors.client : Theme.fg;
horizontal-alignment: root.item.spacer == 2 ? center : root.item.spacer == 3 ? right : left;