removed default geometry call from CTk, fixed CTkInputDialog

This commit is contained in:
Tom Schimansky 2022-11-29 13:04:51 +01:00
parent 1db775a6f6
commit 1254a39161
4 changed files with 12 additions and 9 deletions

View File

@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
ToDo: ToDo:
- finish string dialog
- change font attribute in wiki - change font attribute in wiki
- add new button attributes to wiki - add new button attributes to wiki

View File

@ -28,14 +28,14 @@ class CTkInputDialog(CTkToplevel):
super().__init__(fg_color=fg_color) super().__init__(fg_color=fg_color)
self._fg_color = ThemeManager.theme["color"]["window"] if fg_color is None else self._check_color_type(fg_color) self._fg_color = ThemeManager.theme["CTkToplevel"]["fg_color"] if fg_color is None else self._check_color_type(fg_color)
self._text_color = ThemeManager.theme["color"]["text"] if text_color is None else self._check_color_type(button_hover_color) self._text_color = ThemeManager.theme["CTkLabel"]["text_color"] if text_color is None else self._check_color_type(button_hover_color)
self._button_fg_color = ThemeManager.theme["color"]["button"] if button_fg_color is None else self._check_color_type(button_fg_color) self._button_fg_color = ThemeManager.theme["CTkButton"]["fg_color"] if button_fg_color is None else self._check_color_type(button_fg_color)
self._button_hover_color = ThemeManager.theme["color"]["button_hover"] if button_hover_color is None else self._check_color_type(button_hover_color) self._button_hover_color = ThemeManager.theme["CTkButton"]["hover_color"] if button_hover_color is None else self._check_color_type(button_hover_color)
self._button_text_color = ThemeManager.theme["color"]["text"] if button_text_color is None else self._check_color_type(button_text_color) self._button_text_color = ThemeManager.theme["CTkButton"]["text_color"] if button_text_color is None else self._check_color_type(button_text_color)
self._entry_fg_color = ThemeManager.theme["color"]["entry"] if entry_fg_color is None else self._check_color_type(entry_fg_color) self._entry_fg_color = ThemeManager.theme["CTkEntry"]["fg_color"] if entry_fg_color is None else self._check_color_type(entry_fg_color)
self._entry_border_color = ThemeManager.theme["color"]["entry_border"] if entry_border_color is None else self._check_color_type(entry_border_color) self._entry_border_color = ThemeManager.theme["CTkEntry"]["border_color"] if entry_border_color is None else self._check_color_type(entry_border_color)
self._entry_text_color = ThemeManager.theme["color"]["text"] if entry_text_color is None else self._check_color_type(entry_text_color) self._entry_text_color = ThemeManager.theme["CTkEntry"]["text_color"] if entry_text_color is None else self._check_color_type(entry_text_color)
self._user_input: Union[str, None] = None self._user_input: Union[str, None] = None
self._running: bool = False self._running: bool = False

View File

@ -55,7 +55,7 @@ class CTk(tkinter.Tk, CTkAppearanceModeBaseClass, CTkScalingBaseClass):
# set title and initial geometry # set title and initial geometry
self.title("CTk") self.title("CTk")
self.geometry(f"{self._current_width}x{self._current_height}") # self.geometry(f"{self._current_width}x{self._current_height}")
self._state_before_windows_set_titlebar_color = None self._state_before_windows_set_titlebar_color = None
self._window_exists = False # indicates if the window is already shown through update() or mainloop() after init self._window_exists = False # indicates if the window is already shown through update() or mainloop() after init

View File

@ -2,6 +2,8 @@ import customtkinter
customtkinter.set_appearance_mode("dark") customtkinter.set_appearance_mode("dark")
customtkinter.set_default_color_theme("blue") customtkinter.set_default_color_theme("blue")
customtkinter.set_window_scaling(0.8)
customtkinter.set_widget_scaling(0.8)
app = customtkinter.CTk() app = customtkinter.CTk()
app.geometry("400x300") app.geometry("400x300")