@@ -484,6 +484,7 @@ def __init__(self, top=None):
484484 self .style .map ('.' ,background =
485485 [('selected' , _compcolor ), ('active' ,_ana2color )])
486486 self .font = tkFont .Font (family = 'TkDefaultFont' )
487+ self .fontHeight = self .font .metrics ('linespace' ) / 500
487488 self .tooltip_font = "TkDefaultFont"
488489
489490 self .top = top
@@ -674,7 +675,9 @@ def getMaxColumnWidth(self, num):
674675 upper = lower + 5
675676 sizeArr = []
676677 for i in range (lower , min (upper , len (Optional_Rulesets ))):
677- sizeArr .append (self .getTextLength (Optional_Rulesets [i ].name )- .03 )
678+ # sizeArr.append(self.getTextLength(Optional_Rulesets[i].name)-.03)
679+ for j in range (Optional_Rulesets [i ].name .count ('\n ' ) + 1 ):
680+ sizeArr .append (self .getTextLength (Optional_Rulesets [i ].name .split ('\n ' )[j ])- .03 )
678681 if len (sizeArr ) == 0 :
679682 return self .getTextLength ("# of Seeds" )- .03
680683 return max (sizeArr )
@@ -734,11 +737,16 @@ def setDisplayedRulesets(self):
734737 yShiftArray = spaceOut (min (numOptRulesets + 1 , 5 ), .09 , numDecimalPlaces = 3 )
735738 optRulesetNum = 0
736739 for i in range (len (Optional_Rulesets )):
740+ tempMaxLen = 0
741+ tempNumLines = 0
742+ for line in Optional_Rulesets [i ].name .split ('\n ' ):
743+ tempMaxLen = max (tempMaxLen , self .getTextLength (line ))
744+ tempNumLines += 1
737745 if firstIndex <= i < lastIndex :
738- self .CheckButtons [i ].place (relx = .475 - self .getMaxColumnWidth (optRulesetNum )/ 2 + xShiftArray [optRulesetNum // 5 ], rely = (.40 + yShiftArray [optRulesetNum % 5 ])* vMult , relheight = .05 * vMult , relwidth = self . getTextLength ( Optional_Rulesets [ i ]. name ) + .03 )
746+ self .CheckButtons [i ].place (relx = .475 - self .getMaxColumnWidth (optRulesetNum )/ 2 + xShiftArray [optRulesetNum // 5 ], rely = (.40 + yShiftArray [optRulesetNum % 5 ])* vMult , relheight = max ( self . fontHeight * tempNumLines * vMult , 0.05 ), relwidth = tempMaxLen + .03 )
739747 optRulesetNum += 1
740748 else :
741- self .CheckButtons [i ].place (relx = 10 , rely = 10 , relheight = .05 * vMult , relwidth = self . getTextLength ( Optional_Rulesets [ i ]. name ) + .03 )
749+ self .CheckButtons [i ].place (relx = 10 , rely = 10 , relheight = max ( self . fontHeight * tempNumLines * vMult , 0.05 ), relwidth = tempMaxLen + .03 )
742750
743751 if optRulesetNum < 15 :
744752 # Number of Seeds Label
@@ -821,7 +829,7 @@ def showAboutPopup(self):
821829 showinfo ("About" , About_Page_Text )
822830
823831 def showSRMPopup (self ):
824- showinfo ("Simple Randomizer Maker v1.25 " , "This was made using\n GateGuy 's Simple Randomizer Maker.\n \n https://github.com/GateGuy /SimpleRandomizerMaker" )
832+ showinfo ("Simple Randomizer Maker v1.26 " , "This was made using\n Mips96 's Simple Randomizer Maker.\n \n https://github.com/Mips96 /SimpleRandomizerMaker" )
825833
826834# ======================================================
827835# Support code for Balloon Help (also called tooltips).
0 commit comments