Skip to content

Commit

Permalink
Create x2m title widget in all cases [CUSTOM] (#278)
Browse files Browse the repository at this point in the history
Fix PCLAS-1061
  • Loading branch information
nicoe authored Sep 13, 2024
1 parent e470555 commit 69f0b12
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions tryton/tryton/gui/window/view_form/view/form_gtk/many2many.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ def __init__(self, view, attrs):
hbox = Gtk.HBox(homogeneous=False, spacing=0)
hbox.set_border_width(2)

self.title = Gtk.Label(
label=set_underline(attrs.get('string', '')),
use_underline=True, halign=Gtk.Align.START)
if not attrs.get('expand_toolbar'):
if attrs.get('collapse_body'):
click_catcher = Gtk.EventBox.new()
click_catcher.set_above_child(True)
click_catcher.connect('button-press-event', self._toggle_body)

collapse_hbox = Gtk.HBox()
self.title = Gtk.Label(
label=set_underline(attrs.get('string', '')),
use_underline=True, halign=Gtk.Align.START)
self.title_expander = Gtk.Image()
self.title_expander.set_from_pixbuf(
common.IconFactory.get_pixbuf('tryton-arrow-down'))
Expand All @@ -58,9 +58,6 @@ def __init__(self, view, attrs):
hbox.pack_start(
click_catcher, expand=True, fill=True, padding=0)
else:
self.title = Gtk.Label(
label=set_underline(attrs.get('string', '')),
use_underline=True, halign=Gtk.Align.START)
hbox.pack_start(self.title, expand=True, fill=True, padding=0)

hbox.pack_start(Gtk.VSeparator(), expand=False, fill=True, padding=0)
Expand Down
9 changes: 3 additions & 6 deletions tryton/tryton/gui/window/view_form/view/form_gtk/one2many.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ def __init__(self, view, attrs):
self.title_box = hbox = Gtk.HBox(homogeneous=False, spacing=0)
hbox.set_border_width(2)

self.title = Gtk.Label(
label=set_underline(attrs.get('string', '')),
use_underline=True, halign=Gtk.Align.START)
if not attrs.get('expand_toolbar'):
if attrs.get('collapse_body'):
click_catcher = Gtk.EventBox.new()
click_catcher.set_above_child(True)
click_catcher.connect('button-press-event', self._toggle_body)

collapse_hbox = Gtk.HBox()
self.title = Gtk.Label(
label=set_underline(attrs.get('string', '')),
use_underline=True, halign=Gtk.Align.START)
self.title_expander = Gtk.Image()
self.title_expander.set_from_pixbuf(
common.IconFactory.get_pixbuf('tryton-arrow-down'))
Expand All @@ -62,9 +62,6 @@ def __init__(self, view, attrs):
hbox.pack_start(
click_catcher, expand=True, fill=True, padding=0)
else:
self.title = Gtk.Label(
label=set_underline(attrs.get('string', '')),
use_underline=True, halign=Gtk.Align.START)
hbox.pack_start(
self.title, expand=True, fill=True, padding=0)

Expand Down

0 comments on commit 69f0b12

Please sign in to comment.