Compare commits

..

No commits in common. "bc0ee493e7caeb720ea9c942f1fb29f20529a413" and "728697711cb4b7c30edbde1037d6a005d1e23c83" have entirely different histories.

6 changed files with 31 additions and 53 deletions

View File

@ -43,21 +43,23 @@
<!-- Sidebar Header Bar --> <!-- Sidebar Header Bar -->
<child type="top"> <child type="top">
<object class="AdwHeaderBar"> <object class="AdwHeaderBar">
<property name="show-title">False</property>
<property name="show-end-title-buttons">False</property> <property name="show-end-title-buttons">False</property>
<property name="show-start-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"> <child type="start">
<object class="GtkWindowControls"> <object class="GtkWindowControls">
<property name="side">start</property> <property name="side">start</property>
</object> </object>
</child> </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"> <child type="end">
<object class="GtkButton" id="add_project_button"> <object class="GtkButton" id="add_project_button">
<property name="icon-name">list-add-symbolic</property> <property name="icon-name">list-add-symbolic</property>

View File

@ -166,10 +166,12 @@ 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 (placed in bottom bar together with status info) # Stack switcher at the top
response_switcher = Gtk.StackSwitcher() response_switcher = Gtk.StackSwitcher()
response_switcher.set_halign(Gtk.Align.START) response_switcher.set_halign(Gtk.Align.CENTER)
response_switcher.set_valign(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 # 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)
@ -356,20 +358,13 @@ 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)
# Bottom bar: response tabs (left) + status info (right) # Status Bar
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_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12) 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 = 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)
@ -380,9 +375,12 @@ 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)
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) split_pane.set_end_child(response_box)

View File

@ -72,8 +72,7 @@
<child> <child>
<object class="GtkListBox" id="requests_listbox"> <object class="GtkListBox" id="requests_listbox">
<property name="margin-start">6</property> <property name="margin-start">12</property>
<property name="margin-end">6</property>
<style> <style>
<class name="navigation-sidebar"/> <class name="navigation-sidebar"/>
</style> </style>

View File

@ -11,9 +11,10 @@
<child> <child>
<object class="GtkLabel" id="method_label"> <object class="GtkLabel" id="method_label">
<property name="xalign">0.5</property> <property name="width-chars">6</property>
<style> <style>
<class name="method-chip"/> <class name="caption"/>
<class name="dim-label"/>
</style> </style>
</object> </object>
</child> </child>

View File

@ -20,14 +20,6 @@
from gi.repository import Gtk, GObject 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') @Gtk.Template(resource_path='/cz/bugsy/roster/widgets/request-item.ui')
class RequestItem(Gtk.Box): class RequestItem(Gtk.Box):
@ -46,9 +38,7 @@ class RequestItem(Gtk.Box):
def __init__(self, saved_request): def __init__(self, saved_request):
super().__init__() super().__init__()
self.saved_request = saved_request self.saved_request = saved_request
method = saved_request.request.method self.method_label.set_text(saved_request.request.method)
self.method_label.set_text(method)
self.method_label.add_css_class(_METHOD_CSS.get(method, 'dim-label'))
self.name_label.set_text(saved_request.name) self.name_label.set_text(saved_request.name)
# Add click gesture for loading # Add click gesture for loading

View File

@ -203,18 +203,6 @@ class RosterWindow(Adw.ApplicationWindow):
color: @accent_color; color: @accent_color;
font-weight: 600; 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( Gtk.StyleContext.add_provider_for_display(