Skip to content

Commit d0bf7f8

Browse files
committed
fix
1 parent d690b83 commit d0bf7f8

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

docs/source/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ Glossary
2424
Releases
2525
---------------------
2626

27+
v1.4.6
28+
================
29+
- Fixed some parameter name lengths not being accommodated for.
30+
31+
2732
v1.4.5
2833
================
2934
- Further generic type fixes

tkclasswiz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
SOFTWARE.
2828
"""
2929

30-
__version__ = "1.4.5"
30+
__version__ = "1.4.6"
3131

3232

3333
from .object_frame import *

tkclasswiz/object_frame/frame_struct.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,18 @@ def load_template():
149149
self.remember_gui_data()
150150

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

155+
labels: list[ttk.Label] = []
156156
for (k, v) in annotations.items():
157157
# Init widgets
158158
entry_types = convert_types(v)
159159
frame_annotated = ttk.Frame(frame)
160160
frame_annotated.pack(fill=tk.BOTH, expand=True, pady=dpi_5)
161-
ttk.Label(frame_annotated, text=k, width=label_width).pack(side="left")
161+
label = ttk.Label(frame_annotated, text=k)
162+
labels.append(label)
163+
label.pack(side="left")
162164

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

211+
max_width = max(label.winfo_reqwidth() for label in labels) // 5
212+
for label in labels:
213+
label.config(width=max_width)
214+
209215
def _fill_field_values(
210216
self,
211217
k: str,

0 commit comments

Comments
 (0)