window: collapse sidebar when dragged too narrow; keep controls accessible

When the paned divider is dragged left below 120 px, snap the sidebar
closed instead of leaving a sliver. This replaces the previous
minimum-width approach.

When the sidebar is hidden (via toggle or snap-close), show the refresh
button and primary menu in the content header so they remain reachable.
Both stacks are kept in sync (spinner/button) with their sidebar
counterparts during article fetches.
This commit is contained in:
Jeena 2026-03-22 02:10:37 +00:00
parent db41a691e6
commit 6d6d928733
2 changed files with 55 additions and 11 deletions

View file

@ -11,7 +11,6 @@ template $FeedTheMonkeyWindow : Adw.ApplicationWindow {
focusable: false;
shrink-start-child: false;
resize-start-child: false;
shrink-end-child: false;
start-child: Adw.ToolbarView sidebar_toolbar {
top-bar-style: raised;
@ -108,7 +107,6 @@ template $FeedTheMonkeyWindow : Adw.ApplicationWindow {
end-child: Adw.ToolbarView {
top-bar-style: raised;
width-request: 360;
[top]
Adw.HeaderBar {
@ -119,10 +117,39 @@ template $FeedTheMonkeyWindow : Adw.ApplicationWindow {
action-name: "win.toggle-sidebar";
}
[start]
Stack content_refresh_stack {
visible: false;
StackPage {
name: "button";
child: Button {
icon-name: "view-refresh-symbolic";
tooltip-text: _("Refresh");
action-name: "win.reload";
};
}
StackPage {
name: "spinner";
child: Spinner {
spinning: true;
width-request: 16;
height-request: 16;
};
}
}
title-widget: Adw.WindowTitle {
title: _("FeedTheMonkey");
};
[end]
MenuButton content_menu_button {
icon-name: "open-menu-symbolic";
primary: true;
menu-model: primary_menu;
visible: false;
}
[end]
MenuButton article_menu_button {
icon-name: "view-more-symbolic";