Merge pull request #1974 from PySimpleGUI/Dev-latest

Dev latest
This commit is contained in:
PySimpleGUI 2019-09-16 15:41:14 -04:00 committed by GitHub
commit caeec0ccfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.5.0.5 Unreleased Metadata & Mac Button Test" version = __version__ = "4.5.0.6 Unreleased Mac Buttons Justify fix"
# 888888ba .d88888b oo dP .88888. dP dP dP # 888888ba .d88888b oo dP .88888. dP dP dP
@ -5062,7 +5062,7 @@ class Window:
self.AutoSizeText = auto_size_text if auto_size_text is not None else DEFAULT_AUTOSIZE_TEXT self.AutoSizeText = auto_size_text if auto_size_text is not None else DEFAULT_AUTOSIZE_TEXT
self.AutoSizeButtons = auto_size_buttons if auto_size_buttons is not None else DEFAULT_AUTOSIZE_BUTTONS self.AutoSizeButtons = auto_size_buttons if auto_size_buttons is not None else DEFAULT_AUTOSIZE_BUTTONS
self.Title = title self.Title = str(title)
self.Rows = [] # a list of ELEMENTS for this row self.Rows = [] # a list of ELEMENTS for this row
self.DefaultElementSize = default_element_size self.DefaultElementSize = default_element_size
self.DefaultButtonElementSize = default_button_element_size if default_button_element_size != ( self.DefaultButtonElementSize = default_button_element_size if default_button_element_size != (
@ -5123,8 +5123,6 @@ class Window:
self.ElementJustification = element_justification self.ElementJustification = element_justification
self.FocusSet = False self.FocusSet = False
self.metadata = metadata self.metadata = metadata
if type(title) != str:
warnings.warn('Your title is not a string. Are you passing in the right parameters?', UserWarning)
if layout is not None and type(layout) not in (list, tuple): if layout is not None and type(layout) not in (list, tuple):
warnings.warn('Your layout is not a list or tuple... this is not good!') warnings.warn('Your layout is not a list or tuple... this is not good!')
@ -7455,7 +7453,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
# *********** Make TK Row ***********# # *********** Make TK Row ***********#
tk_row_frame = tk.Frame(containing_frame) tk_row_frame = tk.Frame(containing_frame)
row_should_expand = False row_should_expand = False
row_justify = '' row_justify = form.ElementJustification
for col_num, element in enumerate(flex_row): for col_num, element in enumerate(flex_row):
element.ParentRowFrame = tk_row_frame element.ParentRowFrame = tk_row_frame
element.ParentForm = toplevel_form # save the button's parent form object element.ParentForm = toplevel_form # save the button's parent form object
@ -7539,6 +7537,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
else: else:
anchor=tk.NW anchor=tk.NW
side = tk.LEFT side = tk.LEFT
# anchor=tk.NW
# side = tk.LEFT
row_justify = element.Justification row_justify = element.Justification
element.Widget = element.TKColFrame element.Widget = element.TKColFrame
element.TKColFrame.pack(side=side, anchor=anchor, padx=elementpad[0], pady=elementpad[1], expand=False, fill=tk.NONE) element.TKColFrame.pack(side=side, anchor=anchor, padx=elementpad[0], pady=elementpad[1], expand=False, fill=tk.NONE)
@ -7684,6 +7684,9 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
tkbutton.bind('<ButtonRelease-1>', element.ButtonReleaseCallBack) tkbutton.bind('<ButtonRelease-1>', element.ButtonReleaseCallBack)
tkbutton.bind('<ButtonPress-1>', element.ButtonPressCallBack) tkbutton.bind('<ButtonPress-1>', element.ButtonPressCallBack)
if bc != (None, None) and bc != COLOR_SYSTEM_DEFAULT and bc[1] != COLOR_SYSTEM_DEFAULT: if bc != (None, None) and bc != COLOR_SYSTEM_DEFAULT and bc[1] != COLOR_SYSTEM_DEFAULT:
if sys.platform.startswith('darwin'):
tkbutton.config(foreground=bc[0], highlightbackground=bc[1], activebackground=bc[1])
else:
tkbutton.config(foreground=bc[0], background=bc[1], activebackground=bc[1]) tkbutton.config(foreground=bc[0], background=bc[1], activebackground=bc[1])
elif bc[1] == COLOR_SYSTEM_DEFAULT: elif bc[1] == COLOR_SYSTEM_DEFAULT:
tkbutton.config(foreground=bc[0]) tkbutton.config(foreground=bc[0])