Base class of a resolution, contains the common keys for a resolution. More...
#include <widget_definition.hpp>
Public Member Functions | |
resolution_definition (const config &cfg) | |
Public Attributes | |
unsigned | window_width |
unsigned | window_height |
unsigned | min_width |
unsigned | min_height |
unsigned | default_width |
unsigned | default_height |
unsigned | max_width |
unsigned | max_height |
std::vector< linked_group_definition > | linked_groups |
unsigned | text_extra_width |
unsigned | text_extra_height |
typed_formula< unsigned > | text_font_size |
font::family_class | text_font_family |
font::pango_text::FONT_STYLE | text_font_style |
std::vector< state_definition > | state |
Base class of a resolution, contains the common keys for a resolution.
Depending on the resolution a widget can look different. Resolutions are evaluated in order of appearance. The window_width and window_height are the upper limit this resolution is valid for. When one of the sizes gets above the limit, the next resolution is selected. There's one special case where both values are 0. This resolution always matches. (Resolution definitions behind that one will never be picked.) This resolution can be used as upper limit or if there's only one resolution.
The default (and also minimum) size of a button is determined by two items, the wanted default size and the size needed for the text. The size of the text differs per used widget so needs to be determined per button.
Container widgets like panels and windows have other rules for their sizes. Their sizes are based on the size of their children (and the border they need themselves). It's wise to set all sizes to 0 for these kind of widgets.
Key | Type | Default | Description |
---|---|---|---|
window_width | unsigned | 0 | Width of the application window. |
window_height | unsigned | 0 | Height of the application window. |
min_width | unsigned | 0 | The minimum width of the widget. |
min_height | unsigned | 0 | The minimum height of the widget. |
default_width | unsigned | 0 | The default width of the widget. |
default_height | unsigned | 0 | The default height of the widget. |
max_width | unsigned | 0 | TThe maximum width of the widget. |
max_height | unsigned | 0 | The maximum height of the widget. |
text_extra_width | unsigned | 0 | The extra width needed to determine the minimal size for the text. |
text_extra_height | unsigned | 0 | The extra height needed to determine the minimal size for the text. |
text_font_family | font_family | "" | The font family, needed to determine the minimal size for the text. |
text_font_size | unsigned | 0 | The font size, which needs to be used to determine the minimal size for the text. |
text_font_style | font_style | "" | The font style, which needs to be used to determine the minimal size for the text. |
state | section | mandatory | Every widget has one or more state sections. Note they aren't called state but state_xxx the exact names are listed per widget. |
Definition at line 77 of file widget_definition.hpp.
|
explicit |
Definition at line 32 of file widget_definition.cpp.
References DBG_GUI_P, linked_groups, gui2::parse_linked_group_definitions(), window_height, and window_width.
unsigned gui2::resolution_definition::default_height |
Definition at line 88 of file widget_definition.hpp.
unsigned gui2::resolution_definition::default_width |
Definition at line 87 of file widget_definition.hpp.
std::vector<linked_group_definition> gui2::resolution_definition::linked_groups |
Definition at line 93 of file widget_definition.hpp.
Referenced by resolution_definition().
unsigned gui2::resolution_definition::max_height |
Definition at line 91 of file widget_definition.hpp.
unsigned gui2::resolution_definition::max_width |
Definition at line 90 of file widget_definition.hpp.
unsigned gui2::resolution_definition::min_height |
Definition at line 85 of file widget_definition.hpp.
unsigned gui2::resolution_definition::min_width |
Definition at line 84 of file widget_definition.hpp.
std::vector<state_definition> gui2::resolution_definition::state |
Definition at line 102 of file widget_definition.hpp.
Referenced by gui2::addon_list_definition::resolution::resolution(), gui2::button_definition::resolution::resolution(), gui2::chatbox_definition::resolution::resolution(), gui2::drawing_definition::resolution::resolution(), gui2::horizontal_scrollbar_definition::resolution::resolution(), gui2::image_definition::resolution::resolution(), gui2::label_definition::resolution::resolution(), gui2::listbox_definition::resolution::resolution(), gui2::matrix_definition::resolution::resolution(), gui2::menu_button_definition::resolution::resolution(), gui2::minimap_definition::resolution::resolution(), gui2::multimenu_button_definition::resolution::resolution(), gui2::panel_definition::resolution::resolution(), gui2::progress_bar_definition::resolution::resolution(), gui2::repeating_button_definition::resolution::resolution(), gui2::scroll_label_definition::resolution::resolution(), gui2::scrollbar_panel_definition::resolution::resolution(), gui2::size_lock_definition::resolution::resolution(), gui2::slider_definition::resolution::resolution(), gui2::stacked_widget_definition::resolution::resolution(), gui2::text_box_definition::resolution::resolution(), gui2::toggle_button_definition::resolution::resolution(), gui2::toggle_panel_definition::resolution::resolution(), gui2::tree_view_definition::resolution::resolution(), gui2::unit_preview_pane_definition::resolution::resolution(), and gui2::vertical_scrollbar_definition::resolution::resolution().
unsigned gui2::resolution_definition::text_extra_height |
Definition at line 96 of file widget_definition.hpp.
unsigned gui2::resolution_definition::text_extra_width |
Definition at line 95 of file widget_definition.hpp.
font::family_class gui2::resolution_definition::text_font_family |
Definition at line 99 of file widget_definition.hpp.
typed_formula<unsigned> gui2::resolution_definition::text_font_size |
Definition at line 97 of file widget_definition.hpp.
font::pango_text::FONT_STYLE gui2::resolution_definition::text_font_style |
Definition at line 100 of file widget_definition.hpp.
unsigned gui2::resolution_definition::window_height |
Definition at line 82 of file widget_definition.hpp.
Referenced by resolution_definition().
unsigned gui2::resolution_definition::window_width |
Definition at line 81 of file widget_definition.hpp.
Referenced by resolution_definition().