roster/src/main-window.ui
Pavel Baksy 74250c36b7 Fix header bar height matching properly
- Revert show-title=False on main header (was hiding tabs)
- Use CSS to force both header bars to exact same height (46px)
- Remove vertical padding from header bars
- Keep tab bar compact to fit within fixed height
2025-12-24 03:40:45 +01:00

234 lines
9.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="Adw" version="1.0"/>
<template class="RosterWindow" parent="AdwApplicationWindow">
<property name="default-width">1200</property>
<property name="default-height">800</property>
<property name="content">
<object class="GtkPaned" id="main_pane">
<property name="orientation">horizontal</property>
<property name="position">300</property>
<property name="shrink-start-child">False</property>
<property name="resize-start-child">True</property>
<property name="shrink-end-child">False</property>
<property name="resize-end-child">True</property>
<property name="wide-handle">False</property>
<!-- LEFT: Sidebar Panel with its own header -->
<property name="start-child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="width-request">200</property>
<!-- Sidebar Header Bar -->
<child>
<object class="AdwHeaderBar">
<property name="show-title">False</property>
<property name="show-end-title-buttons">False</property>
<property name="show-start-title-buttons">False</property>
<child type="start">
<object class="GtkLabel">
<property name="label">Projects</property>
<style>
<class name="heading"/>
</style>
</object>
</child>
<child type="end">
<object class="GtkButton" id="add_project_button">
<property name="icon-name">list-add-symbolic</property>
<property name="tooltip-text">Add Project</property>
<signal name="clicked" handler="on_add_project_clicked"/>
<style>
<class name="flat"/>
</style>
</object>
</child>
</object>
</child>
<!-- Sidebar Content -->
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="vexpand">True</property>
<!-- Projects List -->
<child>
<object class="GtkScrolledWindow">
<property name="vexpand">True</property>
<child>
<object class="GtkListBox" id="projects_listbox">
<style>
<class name="navigation-sidebar"/>
</style>
</object>
</child>
</object>
</child>
<!-- Save Current Request Button -->
<child>
<object class="GtkButton" id="save_request_button">
<property name="label">Save Current Request</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin-bottom">12</property>
<signal name="clicked" handler="on_save_request_clicked"/>
<style>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
</child>
</object>
</property>
<!-- RIGHT: Main Content Panel with its own header -->
<property name="end-child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<!-- Main Header Bar -->
<child>
<object class="AdwHeaderBar">
<property name="show-start-title-buttons">False</property>
<property name="show-end-title-buttons">False</property>
<!-- Tab bar as title widget -->
<property name="title-widget">
<object class="AdwTabBar" id="tab_bar">
<property name="view">tab_view</property>
<property name="autohide">False</property>
<property name="expand-tabs">False</property>
</object>
</property>
<!-- Right side buttons -->
<child type="end">
<object class="GtkBox">
<property name="spacing">6</property>
<!-- New Request Button -->
<child>
<object class="GtkButton" id="new_request_button">
<property name="icon-name">list-add-symbolic</property>
<property name="tooltip-text">New Request (Ctrl+T)</property>
<style>
<class name="flat"/>
</style>
</object>
</child>
<!-- Main Menu -->
<child>
<object class="GtkMenuButton">
<property name="primary">True</property>
<property name="icon-name">open-menu-symbolic</property>
<property name="tooltip-text" translatable="yes">Main Menu</property>
<property name="menu-model">primary_menu</property>
</object>
</child>
<!-- Window Controls -->
<child>
<object class="GtkWindowControls">
<property name="side">end</property>
</object>
</child>
</object>
</child>
</object>
</child>
<!-- Vertical Paned: Tab View | History Panel -->
<child>
<object class="GtkPaned">
<property name="orientation">vertical</property>
<property name="vexpand">True</property>
<property name="position">600</property>
<property name="shrink-start-child">False</property>
<property name="shrink-end-child">True</property>
<property name="resize-start-child">True</property>
<property name="resize-end-child">True</property>
<!-- AdwTabView as main content area -->
<property name="start-child">
<object class="AdwTabView" id="tab_view">
<property name="vexpand">True</property>
</object>
</property>
<!-- History Panel -->
<property name="end-child">
<object class="GtkBox">
<property name="orientation">vertical</property>
<!-- History Header -->
<child>
<object class="GtkBox">
<property name="orientation">horizontal</property>
<property name="spacing">12</property>
<property name="margin-start">12</property>
<property name="margin-end">12</property>
<property name="margin-top">6</property>
<child>
<object class="GtkLabel">
<property name="label">Request History</property>
<property name="hexpand">True</property>
<property name="xalign">0</property>
<style>
<class name="heading"/>
</style>
</object>
</child>
</object>
</child>
<!-- History List -->
<child>
<object class="GtkScrolledWindow">
<property name="vexpand">True</property>
<property name="min-content-height">150</property>
<child>
<object class="GtkListBox" id="history_listbox">
<style>
<class name="boxed-list"/>
</style>
</object>
</child>
</object>
</child>
</object>
</property>
</object>
</child>
</object>
</property>
</object>
</property>
</template>
<menu id="primary_menu">
<section>
<item>
<attribute name="label" translatable="yes">_Preferences</attribute>
<attribute name="action">app.preferences</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
<attribute name="action">app.shortcuts</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About Roster</attribute>
<attribute name="action">app.about</attribute>
</item>
</section>
</menu>
</interface>