tkintertools.style.manager¶
字数 336 个 代码 48 行 阅读时间 2 分钟 访问量
Support for theme
All third packages which relative to style introduced by tkintertools
are there:
- darkdetect: albertosottile/darkdetect
- pywinstyles: Akascape/py-window-styles
- win32material: littlewhitecloud/win32material
- hPyT: Zingzy/hPyT
🔵_callback
¶
function
protected
callback function that is triggered when a system theme is switched. Valid only if the theme mode is set to Follow System
theme
: theme name
🔵_process_event
¶
function
protected
Handle registered callback functions
dark
: Wether it is dark mode
🔵customize_window
¶
function
public
Customize the relevant properties of the window
window
: the window which being customizedstyle
: different styles for windowsborder_color
: border color of the windowheader_color
: header color of the windowtitle_color
: title color of the windowenable_file_dnd
: apply file drag and drop in windowhide_title_bar
: Wether hide the whole title barhide_button
: Wether hide part of buttons on title bardisable_minimize_button
: Wether disable minimize buttondisable_maximize_button
: Wether disable maximize buttonboarder_type
: boarder type of the window
WARNING:
This function is only works on Windows OS! And some parameters are useless on Windows 7/10!
🔵get_color_mode
¶
function
public
🔵get_theme_map
¶
function
public
🔵register_event
¶
function
public
When the system accent color changes, the registered function will be called, and the parameter is a boolean value indicating whether it is currently a dark theme
func
: callback functionargs
: extra arguments
🔵remove_event
¶
function
public
Remove a registered function
func
: callback function
🔵reset_theme_map
¶
function
public
🔵set_color_mode
¶
function
public
Set the color mode of the program
mode
: it can be"light"
,"dark"
, and"system"
TIPS:
"system"
is the following system
🔵set_theme_map
¶
function
public
Set the path to the theme file used by the current program
light
: the name of the theme of the light themedark
: the name of the theme of the dark theme
🟣SYSTEM_DARK_MODE
¶
constant
public
🟣_callback_events
¶
variable
protected
🟣_color_mode
¶
variable
protected
🟣_theme_map
¶
variable
protected