Replace sidebar popover with GMenu model: flat sections instead of submenu, standard font
This commit is contained in:
parent
d074b1599a
commit
7107e2df8d
@ -3,7 +3,13 @@
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<requires lib="Adw" version="1.0"/>
|
||||
|
||||
<menu id="import_menu">
|
||||
<menu id="sidebar_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label">Add Project</attribute>
|
||||
<attribute name="action">win.add-project</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label">Import from OpenAPI / Swagger</attribute>
|
||||
@ -57,43 +63,10 @@
|
||||
<object class="GtkMenuButton" id="sidebar_hamburger_button">
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="tooltip-text">Menu</property>
|
||||
<property name="menu-model">sidebar_menu</property>
|
||||
<style>
|
||||
<class name="flat"/>
|
||||
</style>
|
||||
<property name="popover">
|
||||
<object class="GtkPopover">
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<property name="margin-top">4</property>
|
||||
<property name="margin-bottom">4</property>
|
||||
<property name="margin-start">4</property>
|
||||
<property name="margin-end">4</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="add_project_button">
|
||||
<property name="label">Add Project</property>
|
||||
<property name="tooltip-text">Add Project</property>
|
||||
<signal name="clicked" handler="on_add_project_clicked"/>
|
||||
<style>
|
||||
<class name="flat"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="import_menu_button">
|
||||
<property name="label">Import</property>
|
||||
<property name="tooltip-text">Import</property>
|
||||
<property name="menu-model">import_menu</property>
|
||||
<style>
|
||||
<class name="flat"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@ -69,9 +69,6 @@ class RosterWindow(Adw.ApplicationWindow):
|
||||
|
||||
# Sidebar widgets
|
||||
projects_listbox = Gtk.Template.Child()
|
||||
add_project_button = Gtk.Template.Child()
|
||||
|
||||
import_menu_button = Gtk.Template.Child()
|
||||
|
||||
# History (hidden but kept for compatibility)
|
||||
history_listbox = Gtk.Template.Child()
|
||||
@ -522,6 +519,10 @@ class RosterWindow(Adw.ApplicationWindow):
|
||||
self.add_action(action)
|
||||
self.get_application().set_accels_for_action("win.send-request", ["<Control>Return"])
|
||||
|
||||
action = Gio.SimpleAction.new("add-project", None)
|
||||
action.connect("activate", lambda a, p: self.on_add_project_clicked(None))
|
||||
self.add_action(action)
|
||||
|
||||
action = Gio.SimpleAction.new("import-openapi", None)
|
||||
action.connect("activate", lambda a, p: self.on_import_openapi_clicked(None))
|
||||
self.add_action(action)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user