Skip to content

Commit

Permalink
tpreferences: made font scaling apply during post show not when dragg…
Browse files Browse the repository at this point in the history
…ing slider
  • Loading branch information
Vultraz committed Feb 21, 2016
1 parent ad84686 commit 4f6be87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gui/dialogs/preferences_dialog.cpp
Expand Up @@ -556,8 +556,9 @@ void tpreferences::initialize_members(twindow& window)
set_idle_anim, set_idle_anim_rate, window);

/** FONT SCALING **/
// The setter is handled in post_show to avoid dynamically changing text
tslider& scale_slider = find_widget<tslider>(&window, "scaling_slider", false);
setup_single_slider("scaling_slider", font_scaling(), set_font_scaling, window);
scale_slider.set_value(font_scaling());
bind_status_label(scale_slider, "scaling_value", window, "%");

/** SELECT THEME **/
Expand Down Expand Up @@ -1040,4 +1041,10 @@ void tpreferences::on_tab_select(twindow& window, const std::string& widget_id)
set_visible_page(window, static_cast<unsigned int>(selected_row), (widget_id + "_pager"));
}

void tpreferences::post_show(twindow& window)
{
// Handle the font scaling setter only once prefs is closed
set_font_scaling(find_widget<tslider>(&window, "scaling_slider", false).get_value());
}

} // end namespace gui2
1 change: 1 addition & 0 deletions src/gui/dialogs/preferences_dialog.hpp
Expand Up @@ -55,6 +55,7 @@ class tpreferences : public tdialog

/** Inherited from tdialog. */
void pre_show(CVideo& video, twindow& window);
void post_show(twindow& window);

/** Initializers */
void initialize_members(twindow& window);
Expand Down

0 comments on commit 4f6be87

Please sign in to comment.