File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from enum import Enum
12from functools import cached_property
23from typing import TypeVar , Generic , Any
34import PySimpleGUI as sg
@@ -40,7 +41,7 @@ def apply_default_names(self):
4041 for state in self .states :
4142 # default param set + 2-level copy
4243 self .options [state ] = dict (
43- button_text = state ,
44+ button_text = state if not isinstance ( state , Enum ) else state . name ,
4445 ) | self .options [state ]
4546
4647 @cached_property
Original file line number Diff line number Diff line change @@ -94,16 +94,13 @@ def build_layout(self):
9494 self .look_for_title_button = MultiStateButton ({
9595 LookForTitle .CURRENT : dict (
9696 tooltip = "Use title from current window" ,
97- button_text = "CURRENT"
9897 ),
9998 LookForTitle .ROOT : dict (
10099 tooltip = "Use title from main (root) window" ,
101- button_text = "ROOT"
102100 ),
103101 LookForTitle .ANY : dict (
104102 tooltip = "Use any title from current "
105103 "to root window" ,
106- button_text = "ANY"
107104 )
108105 },
109106 self .ID .BUTTON_LOOK_FOR_TITLE ,
You can’t perform that action at this time.
0 commit comments