Compare commits
3 Commits
728697711c
...
bc0ee493e7
| Author | SHA1 | Date | |
|---|---|---|---|
| bc0ee493e7 | |||
| 38242f5c95 | |||
| a6c389edd7 |
@ -43,22 +43,20 @@
|
|||||||
<!-- 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>
|
||||||
<child type="start">
|
<property name="title-widget">
|
||||||
<object class="GtkWindowControls">
|
|
||||||
<property name="side">start</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child type="start">
|
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="label">Projects</property>
|
<property name="label">Projects</property>
|
||||||
<property name="margin-start">6</property>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="title"/>
|
<class name="title"/>
|
||||||
</style>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
|
</property>
|
||||||
|
<child type="start">
|
||||||
|
<object class="GtkWindowControls">
|
||||||
|
<property name="side">start</property>
|
||||||
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child type="end">
|
<child type="end">
|
||||||
<object class="GtkButton" id="add_project_button">
|
<object class="GtkButton" id="add_project_button">
|
||||||
|
|||||||
@ -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)
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,8 @@
|
|||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBox" id="requests_listbox">
|
<object class="GtkListBox" id="requests_listbox">
|
||||||
<property name="margin-start">12</property>
|
<property name="margin-start">6</property>
|
||||||
|
<property name="margin-end">6</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="navigation-sidebar"/>
|
<class name="navigation-sidebar"/>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -11,10 +11,9 @@
|
|||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="method_label">
|
<object class="GtkLabel" id="method_label">
|
||||||
<property name="width-chars">6</property>
|
<property name="xalign">0.5</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="caption"/>
|
<class name="method-chip"/>
|
||||||
<class name="dim-label"/>
|
|
||||||
</style>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|||||||
@ -20,6 +20,14 @@
|
|||||||
|
|
||||||
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):
|
||||||
@ -38,7 +46,9 @@ 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
|
||||||
self.method_label.set_text(saved_request.request.method)
|
method = 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
|
||||||
|
|||||||
@ -203,6 +203,18 @@ 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(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user