Commit 3a845eb0 authored by Philipp Hörist's avatar Philipp Hörist

DataFormDialog: Limit ComboBox width

parent 78b06833
......@@ -25,6 +25,7 @@
from gajim.common.modules.dataforms import extend_form
from gajim.gtk.util import MultiLineLabel
from gajim.gtk.util import MaxWidthComboBoxText
class DataFormWidget(Gtk.ScrolledWindow):
......@@ -318,7 +319,7 @@ class ListSingleField(Field):
def __init__(self, field, form_grid, options):
Field.__init__(self, field, form_grid, options)
self._widget = Gtk.ComboBoxText()
self._widget = MaxWidthComboBoxText()
self._widget.set_valign(Gtk.Align.CENTER)
for value, label in field.iter_options():
if not label:
......
......@@ -636,6 +636,8 @@ class MaxWidthComboBoxText(Gtk.ComboBoxText):
def __init__(self, *args, **kwargs):
Gtk.ComboBoxText.__init__(self, *args, **kwargs)
self._max_width = 100
text_renderer = self.get_cells()[0]
text_renderer.set_property('ellipsize', Pango.EllipsizeMode.END)
def set_max_size(self, size):
self._max_width = size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment