diff --git a/src/gui/core/window_builder.cpp b/src/gui/core/window_builder.cpp index 74429ae061a5..f4513e477576 100644 --- a/src/gui/core/window_builder.cpp +++ b/src/gui/core/window_builder.cpp @@ -72,23 +72,7 @@ window* build(CVideo& video, const builder_window::window_resolution* definition { // We set the values from the definition since we can only determine the // best size (if needed) after all widgets have been placed. - window* win = new window(video, - definition->x, - definition->y, - definition->width, - definition->height, - definition->reevaluate_best_size, - definition->functions, - definition->automatic_placement, - definition->horizontal_placement, - definition->vertical_placement, - definition->maximum_width, - definition->maximum_height, - definition->definition, - definition->tooltip, - definition->helptip - ); - + window* win = new window(video, definition); assert(win); for(const auto& lg : definition->linked_groups) { diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index ba222467b5df..ef5400c50af6 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -289,21 +289,7 @@ window* manager::get_window(const unsigned id) } // namespace -window::window(CVideo& video, - typed_formula x, - typed_formula y, - typed_formula w, - typed_formula h, - typed_formula reevaluate_best_size, - const wfl::function_symbol_table& functions, - const bool automatic_placement, - const unsigned horizontal_placement, - const unsigned vertical_placement, - const unsigned maximum_width, - const unsigned maximum_height, - const std::string& definition, - const builder_window::window_resolution::tooltip_info& tooltip, - const builder_window::window_resolution::tooltip_info& helptip) +window::window(CVideo& video, const builder_window::window_resolution* definition) : panel(implementation::builder_window(::config {"definition", definition->definition}), get_control_type()) , cursor::setter(cursor::NORMAL) , video_(video) @@ -318,19 +304,19 @@ window::window(CVideo& video, , restore_(true) , is_toplevel_(!is_in_dialog()) , restorer_() - , automatic_placement_(automatic_placement) - , horizontal_placement_(horizontal_placement) - , vertical_placement_(vertical_placement) - , maximum_width_(maximum_width) - , maximum_height_(maximum_height) - , x_(x) - , y_(y) - , w_(w) - , h_(h) - , reevaluate_best_size_(reevaluate_best_size) - , functions_(functions) - , tooltip_(tooltip) - , helptip_(helptip) + , automatic_placement_(definition->automatic_placement) + , horizontal_placement_(definition->horizontal_placement) + , vertical_placement_(definition->vertical_placement) + , maximum_width_(definition->maximum_width) + , maximum_height_(definition->maximum_height) + , x_(definition->x) + , y_(definition->y) + , w_(definition->width) + , h_(definition->height) + , reevaluate_best_size_(definition->reevaluate_best_size) + , functions_(definition->functions) + , tooltip_(definition->tooltip) + , helptip_(definition->helptip) , click_dismiss_(false) , enter_disabled_(false) , escape_disabled_(false) diff --git a/src/gui/widgets/window.hpp b/src/gui/widgets/window.hpp index 1b56025ac988..55b57df484d7 100644 --- a/src/gui/widgets/window.hpp +++ b/src/gui/widgets/window.hpp @@ -68,21 +68,7 @@ class window : public panel, public cursor::setter friend class pane; public: - window(CVideo& video, - typed_formula x, - typed_formula y, - typed_formula w, - typed_formula h, - typed_formula reevaluate_best_size, - const wfl::function_symbol_table& functions, - const bool automatic_placement, - const unsigned horizontal_placement, - const unsigned vertical_placement, - const unsigned maximum_width, - const unsigned maximum_height, - const std::string& definition, - const builder_window::window_resolution::tooltip_info& tooltip, - const builder_window::window_resolution::tooltip_info& helptip); + window(CVideo& video, const builder_window::window_resolution* definition); ~window(); @@ -151,7 +137,7 @@ class window : public panel, public cursor::setter * @param auto_close_timeout The time in ms after which the window will * automatically close, if 0 it doesn't close. * @note the timeout is a minimum time and - * there's no quarantee about how fast it closes + * there's no guarantee about how fast it closes * after the minimum. * * @returns The close code of the window, predefined