Move request/response tab switchers to bottom of panels

This commit is contained in:
Pavel Baksy 2026-05-20 00:40:01 +02:00
parent a6c389edd7
commit 38242f5c95

View File

@ -149,8 +149,8 @@ class RequestTabWidget(Gtk.Box):
request_switcher.set_margin_top(8) request_switcher.set_margin_top(8)
request_switcher.set_margin_bottom(8) request_switcher.set_margin_bottom(8)
request_box.append(request_switcher)
request_box.append(self.request_stack) request_box.append(self.request_stack)
request_box.append(request_switcher)
# Headers tab # Headers tab
self._build_headers_tab() self._build_headers_tab()
@ -166,12 +166,10 @@ class RequestTabWidget(Gtk.Box):
# Response Panel # Response Panel
response_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) response_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
# Stack switcher at the top # Stack switcher (placed in bottom bar together with status info)
response_switcher = Gtk.StackSwitcher() response_switcher = Gtk.StackSwitcher()
response_switcher.set_halign(Gtk.Align.CENTER) response_switcher.set_halign(Gtk.Align.START)
response_switcher.set_margin_top(8) response_switcher.set_valign(Gtk.Align.CENTER)
response_switcher.set_margin_bottom(8)
response_box.append(response_switcher)
# Create a vertical paned for response stack and result panels # Create a vertical paned for response stack and result panels
self.response_main_paned = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL) self.response_main_paned = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL)
@ -358,13 +356,20 @@ class RequestTabWidget(Gtk.Box):
# Add the main paned to response_box # Add the main paned to response_box
response_box.append(self.response_main_paned) response_box.append(self.response_main_paned)
# Status Bar # Bottom bar: response tabs (left) + status info (right)
status_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12) bottom_bar = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0)
status_box.set_margin_start(12) bottom_bar.set_margin_start(6)
status_box.set_margin_end(12) bottom_bar.set_margin_end(12)
status_box.set_margin_top(6) bottom_bar.set_margin_top(4)
status_box.set_margin_bottom(6) bottom_bar.set_margin_bottom(4)
bottom_bar.append(response_switcher)
spacer = Gtk.Box()
spacer.set_hexpand(True)
bottom_bar.append(spacer)
status_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12)
self.status_label = Gtk.Label(label="Ready") self.status_label = Gtk.Label(label="Ready")
self.status_label.add_css_class("heading") self.status_label.add_css_class("heading")
status_box.append(self.status_label) status_box.append(self.status_label)
@ -375,12 +380,9 @@ class RequestTabWidget(Gtk.Box):
self.size_label = Gtk.Label(label="") self.size_label = Gtk.Label(label="")
status_box.append(self.size_label) status_box.append(self.size_label)
# Spacer bottom_bar.append(status_box)
spacer = Gtk.Box()
spacer.set_hexpand(True)
status_box.append(spacer)
response_box.append(status_box) response_box.append(bottom_bar)
split_pane.set_end_child(response_box) split_pane.set_end_child(response_box)