From deb48e4c858905813659ead0e5db3641ea1bdf67 Mon Sep 17 00:00:00 2001 From: vesp Date: Wed, 24 Dec 2025 03:55:13 +0100 Subject: [PATCH] Refactor to use AdwToolbarView like Epiphany - Replace manual GtkBox layout with AdwToolbarView - Add AdwHeaderBar and AdwTabBar as separate top bars - Remove all custom CSS for header bar height matching - AdwToolbarView automatically ensures consistent bar styling This follows the proper libadwaita pattern used by GNOME Web. --- src/main-window.ui | 51 +++++++++++++++++++--------------------------- src/window.py | 46 ++--------------------------------------- 2 files changed, 23 insertions(+), 74 deletions(-) diff --git a/src/main-window.ui b/src/main-window.ui index c3b745b..f8d99b1 100644 --- a/src/main-window.ui +++ b/src/main-window.ui @@ -16,21 +16,17 @@ True False - + - - vertical + 200 - + False False False - Projects @@ -53,10 +49,9 @@ - + vertical - True @@ -86,32 +81,20 @@ - + - + - - vertical + - + + False False False - - - - - - tab_view - False - False - - @@ -150,11 +133,19 @@ - - + + + + tab_view + False + False + + + + + vertical - True 600 False True @@ -213,7 +204,7 @@ - + diff --git a/src/window.py b/src/window.py index f91cb9e..978177d 100644 --- a/src/window.py +++ b/src/window.py @@ -133,50 +133,8 @@ class RosterWindow(Adw.ApplicationWindow): """Setup custom CSS for UI styling.""" css_provider = Gtk.CssProvider() css_provider.load_from_data(b""" - /* Match both header bars to same height */ - headerbar.sidebar-header, - headerbar.main-header { - min-height: 46px; - padding-top: 0; - padding-bottom: 0; - } - - headerbar.sidebar-header { - padding-left: 0px; - padding-right: 6px; - } - - headerbar.main-header { - padding-left: 0px; - padding-right: 6px; - } - - /* Ultra-compact tab bar to fit exactly in header */ - tabbar { - min-height: 0; - padding: 0; - margin: 0; - border: none; - } - - tabbar > scrolledwindow { - min-height: 0; - padding: 0; - margin: 0; - border: none; - } - - tabbar > scrolledwindow > box { - min-height: 0; - padding: 0; - margin: 0; - } - - tabbar tab { - min-height: 24px; - padding: 2px 10px; - margin: 0 1px; - } + /* AdwToolbarView handles header bar heights automatically */ + /* Just add minimal custom styling for other elements */ /* Stack switchers styling (Headers/Body tabs) */ stackswitcher button {