Skip to content

Commit

Permalink
GUI2/Text Box: set font size and style in ctor (fixes issue with pass…
Browse files Browse the repository at this point in the history
…word box)

Since the password box had its own builder, this wasn't getting called, leading to cursor offset issues.
I'm not sure this is the best place to have it, but it works for now.
  • Loading branch information
Vultraz committed Aug 25, 2017
1 parent 7b7ece8 commit ae65954
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/gui/widgets/text_box.cpp
Expand Up @@ -115,6 +115,12 @@ text_box::text_box(const implementation::builder_styled_widget& builder)
connect_signal<event::LEFT_BUTTON_DOUBLE_CLICK>(std::bind(
&text_box::signal_handler_left_button_double_click, this, _2, _3));

const auto conf = cast_config_to<text_box_definition>();
assert(conf);

set_font_size(conf->text_font_size);
set_font_style(conf->text_font_style);

update_offsets();
}

Expand Down Expand Up @@ -488,12 +494,6 @@ widget* builder_text_box::build() const

widget->set_max_input_length(max_input_length);

const auto conf = widget->cast_config_to<text_box_definition>();
assert(conf);

widget->set_font_size(conf->text_font_size);
widget->set_font_style(conf->text_font_style);

DBG_GUI_G << "Window builder: placed text box '" << id
<< "' with definition '" << definition << "'.\n";

Expand Down

0 comments on commit ae65954

Please sign in to comment.