From 969c520ef04bf4c31a46f271002181d7ac0d4edf Mon Sep 17 00:00:00 2001 From: petern Date: Sun, 29 Nov 2009 08:52:20 +0000 Subject: [PATCH] Respond to font button selection git-svn-id: file:///home/vcs/svn/jsweeper/trunk@15 6611ac79-6612-48ef-a1e9-b906f853523e --- src/gui.cpp | 9 +++++++++ src/gui.h | 1 + 2 files changed, 10 insertions(+) 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