Package dtk :: Package ui :: Module theme :: Class Theme

Class Theme

source code


Theme.

Instance Methods
 
__init__(self, system_theme_dir, user_theme_dir)
Initialize Theme class.
source code
 
load_theme(self)
Load theme.
source code
 
get_theme_file_path(self, filename)
Get theme file path with given theme name.
source code
 
get_pixbuf(self, path)
Get pixbuf with given relative path.
source code
 
get_color(self, color_name)
Get color with given dynmaic color.
source code
 
get_alpha_color(self, color_name)
Get color with given dynmaic alpha color.
source code
 
get_shadow_color(self, color_name)
Get color with given dynmaic shadow color.
source code
 
change_theme(self, new_theme_name)
Change theme with given new theme name.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, system_theme_dir, user_theme_dir)
(Constructor)

source code 

Initialize Theme class.

Parameters:
  • system_theme_dir - Default theme directory.
  • user_theme_dir - User's theme save directory, generic is ~/.config/project-name/theme
Overrides: object.__init__

get_theme_file_path(self, filename)

source code 

Get theme file path with given theme name.

Returns:
Return filepath of theme.

get_pixbuf(self, path)

source code 

Get pixbuf with given relative path.

Parameters:
  • path - Image relative filepath to theme.
Returns:
Return pixbuf with given relative path.

get_color(self, color_name)

source code 

Get color with given dynmaic color.

Parameters:
  • color_name - DynamicColor name from theme.txt.
Returns:
Return color with given dynamic color.

get_alpha_color(self, color_name)

source code 

Get color with given dynmaic alpha color.

Parameters:
  • color_name - DynamicAlphaColor name from theme.txt.
Returns:
Return color with given dynamic alpha color.

get_shadow_color(self, color_name)

source code 

Get color with given dynmaic shadow color.

Parameters:
  • color_name - DynamicShadowColor name from theme.txt.
Returns:
Return color with given dynamic shadow color.

change_theme(self, new_theme_name)

source code 

Change theme with given new theme name.

Parameters:
  • new_theme_name - New theme name.