diff options
author | emkael <emkael@tlen.pl> | 2019-06-28 12:00:30 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-06-28 12:00:30 +0200 |
commit | 185ffdcbfdd5246e127762ad0b290e99116a0215 (patch) | |
tree | d4807e3d6c0699faf6ffed9dcf0d7aad2fe1800d /jfr_playoff/gui/frames/__init__.py | |
parent | 8fbb85176b183fe72be568beb04f11bc472e1a5e (diff) |
Fixing button alignment in headered repeaters
Diffstat (limited to 'jfr_playoff/gui/frames/__init__.py')
-rw-r--r-- | jfr_playoff/gui/frames/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/jfr_playoff/gui/frames/__init__.py b/jfr_playoff/gui/frames/__init__.py index 4d8ad13..dd4f632 100644 --- a/jfr_playoff/gui/frames/__init__.py +++ b/jfr_playoff/gui/frames/__init__.py @@ -48,10 +48,12 @@ class WidgetRepeater(tk.Frame): return None def _createWidget(self, widgetClass, widgetClassParams=None): + headeridx = int(self.headerFrame is not None) removeButton = ttk.Button( self, text='[-]', width=5, command=lambda i=len(self.widgets): self._removeWidget(i)) - removeButton.grid(row=len(self.widgets), column=0, sticky=tk.N) + removeButton.grid( + row=len(self.widgets)+headeridx, column=0, sticky=tk.N) widget = widgetClass(self) if widgetClassParams is not None: widget.configureContent(**widgetClassParams) @@ -96,7 +98,8 @@ class WidgetRepeater(tk.Frame): if self.headerFrame is not None: self.headerFrame.grid(row=0, column=1, sticky=tk.W+tk.E+tk.N+tk.S) self.addButton.grid( - row=len(self.widgets), column=0, columnspan=1, sticky=tk.W+tk.N) + row=len(self.widgets)+headeridx, column=0, columnspan=1, + sticky=tk.W+tk.N) def _renderHeader(self): if self.headers: |