Strip method prefix from request names in sidebar
This commit is contained in:
parent
101b6217bc
commit
4a0a5f1d93
@ -49,7 +49,12 @@ class RequestItem(Gtk.Box):
|
|||||||
method = saved_request.request.method
|
method = saved_request.request.method
|
||||||
self.method_label.set_text(method)
|
self.method_label.set_text(method)
|
||||||
self.method_label.add_css_class(_METHOD_CSS.get(method, 'dim-label'))
|
self.method_label.add_css_class(_METHOD_CSS.get(method, 'dim-label'))
|
||||||
self.name_label.set_text(saved_request.name)
|
display_name = saved_request.name
|
||||||
|
for prefix in _METHOD_CSS:
|
||||||
|
if display_name.upper().startswith(prefix + ' '):
|
||||||
|
display_name = display_name[len(prefix) + 1:]
|
||||||
|
break
|
||||||
|
self.name_label.set_text(display_name)
|
||||||
|
|
||||||
# Add click gesture for loading
|
# Add click gesture for loading
|
||||||
gesture = Gtk.GestureClick.new()
|
gesture = Gtk.GestureClick.new()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user