mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-07 01:22:05 +00:00
GUI2/Canvas: rename set_cfg and append_cfg
This commit is contained in:
parent
8a8fe5b0a8
commit
ba5352a25a
@ -118,7 +118,7 @@ public:
|
||||
* @param cfg The config object with the data to draw.
|
||||
* @param force Whether to clear all shapes or not.
|
||||
*/
|
||||
void set_cfg(const config& cfg, const bool force = false)
|
||||
void set_shapes(const config& cfg, const bool force = false)
|
||||
{
|
||||
clear_shapes(force);
|
||||
parse_cfg(cfg);
|
||||
@ -129,7 +129,7 @@ public:
|
||||
*
|
||||
* @param cfg The config object with the data to draw.
|
||||
*/
|
||||
void append_cfg(const config& cfg)
|
||||
void append_shapes(const config& cfg)
|
||||
{
|
||||
parse_cfg(cfg);
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ void story_viewer::display_part()
|
||||
|
||||
cfg.add_child("image", get_title_area_decor_config());
|
||||
|
||||
window_canvas.set_cfg(cfg);
|
||||
window_canvas.set_shapes(cfg);
|
||||
|
||||
// Needed to make the background redraw correctly.
|
||||
window_canvas.update_size_variables();
|
||||
@ -370,7 +370,7 @@ void story_viewer::draw_floating_image(floating_image_list::const_iterator image
|
||||
image["name"] = floating_image.file();
|
||||
config cfg{"image", std::move(image)};
|
||||
|
||||
window_canvas.append_cfg(cfg);
|
||||
window_canvas.append_shapes(cfg);
|
||||
|
||||
// Needed to make the background redraw correctly.
|
||||
window_canvas.update_size_variables();
|
||||
|
@ -38,12 +38,12 @@ public:
|
||||
|
||||
void set_drawing_data(const ::config& cfg)
|
||||
{
|
||||
get_drawing_canvas().set_cfg(cfg);
|
||||
get_drawing_canvas().set_shapes(cfg);
|
||||
}
|
||||
|
||||
void append_drawing_data(const ::config& cfg)
|
||||
{
|
||||
get_drawing_canvas().append_cfg(cfg);
|
||||
get_drawing_canvas().append_shapes(cfg);
|
||||
}
|
||||
|
||||
/***** ***** ***** ***** layout functions ***** ***** ***** *****/
|
||||
|
@ -756,6 +756,7 @@ void rich_label::default_text_config(config* txt_ptr, const t_string& text) {
|
||||
void rich_label::update_canvas()
|
||||
{
|
||||
for(canvas& tmp : get_canvases()) {
|
||||
tmp.set_shapes(text_dom_, true);
|
||||
tmp.set_variable("pos_x", wfl::variant(0));
|
||||
tmp.set_variable("pos_y", wfl::variant(0));
|
||||
tmp.set_variable("img_x", wfl::variant(0));
|
||||
@ -766,7 +767,6 @@ void rich_label::update_canvas()
|
||||
tmp.set_variable("padding", wfl::variant(padding_));
|
||||
// Disable ellipsization so that text wrapping can work
|
||||
tmp.set_variable("text_wrap_mode", wfl::variant(PANGO_ELLIPSIZE_NONE));
|
||||
tmp.set_cfg(text_dom_, true);
|
||||
tmp.set_variable("text_alpha", wfl::variant(text_alpha_));
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ styled_widget::styled_widget(const implementation::builder_styled_widget& builde
|
||||
* and toggle_button have a variable canvas count determined by their definitions.
|
||||
*/
|
||||
for(unsigned i = 0; i < config_->state.size(); ++i) {
|
||||
canvases_[i].set_cfg(config_->state[i].canvas_cfg_);
|
||||
canvases_[i].set_shapes(config_->state[i].canvas_cfg_);
|
||||
}
|
||||
|
||||
// Initialize all the canvas variables.
|
||||
|
@ -382,7 +382,7 @@ static int intf_set_dialog_canvas(lua_State* L)
|
||||
}
|
||||
|
||||
config cfg = luaW_checkconfig(L, 3);
|
||||
cv[i - 1].set_cfg(cfg);
|
||||
cv[i - 1].set_shapes(cfg);
|
||||
c->queue_redraw();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user