From 94ba79f0006969bce39d02ff2ba1215947263bca Mon Sep 17 00:00:00 2001 From: JucaBlues Date: Fri, 1 Aug 2008 07:23:57 +0000 Subject: [PATCH] adding tabs to SVGFonts dialog --- src/ui/dialog/svg-fonts-dialog.cpp | 67 ++++++++++++++++++++---------- src/ui/dialog/svg-fonts-dialog.h | 4 ++ 2 files changed, 50 insertions(+), 21 deletions(-) diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 22d039986..ac9556e14 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -15,6 +15,7 @@ #ifdef ENABLE_SVG_FONTS +#include #include "svg-fonts-dialog.h" #include #include @@ -173,35 +174,31 @@ SPFont* SvgFontsDialog::get_selected_spfont() return NULL; } -SvgFontsDialog::SvgFontsDialog() - : UI::Widget::Panel("", "dialogs.svgfonts", SP_VERB_DIALOG_SVG_FONTS) -{ - Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox()); - hbox->add(_font_list); - hbox->add(_font_settings); - _getContents()->add(*hbox); - -//List of SVGFonts declared in a document: - _model = Gtk::ListStore::create(_columns); - _font_list.set_model(_model); - _font_list.append_column_editable(_("_Font"), _columns.label); - _font_list.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_font_selection_changed)); - - this->update_fonts(); - -//kerning setup: - Gtk::VBox* kernvbox = Gtk::manage(new Gtk::VBox()); - _font_settings.add(*kernvbox); +Gtk::VBox* SvgFontsDialog::global_settings_tab(){ + Gtk::VBox* global_vbox = Gtk::manage(new Gtk::VBox()); //Set Width (horiz_adv_x): Gtk::HBox* setwidth_hbox = Gtk::manage(new Gtk::HBox()); - setwidth_hbox->add(*Gtk::manage(new Gtk::Label(_("Set width (not working yet):")))); + setwidth_hbox->add(*Gtk::manage(new Gtk::Label(_("Set width:")))); setwidth_hbox->add(setwidth_spin); setwidth_spin.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_setwidth_changed)); setwidth_spin.set_range(0, 4096); setwidth_spin.set_increments(10, 100); - _font_settings.add(*setwidth_hbox); + global_vbox->add(*setwidth_hbox); + + return global_vbox; +} + +Gtk::VBox* SvgFontsDialog::glyphs_tab(){ + Gtk::VBox* glyphs_vbox = Gtk::manage(new Gtk::VBox()); + return glyphs_vbox; +} + +Gtk::VBox* SvgFontsDialog::kerning_tab(){ + +//kerning setup: + Gtk::VBox* kernvbox = Gtk::manage(new Gtk::VBox()); //Kerning Setup: kernvbox->add(*Gtk::manage(new Gtk::Label(_("Kerning Setup:")))); @@ -225,6 +222,34 @@ SvgFontsDialog::SvgFontsDialog() kerning_preview.set_size(300 + 20, 150 + 20); _font_da.set_size(150 + 20, 50 + 20); + return kernvbox; +} + +SvgFontsDialog::SvgFontsDialog() + : UI::Widget::Panel("", "dialogs.svgfonts", SP_VERB_DIALOG_SVG_FONTS) +{ + Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox()); + hbox->add(_font_list); + hbox->add(_font_settings); + _getContents()->add(*hbox); + +//List of SVGFonts declared in a document: + _model = Gtk::ListStore::create(_columns); + _font_list.set_model(_model); + _font_list.append_column_editable(_("_Font"), _columns.label); + _font_list.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_font_selection_changed)); + + this->update_fonts(); + + Gtk::Notebook *tabs = Gtk::manage(new Gtk::Notebook()); + tabs->set_scrollable(); + + tabs->append_page(*global_settings_tab(), _("_Global Settings"), true); + tabs->append_page(*glyphs_tab(), _("_Glyphs"), true); + tabs->append_page(*kerning_tab(), _("_Kerning"), true); + + _font_settings.add(*tabs); + //Text Preview: _preview_entry.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_preview_text_changed)); _getContents()->add((Gtk::Widget&) _font_da); diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h index bc32bfebf..7bbe17f56 100644 --- a/src/ui/dialog/svg-fonts-dialog.h +++ b/src/ui/dialog/svg-fonts-dialog.h @@ -71,6 +71,10 @@ public: void on_setwidth_changed(); private: + Gtk::VBox* global_settings_tab(); + Gtk::VBox* kerning_tab(); + Gtk::VBox* glyphs_tab(); + class Columns : public Gtk::TreeModel::ColumnRecord { public: -- 2.30.2