Compare commits
No commits in common. "bc0ee493e7caeb720ea9c942f1fb29f20529a413" and "728697711cb4b7c30edbde1037d6a005d1e23c83" have entirely different histories.
bc0ee493e7
...
728697711c
@ -43,21 +43,23 @@
|
||||
<!-- Sidebar Header Bar -->
|
||||
<child type="top">
|
||||
<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>
|
||||
<property name="title-widget">
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Projects</property>
|
||||
<style>
|
||||
<class name="title"/>
|
||||
</style>
|
||||
</object>
|
||||
</property>
|
||||
<child type="start">
|
||||
<object class="GtkWindowControls">
|
||||
<property name="side">start</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Projects</property>
|
||||
<property name="margin-start">6</property>
|
||||
<style>
|
||||
<class name="title"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkButton" id="add_project_button">
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
|
||||
@ -166,10 +166,12 @@ class RequestTabWidget(Gtk.Box):
|
||||
# Response Panel
|
||||
response_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
|
||||
# Stack switcher (placed in bottom bar together with status info)
|
||||
# Stack switcher at the top
|
||||
response_switcher = Gtk.StackSwitcher()
|
||||
response_switcher.set_halign(Gtk.Align.START)
|
||||
response_switcher.set_valign(Gtk.Align.CENTER)
|
||||
response_switcher.set_halign(Gtk.Align.CENTER)
|
||||
response_switcher.set_margin_top(8)
|
||||
response_switcher.set_margin_bottom(8)
|
||||
response_box.append(response_switcher)
|
||||
|
||||
# Create a vertical paned for response stack and result panels
|
||||
self.response_main_paned = Gtk.Paned(orientation=Gtk.Orientation.VERTICAL)
|
||||
@ -356,20 +358,13 @@ class RequestTabWidget(Gtk.Box):
|
||||
# Add the main paned to response_box
|
||||
response_box.append(self.response_main_paned)
|
||||
|
||||
# Bottom bar: response tabs (left) + status info (right)
|
||||
bottom_bar = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0)
|
||||
bottom_bar.set_margin_start(6)
|
||||
bottom_bar.set_margin_end(12)
|
||||
bottom_bar.set_margin_top(4)
|
||||
bottom_bar.set_margin_bottom(4)
|
||||
|
||||
bottom_bar.append(response_switcher)
|
||||
|
||||
spacer = Gtk.Box()
|
||||
spacer.set_hexpand(True)
|
||||
bottom_bar.append(spacer)
|
||||
|
||||
# Status Bar
|
||||
status_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12)
|
||||
status_box.set_margin_start(12)
|
||||
status_box.set_margin_end(12)
|
||||
status_box.set_margin_top(6)
|
||||
status_box.set_margin_bottom(6)
|
||||
|
||||
self.status_label = Gtk.Label(label="Ready")
|
||||
self.status_label.add_css_class("heading")
|
||||
status_box.append(self.status_label)
|
||||
@ -380,9 +375,12 @@ class RequestTabWidget(Gtk.Box):
|
||||
self.size_label = Gtk.Label(label="")
|
||||
status_box.append(self.size_label)
|
||||
|
||||
bottom_bar.append(status_box)
|
||||
# Spacer
|
||||
spacer = Gtk.Box()
|
||||
spacer.set_hexpand(True)
|
||||
status_box.append(spacer)
|
||||
|
||||
response_box.append(bottom_bar)
|
||||
response_box.append(status_box)
|
||||
|
||||
split_pane.set_end_child(response_box)
|
||||
|
||||
|
||||
@ -72,8 +72,7 @@
|
||||
|
||||
<child>
|
||||
<object class="GtkListBox" id="requests_listbox">
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-start">12</property>
|
||||
<style>
|
||||
<class name="navigation-sidebar"/>
|
||||
</style>
|
||||
|
||||
@ -11,9 +11,10 @@
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="method_label">
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="width-chars">6</property>
|
||||
<style>
|
||||
<class name="method-chip"/>
|
||||
<class name="caption"/>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@ -20,14 +20,6 @@
|
||||
|
||||
from gi.repository import Gtk, GObject
|
||||
|
||||
_METHOD_CSS = {
|
||||
'GET': 'accent',
|
||||
'POST': 'success',
|
||||
'PUT': 'warning',
|
||||
'PATCH': 'warning',
|
||||
'DELETE': 'error',
|
||||
}
|
||||
|
||||
|
||||
@Gtk.Template(resource_path='/cz/bugsy/roster/widgets/request-item.ui')
|
||||
class RequestItem(Gtk.Box):
|
||||
@ -46,9 +38,7 @@ class RequestItem(Gtk.Box):
|
||||
def __init__(self, saved_request):
|
||||
super().__init__()
|
||||
self.saved_request = saved_request
|
||||
method = saved_request.request.method
|
||||
self.method_label.set_text(method)
|
||||
self.method_label.add_css_class(_METHOD_CSS.get(method, 'dim-label'))
|
||||
self.method_label.set_text(saved_request.request.method)
|
||||
self.name_label.set_text(saved_request.name)
|
||||
|
||||
# Add click gesture for loading
|
||||
|
||||
@ -203,18 +203,6 @@ class RosterWindow(Adw.ApplicationWindow):
|
||||
color: @accent_color;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Method chips in sidebar request list */
|
||||
.method-chip {
|
||||
border-radius: 4px;
|
||||
padding: 1px 5px;
|
||||
font-size: 0.72em;
|
||||
font-weight: 700;
|
||||
}
|
||||
.method-chip.accent { background-color: alpha(@accent_bg_color, 0.18); }
|
||||
.method-chip.success { background-color: alpha(@success_bg_color, 0.18); }
|
||||
.method-chip.warning { background-color: alpha(@warning_bg_color, 0.18); }
|
||||
.method-chip.error { background-color: alpha(@error_bg_color, 0.18); }
|
||||
""")
|
||||
|
||||
Gtk.StyleContext.add_provider_for_display(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user