Skip to content

Commit a9f7fe8

Browse files
committed
Scaling
1 parent 8b01abf commit a9f7fe8

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
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.1
28+
================
29+
- Fixed scaling (padding) issues
30+
31+
2732
v1.4.0
2833
================
2934
- Definition of enums and literal values inside iterable types.

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.0"
30+
__version__ = "1.4.1"
3131

3232

3333
from .object_frame import *

tkclasswiz/object_frame/frame_flag.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,18 @@ def __init__(
5252
):
5353
super().__init__(class_, return_widget, parent, old_data, check_parameters, allow_save)
5454

55+
dpi_5 = dpi_scaled(5)
56+
dpi_10 = dpi_scaled(5)
5557
ttk.Label(self.frame_main, text="Current value").pack(anchor=tk.W)
5658
w = PyObjectScalar(self.frame_main)
57-
w.pack(fill=tk.X, pady=dpi_scaled(5))
59+
w.pack(fill=tk.X, pady=dpi_5)
5860

59-
ttk.Separator(self.frame_main).pack(fill=tk.X, pady=dpi_scaled(5))
61+
ttk.Separator(self.frame_main).pack(fill=tk.X, pady=dpi_10)
6062

6163
ttk.Label(self.frame_main, text="Modify").pack(anchor=tk.W)
6264
combo_select = ComboBoxObjects(self.frame_main, width=max(map(len, map(str, list(class_)))))
6365
combo_select["values"] = list(class_)
64-
combo_select.pack(anchor=tk.W, pady=dpi_scaled(5))
66+
combo_select.pack(anchor=tk.W, pady=dpi_5)
6567
bnt_add_flag = ttk.Button(self.frame_main, text="Add flag", command=lambda: self._update_flag(combo_select.get(), True))
6668
bnt_add_flag.pack(anchor=tk.W)
6769
bnt_remove_flag = ttk.Button(self.frame_main, text="Remove flag", command=lambda: self._update_flag(combo_select.get(), False))

tkclasswiz/object_frame/frame_iterable.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def __init__(
6868
allow_save = True
6969
):
7070
dpi_5 = dpi_scaled(5)
71+
7172
super().__init__(class_, return_widget, parent, old_data, check_parameters, allow_save)
7273
self.storage_widget = w = ListBoxScrolled(self.frame_main, height=20)
7374
ListboxTooltip(self.storage_widget, 0)
@@ -79,10 +80,10 @@ def __init__(
7980

8081
ttk.Button(frame_cp, text="Copy", command=w.save_to_clipboard).pack(side="left", fill=tk.X, expand=True)
8182
ttk.Button(frame_cp, text="Paste", command=w.paste_from_clipboard).pack(side="left", fill=tk.X, expand=True)
82-
menubtn = ttk.Menubutton(frame_edit_remove, text="Add")
83+
menubtn = ttk.Menubutton(frame_edit_remove, text="Insert item")
8384
menu = tk.Menu(menubtn)
8485
menubtn.configure(menu=menu)
85-
menubtn.pack()
86+
menubtn.pack(fill=tk.X)
8687
ttk.Button(frame_edit_remove, text="Remove", command=w.delete_selected).pack(fill=tk.X)
8788
ttk.Button(frame_edit_remove, text="Edit", command=lambda: self._edit_selected()).pack(fill=tk.X)
8889

tkclasswiz/object_frame/frame_struct.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,14 @@ def load_template():
150150

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

154156
for (k, v) in annotations.items():
155157
# Init widgets
156158
entry_types = self.convert_types(v)
157159
frame_annotated = ttk.Frame(frame)
158-
frame_annotated.pack(fill=tk.BOTH, expand=True, pady=5)
160+
frame_annotated.pack(fill=tk.BOTH, expand=True, pady=dpi_5)
159161
ttk.Label(frame_annotated, text=k, width=label_width).pack(side="left")
160162

161163
# Storage widget with the tooltip for displaying
@@ -198,10 +200,10 @@ def _create_fields(self, annotations: dict[str, type], additional_values: dict,
198200
if not (any_filled and self.allow_save):
199201
bnt_new_menu.configure(state="disabled")
200202

201-
bnt_copy_paste.pack(side="right", padx=2)
202-
bnt_edit.pack(side="right", padx=2)
203-
bnt_new_menu.pack(side="right", padx=2)
204-
combo.pack(fill=tk.X, side="right", expand=True, padx=2)
203+
bnt_copy_paste.pack(side="right", padx=dpi_5h)
204+
bnt_edit.pack(side="right", padx=dpi_5h)
205+
bnt_new_menu.pack(side="right", padx=dpi_5h)
206+
combo.pack(fill=tk.X, side="right", expand=True, padx=dpi_5h)
205207
self._map[k] = (w, entry_types)
206208

207209
def _fill_field_values(

0 commit comments

Comments
 (0)