![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "stage/workspace/ui-style.hpp"
Manage global concerns regarding a coherent user interface.
Offers access to some global UI resources, and establishes further global services to create workspace windows, to bind menu / command actions and to enter the top-level model parts.
Definition at line 63 of file ui-style.hpp.
Static Public Attributes | |
| static Gtk::IconSize | GiantIconSize = Gtk::ICON_SIZE_INVALID |
| The registered icon size for giant 48x48 px icons. | |
| static Gtk::IconSize | MenuIconSize = Gtk::ICON_SIZE_INVALID |
| The registered icon size for giant 16x16 px icons. | |
Static Public Member Functions | |
| static Cairo::RefPtr< Cairo::SolidPattern > | readStyleColourProperty (Gtk::Widget &widget, const gchar *property_name, guint16 red, guint16 green, guint16 blue) |
| A utility function which reads a colour style from the GTK Style. | |
Public Member Functions | |
| UiStyle () | |
| Set up a coherent theming and styling for the application. | |
| void | setTheme (string const &stylesheetName) |
| Sets the theme to use for the Lumiera GUI. | |
| void | prepareStyleContext (timeline::TimelineWidget const &) |
| Use the existing TimelineWidget's GTK-WidgetPath to establish a systematic CSS styling context, which can be used for theming and styling of Lumiera's custom UI elements within the timeline display. | |
Private Member Functions | |
| void | registerAppIconSizes () |
| void | registerStockItems () |
| Registers application stock items: icons and labels associated with IDs. | |
| bool | addStockIconSet (Glib::RefPtr< Gtk::IconFactory > const &factory, Literal iconName, Literal id, Literal label) |
| Adds an icon (in different sizes) to the icon factory. | |
| bool | addStockIcon (Glib::RefPtr< Gtk::IconSet > const &icon_set, cuString &icon_name, Gtk::IconSize size, bool wildcard) |
| Loads an icon, searching standard icon locations, and adds it to an icon set. | |
| bool | addThemeIconSource (Glib::RefPtr< Gtk::IconSet > const &icon_set, cuString &icon_name, Gtk::IconSize size, bool wildcard) |
| Loads an icon from a the icon theme. | |
| bool | addNonThemeIconSource (Glib::RefPtr< Gtk::IconSet > const &icon_set, cuString &base_dir, cuString &icon_name, Gtk::IconSize size, bool wildcard) |
| Loads an icon from a non theme set. | |
| bool | addStockIconFromPath (string path, Glib::RefPtr< Gtk::IconSet > const &icon_set, Gtk::IconSize size, bool wildcard) |
| Loads an icon from a specific path and adds it to an icon set. | |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
| string | iconSearchPath_ |
| string | resourceSerachPath_ |
| StyleAdvice | styleAdviceTrackBody_ |
| StyleAdvice | styleAdviceTrackRuler_ |
| UiStyle | ( | ) |
Set up a coherent theming and styling for the application.
Based on the Gtk::UIManager, the UiStyle service allows to access some style related resources, but mostly its task is to configure the GTK toolkit appropriately during startup.
Initialise the theme and style related global properties of the UI. Register the icon configuration and sizes and lookup all standard icons – either from the default theme of via the given Lumiera icon search paths, typically from setup.ini.
Definition at line 57 of file ui-style.cpp.
References Config::get(), stage::KEY_STYLESHEET, stage::KEY_TITLE, UiStyle::registerAppIconSizes(), UiStyle::registerStockItems(), and UiStyle::setTheme().
Here is the call graph for this function:| void setTheme | ( | string const & | stylesheetName | ) |
Sets the theme to use for the Lumiera GUI.
| stylesheetName | GTK CSS stylesheet to load from the resourceSearchPath_ |
| error::Config | if this stylesheet can't be resolved on the searchpath |
Definition at line 75 of file ui-style.cpp.
References cStr(), lib::resolveModulePath(), and UiStyle::resourceSerachPath_.
Referenced by UiStyle::UiStyle().
Here is the call graph for this function:
Here is the caller graph for this function:| void prepareStyleContext | ( | timeline::TimelineWidget const & | timeline | ) |
Use the existing TimelineWidget's GTK-WidgetPath to establish a systematic CSS styling context, which can be used for theming and styling of Lumiera's custom UI elements within the timeline display.
Especially, this allows us to anchor those custom elements at a dedicated point in the hierarchy, the way it is visible for CSS selectors. Thus, either standard CSS rules and inheritance take effect on our custom elements, or the GTK stylesheet may add dedicated style rules for elements within the timeline display, most notably the system of nested scopes in the track fork and the display of clips and overlays.
Especially the following selector path can be used
paned.timeline__page > timeline__body > fork.timeline__forklumiera.css)gtk_widget_path_append_for_widget() in in GTK 3.x, gtkwidget.c, line 16413 Definition at line 115 of file ui-style.cpp.
References stage::CLASS_timeline_fork, stage::CLASS_timeline_ruler, TimelineWidget::getBodyWidgetPath(), Provision< AD >::isGiven(), stage::NODE_fork, stage::NODE_frame, Provision< AD >::setAdvice(), UiStyle::styleAdviceTrackBody_, and UiStyle::styleAdviceTrackRuler_.
Here is the call graph for this function:
|
static |
A utility function which reads a colour style from the GTK Style.
| widget | The widget to load the style out of. |
| property_name | The name of the style property to load. |
| red | The fallback red intensity. |
| green | The fallback green intensity. |
| blue | The fallback blue intensity. |
Definition at line 147 of file ui-style.cpp.
References NULL.
|
private |
Definition at line 178 of file ui-style.cpp.
References UiStyle::GiantIconSize, and UiStyle::MenuIconSize.
Referenced by UiStyle::UiStyle().
Here is the caller graph for this function:
|
private |
Registers application stock items: icons and labels associated with IDs.
Definition at line 192 of file ui-style.cpp.
References _, UiStyle::addStockIconSet(), stage::ICON_arrow_hand_down, stage::ICON_arrow_hand_menu, stage::ICON_arrow_hand_up, and stage::ICON_placement.
Referenced by UiStyle::UiStyle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Adds an icon (in different sizes) to the icon factory.
| factory | The factory to add the icon to. |
| icon_name | The file name of the icon to add. |
| id | The id name of the icon. |
| label | The user readable icon name for this icon. |
true if the icon was successfully loaded, returns false otherwise. Definition at line 223 of file ui-style.cpp.
References UiStyle::addStockIcon(), UiStyle::GiantIconSize, and UiStyle::MenuIconSize.
Referenced by UiStyle::registerStockItems().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Loads an icon, searching standard icon locations, and adds it to an icon set.
| icon_set | The icon set to add the icon to. |
| icon_name | The file name of the icon to load. |
| size | The size of the icon to load. |
| wildcard | true if this icon is to be wildcarded. |
true if the icon was loaded successfully. Definition at line 256 of file ui-style.cpp.
References UiStyle::addNonThemeIconSource(), UiStyle::addThemeIconSource(), and UiStyle::iconSearchPath_.
Referenced by UiStyle::addStockIconSet().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Loads an icon from a the icon theme.
| icon_set | The icon set to add the icon to. |
| icon_name | The name of the icon to load. |
| size | The size of the icon to load. |
| wildcard | true if this icon is to be wildcarded. |
true if the icon was loaded successfully. Definition at line 280 of file ui-style.cpp.
References UiStyle::addStockIconFromPath().
Referenced by UiStyle::addStockIcon().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Loads an icon from a non theme set.
| icon_set | The icon set to add the icon to. |
| base_dir | The root icons directory to load from. |
| icon_name | The file name of the icon to load. |
| size | The size of the icon to load. |
| wildcard | true if this icon is to be wildcarded. |
true if the icon was loaded successfully. Definition at line 306 of file ui-style.cpp.
References UiStyle::addStockIconFromPath().
Referenced by UiStyle::addStockIcon().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Loads an icon from a specific path and adds it to an icon set.
| path | The path to load from. |
| icon_set | The icon set to add the icon to. |
| size | The size of the icon to load. |
| wildcard | true if this icon is to be wildcarded. |
true if the icon was loaded successfully. Definition at line 326 of file ui-style.cpp.
References cStr().
Referenced by UiStyle::addNonThemeIconSource(), and UiStyle::addThemeIconSource().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 68 of file ui-style.hpp.
Referenced by UiStyle::addStockIcon().
|
private |
Definition at line 69 of file ui-style.hpp.
Referenced by UiStyle::setTheme().
|
private |
Definition at line 71 of file ui-style.hpp.
Referenced by UiStyle::prepareStyleContext().
|
private |
Definition at line 72 of file ui-style.hpp.
Referenced by UiStyle::prepareStyleContext().
|
static |
The registered icon size for giant 48x48 px icons.
Definition at line 80 of file ui-style.hpp.
Referenced by UiStyle::addStockIconSet(), and UiStyle::registerAppIconSizes().
|
static |
The registered icon size for giant 16x16 px icons.
Definition at line 86 of file ui-style.hpp.
Referenced by UiStyle::addStockIconSet(), and UiStyle::registerAppIconSizes().
Inheritance diagram for UiStyle:
Collaboration diagram for UiStyle: