Add shrink-end-child: false to the Paned so the content panel cannot be squeezed below its minimum size, and set width-request: 360 on the content ToolbarView so there is always a visible reading area.
193 lines
4.3 KiB
Text
193 lines
4.3 KiB
Text
using Gtk 4.0;
|
|
using Adw 1;
|
|
using WebKit 6.0;
|
|
|
|
template $FeedTheMonkeyWindow : Adw.ApplicationWindow {
|
|
default-width: 900;
|
|
default-height: 600;
|
|
|
|
Adw.ToastOverlay toast_overlay {
|
|
Paned paned {
|
|
focusable: false;
|
|
shrink-start-child: false;
|
|
resize-start-child: false;
|
|
shrink-end-child: false;
|
|
|
|
start-child: Adw.ToolbarView sidebar_toolbar {
|
|
top-bar-style: raised;
|
|
|
|
[top]
|
|
Adw.HeaderBar {
|
|
show-start-title-buttons: false;
|
|
show-end-title-buttons: false;
|
|
|
|
title-widget: Box {};
|
|
|
|
[start]
|
|
Stack refresh_stack {
|
|
StackPage {
|
|
name: "button";
|
|
child: Button refresh_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;
|
|
};
|
|
}
|
|
}
|
|
|
|
[end]
|
|
MenuButton menu_button {
|
|
icon-name: "open-menu-symbolic";
|
|
primary: true;
|
|
menu-model: primary_menu;
|
|
}
|
|
}
|
|
|
|
Stack sidebar_content {
|
|
styles ["sidebar-content"]
|
|
|
|
StackPage {
|
|
name: "placeholder";
|
|
child: Adw.StatusPage {
|
|
icon-name: "rss-symbolic";
|
|
title: _("FeedTheMonkey");
|
|
description: _("Log in to load your articles");
|
|
};
|
|
}
|
|
|
|
StackPage {
|
|
name: "loading";
|
|
child: Adw.StatusPage {
|
|
title: _("Loading…");
|
|
};
|
|
}
|
|
|
|
StackPage {
|
|
name: "empty";
|
|
child: Adw.StatusPage {
|
|
icon-name: "rss-symbolic";
|
|
title: _("No Unread Articles");
|
|
};
|
|
}
|
|
|
|
StackPage {
|
|
name: "error";
|
|
child: Adw.StatusPage error_status {
|
|
icon-name: "network-error-symbolic";
|
|
title: _("Could Not Load Articles");
|
|
|
|
Button {
|
|
label: _("Try Again");
|
|
halign: center;
|
|
action-name: "win.reload";
|
|
styles ["pill", "suggested-action"]
|
|
}
|
|
};
|
|
}
|
|
|
|
StackPage {
|
|
name: "list";
|
|
child: ScrolledWindow {
|
|
hscrollbar-policy: never;
|
|
ListView article_list_view {
|
|
single-click-activate: false;
|
|
show-separators: true;
|
|
}
|
|
};
|
|
}
|
|
}
|
|
};
|
|
|
|
end-child: Adw.ToolbarView {
|
|
top-bar-style: raised;
|
|
width-request: 360;
|
|
|
|
[top]
|
|
Adw.HeaderBar {
|
|
[start]
|
|
Button toggle_sidebar_button {
|
|
icon-name: "sidebar-show-symbolic";
|
|
tooltip-text: _("Toggle Sidebar");
|
|
action-name: "win.toggle-sidebar";
|
|
}
|
|
|
|
title-widget: Adw.WindowTitle {
|
|
title: _("FeedTheMonkey");
|
|
};
|
|
|
|
[end]
|
|
MenuButton article_menu_button {
|
|
icon-name: "view-more-symbolic";
|
|
menu-model: article_menu;
|
|
visible: false;
|
|
}
|
|
}
|
|
|
|
Stack content_stack {
|
|
StackPage {
|
|
name: "empty";
|
|
child: Adw.StatusPage {
|
|
icon-name: "document-open-symbolic";
|
|
title: _("No Article Selected");
|
|
};
|
|
}
|
|
|
|
StackPage {
|
|
name: "webview";
|
|
child: WebKit.WebView web_view {};
|
|
}
|
|
}
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|
|
menu primary_menu {
|
|
section {
|
|
item {
|
|
label: _("Log Out");
|
|
action: "win.logout";
|
|
}
|
|
}
|
|
|
|
section {
|
|
item {
|
|
label: _("Preferences");
|
|
action: "win.preferences";
|
|
}
|
|
}
|
|
|
|
section {
|
|
item {
|
|
label: _("Keyboard Shortcuts");
|
|
action: "win.show-help-overlay";
|
|
}
|
|
|
|
item {
|
|
label: _("About FeedTheMonkey");
|
|
action: "app.about";
|
|
}
|
|
}
|
|
}
|
|
|
|
menu article_menu {
|
|
section {
|
|
item {
|
|
label: _("Mark Unread");
|
|
action: "win.mark-unread";
|
|
}
|
|
|
|
item {
|
|
label: _("Open in Browser");
|
|
action: "win.open-in-browser";
|
|
}
|
|
}
|
|
}
|