Commit 41297046 authored by Roman Alifanov's avatar Roman Alifanov

fix elements going out the window

parent 3bcbabca
......@@ -14,8 +14,7 @@ class ChoiceWidget(BaseWidget):
self.handler_id = self.dropdown.connect("notify::selected", self._on_choice_changed)
self.row.set_activatable_widget(self.dropdown)
self._set_dropdown_width(items)
self._update_dropdown_selection()
......@@ -37,18 +36,6 @@ class ChoiceWidget(BaseWidget):
with self.dropdown.handler_block(self.handler_id):
self.dropdown.set_selected(current_index)
def _set_dropdown_width(self, items):
layout = self.dropdown.create_pango_layout("")
width = 0
for item in items:
layout.set_text(item)
text_width = layout.get_pixel_size()[0]
if text_width > width:
width = text_width
self.dropdown.set_size_request(width + 50, -1)
def _on_choice_changed(self, dropdown, _):
selected = dropdown.get_selected()
if selected < 0 or selected >= len(self.setting.map):
......
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