mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
decreased border with and padding for tkinter.Label in CTkButton, CTkLabek, CTkOptionMenu
This commit is contained in:
@ -166,6 +166,9 @@ class CTkButton(CTkBaseClass):
|
||||
self._text_label = tkinter.Label(master=self,
|
||||
font=self._apply_font_scaling(self._font),
|
||||
text=self._text,
|
||||
padx=0,
|
||||
pady=0,
|
||||
borderwidth=1,
|
||||
textvariable=self._textvariable)
|
||||
|
||||
self._text_label.bind("<Enter>", self._on_enter)
|
||||
|
@ -62,11 +62,13 @@ class CTkLabel(CTkBaseClass):
|
||||
|
||||
self._text_label = tkinter.Label(master=self,
|
||||
highlightthickness=0,
|
||||
bd=0,
|
||||
padx=0,
|
||||
pady=0,
|
||||
borderwidth=1,
|
||||
anchor=self._anchor,
|
||||
text=self._text,
|
||||
font=self._apply_font_scaling(self._font),
|
||||
**pop_from_dict_by_set(kwargs, self._valid_tk_label_attributes))
|
||||
font=self._apply_font_scaling(self._font))
|
||||
self._text_label.configure(**pop_from_dict_by_set(kwargs, self._valid_tk_label_attributes))
|
||||
|
||||
text_label_grid_sticky = self._anchor if self._anchor != "center" else ""
|
||||
self._text_label.grid(row=0, column=0, sticky=text_label_grid_sticky,
|
||||
|
@ -101,6 +101,9 @@ class CTkOptionMenu(CTkBaseClass):
|
||||
self._text_label = tkinter.Label(master=self,
|
||||
font=self._apply_font_scaling(self._font),
|
||||
anchor="w",
|
||||
padx=0,
|
||||
pady=0,
|
||||
borderwidth=1,
|
||||
text=self._current_value)
|
||||
self._text_label.grid(row=0, column=0, sticky="w",
|
||||
padx=(max(self._apply_widget_scaling(self._corner_radius), self._apply_widget_scaling(3)),
|
||||
|
@ -241,7 +241,6 @@ class CTkBaseClass(tkinter.Frame):
|
||||
raise ValueError(f"'{attribute_name}' is not a supported argument. Look at the documentation for supported arguments.")
|
||||
|
||||
def _update_dimensions_event(self, event):
|
||||
print(event)
|
||||
# only redraw if dimensions changed (for performance), independent of scaling
|
||||
if round(self._current_width) != round(event.width / self._widget_scaling) or round(self._current_height) != round(event.height / self._widget_scaling):
|
||||
self._current_width = (event.width / self._widget_scaling) # adjust current size according to new size given by event
|
||||
|
@ -180,7 +180,7 @@ class CTk(tkinter.Tk):
|
||||
self._current_width = max(self._min_width, min(width, self._max_width)) # bound value between min and max
|
||||
self._current_height = max(self._min_height, min(height, self._max_height))
|
||||
else:
|
||||
return self.reverse_geometry_scaling(super().geometry())
|
||||
return self._reverse_geometry_scaling(super().geometry())
|
||||
|
||||
@staticmethod
|
||||
def _parse_geometry_string(geometry_string: str) -> tuple:
|
||||
|
Reference in New Issue
Block a user