The Battle for Wesnoth  1.15.10+dev
Public Member Functions | Public Attributes | List of all members
gui2::resolution_definition Struct Reference

Base class of a resolution, contains the common keys for a resolution. More...

#include <widget_definition.hpp>

Inheritance diagram for gui2::resolution_definition:

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_definitionlinked_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_definitionstate
 

Detailed Description

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 unsigned0 Width of the application window.
window_height unsigned0 Height of the application window.
min_width unsigned0 The minimum width of the widget.
min_height unsigned0 The minimum height of the widget.
default_width unsigned0 The default width of the widget.
default_height unsigned0 The default height of the widget.
max_width unsigned0 TThe maximum width of the widget.
max_height unsigned0 The maximum height of the widget.
text_extra_width unsigned0 The extra width needed to determine the minimal size for the text.
text_extra_heightunsigned0 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 unsigned0 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 mandatoryEvery 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 76 of file widget_definition.hpp.

Constructor & Destructor Documentation

◆ resolution_definition()

gui2::resolution_definition::resolution_definition ( const config cfg)
explicit

Member Data Documentation

◆ default_height

unsigned gui2::resolution_definition::default_height

Definition at line 87 of file widget_definition.hpp.

◆ default_width

unsigned gui2::resolution_definition::default_width

Definition at line 86 of file widget_definition.hpp.

◆ linked_groups

std::vector<linked_group_definition> gui2::resolution_definition::linked_groups

Definition at line 92 of file widget_definition.hpp.

Referenced by resolution_definition().

◆ max_height

unsigned gui2::resolution_definition::max_height

Definition at line 90 of file widget_definition.hpp.

◆ max_width

unsigned gui2::resolution_definition::max_width

Definition at line 89 of file widget_definition.hpp.

◆ min_height

unsigned gui2::resolution_definition::min_height

Definition at line 84 of file widget_definition.hpp.

◆ min_width

unsigned gui2::resolution_definition::min_width

Definition at line 83 of file widget_definition.hpp.

◆ state

std::vector<state_definition> gui2::resolution_definition::state

Definition at line 101 of file widget_definition.hpp.

Referenced by gui2::scrollbar_panel_definition::resolution::resolution(), gui2::progress_bar_definition::resolution::resolution(), gui2::vertical_scrollbar_definition::resolution::resolution(), gui2::horizontal_scrollbar_definition::resolution::resolution(), gui2::panel_definition::resolution::resolution(), gui2::size_lock_definition::resolution::resolution(), gui2::minimap_definition::resolution::resolution(), gui2::image_definition::resolution::resolution(), gui2::unit_preview_pane_definition::resolution::resolution(), gui2::button_definition::resolution::resolution(), gui2::drawing_definition::resolution::resolution(), gui2::repeating_button_definition::resolution::resolution(), gui2::scroll_label_definition::resolution::resolution(), gui2::menu_button_definition::resolution::resolution(), gui2::toggle_button_definition::resolution::resolution(), gui2::stacked_widget_definition::resolution::resolution(), gui2::addon_list_definition::resolution::resolution(), gui2::tree_view_definition::resolution::resolution(), gui2::toggle_panel_definition::resolution::resolution(), gui2::multimenu_button_definition::resolution::resolution(), gui2::label_definition::resolution::resolution(), gui2::matrix_definition::resolution::resolution(), gui2::slider_definition::resolution::resolution(), gui2::chatbox_definition::resolution::resolution(), gui2::text_box_definition::resolution::resolution(), and gui2::listbox_definition::resolution::resolution().

◆ text_extra_height

unsigned gui2::resolution_definition::text_extra_height

Definition at line 95 of file widget_definition.hpp.

◆ text_extra_width

unsigned gui2::resolution_definition::text_extra_width

Definition at line 94 of file widget_definition.hpp.

◆ text_font_family

font::family_class gui2::resolution_definition::text_font_family

Definition at line 98 of file widget_definition.hpp.

◆ text_font_size

typed_formula<unsigned> gui2::resolution_definition::text_font_size

Definition at line 96 of file widget_definition.hpp.

◆ text_font_style

font::pango_text::FONT_STYLE gui2::resolution_definition::text_font_style

Definition at line 99 of file widget_definition.hpp.

◆ window_height

unsigned gui2::resolution_definition::window_height

Definition at line 81 of file widget_definition.hpp.

Referenced by resolution_definition().

◆ window_width

unsigned gui2::resolution_definition::window_width

Definition at line 80 of file widget_definition.hpp.

Referenced by resolution_definition().


The documentation for this struct was generated from the following files: