OpenShot Video Editor  2.0.0
Functions | Variables
ui_util Namespace Reference

Functions

def center (window)
 Center a window on the main window. More...
 
def connect_auto_events (window, elem, name)
 Connect any events in a *.ui file with matching Python method names. More...
 
def get_default_icon (theme_name)
 Get a QIcon, and fallback to default theme if OS does not support themes. More...
 
def get_icon (theme_name)
 Get either the current theme icon or fallback to default theme (for custom icons). More...
 
def init_element (window, elem)
 Initialize language and icons of the given element. More...
 
def init_ui (window)
 Initialize all child widgets and action of a window or dialog. More...
 
def load_theme ()
 Load the current OS theme, or fallback to a default one. More...
 
def load_ui (window, path)
 Load a Qt *.ui file, and also load an XML parsed version. More...
 
def search_dir (base_path, theme_name)
 Search for theme name. More...
 
def setup_icon (window, elem, name, theme_name=None)
 Using the window xml, set the icon on the given element, or if theme_name passed load that icon. More...
 
def transfer_children (from_widget, to_widget)
 

Variables

string DEFAULT_THEME_NAME = "Humanity"
 

Function Documentation

◆ center()

def ui_util.center (   window)

Center a window on the main window.

Definition at line 245 of file ui_util.py.

◆ connect_auto_events()

def ui_util.connect_auto_events (   window,
  elem,
  name 
)

Connect any events in a *.ui file with matching Python method names.

Definition at line 201 of file ui_util.py.

◆ get_default_icon()

def ui_util.get_default_icon (   theme_name)

Get a QIcon, and fallback to default theme if OS does not support themes.

Definition at line 96 of file ui_util.py.

◆ get_icon()

def ui_util.get_icon (   theme_name)

Get either the current theme icon or fallback to default theme (for custom icons).

Returns None if none found or empty name.

Definition at line 134 of file ui_util.py.

◆ init_element()

def ui_util.init_element (   window,
  elem 
)

Initialize language and icons of the given element.

Definition at line 167 of file ui_util.py.

◆ init_ui()

def ui_util.init_ui (   window)

Initialize all child widgets and action of a window or dialog.

Definition at line 220 of file ui_util.py.

◆ load_theme()

def ui_util.load_theme ( )

Load the current OS theme, or fallback to a default one.

Definition at line 48 of file ui_util.py.

◆ load_ui()

def ui_util.load_ui (   window,
  path 
)

Load a Qt *.ui file, and also load an XML parsed version.

Definition at line 66 of file ui_util.py.

◆ search_dir()

def ui_util.search_dir (   base_path,
  theme_name 
)

Search for theme name.

Definition at line 106 of file ui_util.py.

◆ setup_icon()

def ui_util.setup_icon (   window,
  elem,
  name,
  theme_name = None 
)

Using the window xml, set the icon on the given element, or if theme_name passed load that icon.

Definition at line 149 of file ui_util.py.

◆ transfer_children()

def ui_util.transfer_children (   from_widget,
  to_widget 
)

Definition at line 253 of file ui_util.py.

Variable Documentation

◆ DEFAULT_THEME_NAME

string ui_util.DEFAULT_THEME_NAME = "Humanity"

Definition at line 43 of file ui_util.py.