From 07b299a8cb5b84456efde0941af308a3b9c7bf3f Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 16 Nov 2019 14:50:36 +0100 Subject: Minimum phase tab name length forced --- jfr_playoff/gui/frames/match.py | 5 +++-- jfr_playoff/gui/tabs.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/jfr_playoff/gui/frames/match.py b/jfr_playoff/gui/frames/match.py index 7d0b923..15aa56c 100644 --- a/jfr_playoff/gui/frames/match.py +++ b/jfr_playoff/gui/frames/match.py @@ -641,9 +641,10 @@ class MatchSettingsFrame(RepeatableFrame): def label(self): try: phase = self._getPhase() - return 'Mecz #%d (%s)' % ( + return 'Mecz #%d [faza: %s]' % ( self.getMatchID(), - phase.master.tab(phase)['text'] if phase is not None else '') + phase.master.tab(phase)['text'].strip() + if phase is not None else '') except tk.TclError: # we're probably just being created, ignore return '' diff --git a/jfr_playoff/gui/tabs.py b/jfr_playoff/gui/tabs.py index 9d71465..b444ecd 100644 --- a/jfr_playoff/gui/tabs.py +++ b/jfr_playoff/gui/tabs.py @@ -250,8 +250,9 @@ class MatchesTab(PlayoffTab): phase = MatchPhaseFrame( self.phaseFrame, vertical=True, padx=10, pady=10) newPhase = max(self.phases.keys()) + 1 if len(self.phases) else 1 - self.phaseFrame.add(phase, text='Faza #%d' % (newPhase)) + self.phaseFrame.add(phase) self.phases[newPhase] = phase + self._renameTabs() self.winfo_toplevel().event_generate( '<>', when='tail') return newPhase @@ -275,7 +276,7 @@ class MatchesTab(PlayoffTab): for idx, tab in self.phases.iteritems(): title = tab.name.get().strip() self.phaseFrame.tab( - tab, text=title if len(title) else 'Faza #%d' % (idx)) + tab, text=(title if len(title) else '') + ' (#%d)' % (idx)) def renderContent(self, container): container.columnconfigure(1, weight=1) -- cgit v1.2.3