Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhozic committed Jan 31, 2024
1 parent d690b83 commit d0bf7f8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ Glossary
Releases
---------------------

v1.4.6
================
- Fixed some parameter name lengths not being accommodated for.


v1.4.5
================
- Further generic type fixes
Expand Down
2 changes: 1 addition & 1 deletion tkclasswiz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
SOFTWARE.
"""

__version__ = "1.4.5"
__version__ = "1.4.6"


from .object_frame import *
Expand Down
10 changes: 8 additions & 2 deletions tkclasswiz/object_frame/frame_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,18 @@ def load_template():
self.remember_gui_data()

def _create_fields(self, annotations: dict[str, type], additional_values: dict, frame: ttk.Frame):
label_width = max(*map(len, annotations), 15) - 2
dpi_5 = dpi_scaled(5)
dpi_5h = dpi_5 // 2

labels: list[ttk.Label] = []
for (k, v) in annotations.items():
# Init widgets
entry_types = convert_types(v)
frame_annotated = ttk.Frame(frame)
frame_annotated.pack(fill=tk.BOTH, expand=True, pady=dpi_5)
ttk.Label(frame_annotated, text=k, width=label_width).pack(side="left")
label = ttk.Label(frame_annotated, text=k)
labels.append(label)
label.pack(side="left")

# Storage widget with the tooltip for displaying
# nicknames on ObjectInfo instances
Expand Down Expand Up @@ -206,6 +208,10 @@ def _create_fields(self, annotations: dict[str, type], additional_values: dict,
combo.pack(fill=tk.X, side="right", expand=True, padx=dpi_5h)
self._map[k] = (w, entry_types)

max_width = max(label.winfo_reqwidth() for label in labels) // 5
for label in labels:
label.config(width=max_width)

def _fill_field_values(
self,
k: str,
Expand Down

0 comments on commit d0bf7f8

Please sign in to comment.