Persist desktop bookmark disclosure across restarts
This commit is contained in:
1 parent
5b508e70e6
commit
b6db8a2b29
8 files changed
+48
-4
No files matched your search
+12
-4
@@ -22,6 +22,8 @@ export global ShellBridge {
|
||||
in-out property <[ShellRow]> entries;
|
||||
in-out property <[ShellTab]> sidebar-tabs;
|
||||
in-out property <[ShellRow]> sidebar-bookmarks;
|
||||
in-out property <bool> bookmarks-collapsed;
|
||||
callback toggle-bookmarks();
|
||||
in-out property <string> sidebar-search;
|
||||
in-out property <string> bookmark-up-command;
|
||||
in-out property <bool> can-add-bookmark;
|
||||
@@ -583,15 +585,21 @@ component DesktopSidebar inherits Rectangle {
|
||||
height: 38px;
|
||||
Rectangle {
|
||||
x: 10px; y: 8px; width: parent.width - 20px; height: 26px; border-radius: 4px; background: Theme.bg;
|
||||
if ShellBridge.bookmark-up-command == "": ShellGlyph { glyph: 13; ink: ShellColors.client; x: 9px; y: 4px; width: 18px; height: 18px; }
|
||||
if ShellBridge.bookmark-up-command != "": ChromeButton { x: 2px; y: 0px; width: 28px; glyph: 29; label: ShellBridge.label-back; clicked => { ShellBridge.invoke(ShellBridge.bookmark-up-command); } }
|
||||
Text { x: 36px; width: max(0px, parent.width - 72px); text: ShellBridge.bookmark-location == "" ? ShellBridge.label-bookmarks : ShellBridge.bookmark-location; color: ShellColors.client; font-size: 13px; vertical-alignment: center; overflow: elide; }
|
||||
parity-bookmark-disclosure := ChromeButton {
|
||||
x: ShellBridge.bookmark-up-command == "" ? 0px : 30px; width: max(0px,parent.width - self.x - 30px);
|
||||
glyph: ShellBridge.bookmarks-collapsed ? 6 : 5; center-text: false;
|
||||
text: ShellBridge.bookmark-location == "" ? ShellBridge.label-bookmarks : ShellBridge.bookmark-location;
|
||||
accessible-expanded: !ShellBridge.bookmarks-collapsed;
|
||||
clicked => { ShellBridge.toggle-bookmarks(); }
|
||||
}
|
||||
if ShellBridge.can-add-bookmark: ChromeButton { x: parent.width - 30px; y: 0px; width: 28px; glyph: 8; label: ShellBridge.label-bookmarks; clicked => { ShellBridge.bookmark-menu(self.absolute-position.x / 1px,(self.absolute-position.y + self.height) / 1px); } }
|
||||
}
|
||||
}
|
||||
if root.rail && ShellBridge.bookmark-up-command != "": ChromeButton { width: 32px; glyph: 29; label: ShellBridge.label-back; clicked => { ShellBridge.invoke(ShellBridge.bookmark-up-command); } }
|
||||
for item in ShellBridge.sidebar-bookmarks: SidebarActivity { row-id: item.id; label: item.title; subtitle: item.subtitle; glyph: item.kind == 3 ? 28 : 13; rail: root.rail; }
|
||||
if !root.rail && ShellBridge.sidebar-bookmarks.length == 0: Text { height: 28px; text: ShellBridge.label-empty; color: ShellColors.client; font-size: 13px; horizontal-alignment: center; vertical-alignment: center; }
|
||||
if root.rail: ChromeButton { width: root.width; glyph: 13; label: ShellBridge.label-bookmarks; accessible-expanded: !ShellBridge.bookmarks-collapsed; clicked => { ShellBridge.toggle-bookmarks(); } }
|
||||
for item in (ShellBridge.bookmarks-collapsed ? [] : ShellBridge.sidebar-bookmarks): parity-bookmark-activity := SidebarActivity { row-id: item.id; label: item.title; subtitle: item.subtitle; glyph: item.kind == 3 ? 28 : 13; rail: root.rail; }
|
||||
if !ShellBridge.bookmarks-collapsed && !root.rail && ShellBridge.sidebar-bookmarks.length == 0: Text { height: 28px; text: ShellBridge.label-empty; color: ShellColors.client; font-size: 13px; horizontal-alignment: center; vertical-alignment: center; }
|
||||
}
|
||||
for index in [0, 1, 2]: Rectangle {
|
||||
visible: index != 0 || root.rail;
|
||||
|
||||
Reference in new issue
Block a user