Merge pull request #4875 from PySimpleGUI/Dev-latest
Changed Separator elements expansion logic. It appears like it was c…
This commit is contained in:
commit
46d4e35ca2
|
@ -1,12 +1,15 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
|
||||||
version = __version__ = "4.53.0 Released 24-Oct-2021"
|
version = __version__ = "4.53.0.1 Unreleased"
|
||||||
|
|
||||||
_change_log = """
|
_change_log = """
|
||||||
|
|
||||||
Changelog since 4.53.0 released to PyPI on 24-Oct-2021
|
Changelog since 4.53.0 released to PyPI on 24-Oct-2021
|
||||||
|
|
||||||
|
4.53.0.1
|
||||||
|
Changed how expansion is handled by Separator elements.
|
||||||
|
Only the horizontal separator expands now. The vertical separator will not cause the row to expand, but it will expand with a row.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = version.split()[0] # For PEP 396 and PEP 345
|
__version__ = version.split()[0] # For PEP 396 and PEP 345
|
||||||
|
@ -6003,6 +6006,8 @@ class VerticalSeparator(Element):
|
||||||
"""
|
"""
|
||||||
key = key if key is not None else k
|
key = key if key is not None else k
|
||||||
pad = pad if pad is not None else p
|
pad = pad if pad is not None else p
|
||||||
|
self.expand_x = None
|
||||||
|
self.expand_y = None
|
||||||
self.Orientation = 'vertical' # for now only vertical works
|
self.Orientation = 'vertical' # for now only vertical works
|
||||||
self.color = color if color is not None else theme_text_color()
|
self.color = color if color is not None else theme_text_color()
|
||||||
super().__init__(ELEM_TYPE_SEPARATOR, pad=pad, key=key)
|
super().__init__(ELEM_TYPE_SEPARATOR, pad=pad, key=key)
|
||||||
|
@ -6037,6 +6042,8 @@ class HorizontalSeparator(Element):
|
||||||
|
|
||||||
self.Orientation = 'horizontal' # for now only vertical works
|
self.Orientation = 'horizontal' # for now only vertical works
|
||||||
self.color = color if color is not None else theme_text_color()
|
self.color = color if color is not None else theme_text_color()
|
||||||
|
self.expand_x = True
|
||||||
|
self.expand_y = None
|
||||||
key = key if key is not None else k
|
key = key if key is not None else k
|
||||||
pad = pad if pad is not None else p
|
pad = pad if pad is not None else p
|
||||||
|
|
||||||
|
@ -15014,12 +15021,15 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
if element.color is not None:
|
if element.color is not None:
|
||||||
style.configure(style_name, background=element.color)
|
style.configure(style_name, background=element.color)
|
||||||
separator = element.Widget = ttk.Separator(tk_row_frame, orient=element.Orientation, )
|
separator = element.Widget = ttk.Separator(tk_row_frame, orient=element.Orientation, )
|
||||||
|
|
||||||
|
expand, fill, row_should_expand, row_fill_direction = _add_expansion(element, row_should_expand, row_fill_direction)
|
||||||
|
|
||||||
if element.Orientation.startswith('h'):
|
if element.Orientation.startswith('h'):
|
||||||
# row_should_expand = True
|
# row_should_expand = True
|
||||||
row_fill_direction = tk.X
|
# row_fill_direction = tk.X
|
||||||
separator.pack(side=tk.LEFT, padx=elementpad[0], pady=elementpad[1], fill=tk.X, expand=True)
|
separator.pack(side=tk.LEFT, padx=elementpad[0], pady=elementpad[1], fill=tk.X, expand=True)
|
||||||
else:
|
else:
|
||||||
row_fill_direction = tk.Y
|
# row_fill_direction = tk.Y
|
||||||
separator.pack(side=tk.LEFT, padx=elementpad[0], pady=elementpad[1], fill=tk.Y, expand=True)
|
separator.pack(side=tk.LEFT, padx=elementpad[0], pady=elementpad[1], fill=tk.Y, expand=True)
|
||||||
element.Widget.configure(style=style_name) # IMPORTANT! Apply the style
|
element.Widget.configure(style=style_name) # IMPORTANT! Apply the style
|
||||||
# ------------------------- SizeGrip placement element ------------------------- #
|
# ------------------------- SizeGrip placement element ------------------------- #
|
||||||
|
|
Loading…
Reference in New Issue