diff --git a/src/gui.cpp b/src/gui.cpp index 17e5cbf..c4b3ea1 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -296,6 +296,7 @@ Preferences::Preferences(BaseObjectType *cobject, const Glib::RefPtrsignal_clicked().connect(sigc::mem_fun(*this, &Preferences::on_check_activate_aliases_click)); + fontbutton_font->signal_font_set().connect(sigc::mem_fun(*this, &Preferences::on_fontbutton_font_click)); spin_cell_padding->signal_value_changed().connect(sigc::mem_fun(*this, &Preferences::on_spin_cell_padding_click)); } @@ -341,6 +342,14 @@ void Preferences::on_check_activate_aliases_click() Refresh(); } +void Preferences::on_fontbutton_font_click() +{ + std::string font = fontbutton_font->get_font_name(); + cfg.FontFace = font.substr(0, font.find_last_of(' ')); + cfg.FontSize = ss_conv_to(font.substr(font.find_last_of(' ') + 1)); + g->Refresh(); +} + void Preferences::on_spin_cell_padding_click() { cfg.CellPadding = spin_cell_padding->get_value(); diff --git a/src/gui.h b/src/gui.h index c1110de..31bac85 100644 --- a/src/gui.h +++ b/src/gui.h @@ -104,6 +104,7 @@ protected: void on_check_activate_aliases_click(); + void on_fontbutton_font_click(); void on_spin_cell_padding_click(); class ModelColumns : public Gtk::TreeModel::ColumnRecord