summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2018-04-25 14:29:08 +0000
committerTavmjong Bah <tavmjong@free.fr>2018-04-25 14:29:08 +0000
commitc259adc37c0b0df32a28d70e51d7fde0968b4cdc (patch)
tree275c61d132acae5b1d90f45f2e7a6c38159aeebb /src/ui/dialog
parentfix bug on compile (diff)
downloadinkscape-c259adc37c0b0df32a28d70e51d7fde0968b4cdc.tar.gz
inkscape-c259adc37c0b0df32a28d70e51d7fde0968b4cdc.zip
Implement FontSelectorToolbar.
A version of FontSelector designed for the text toolbar. This is meant as a replacement for Ink_ComboBoxEntry_Action. It is not ready for use. Also includes some code cleanup.
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/glyphs.cpp11
-rw-r--r--src/ui/dialog/text-edit.cpp8
2 files changed, 8 insertions, 11 deletions
diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp
index 07973b4c0..0a62fd8c1 100644
--- a/src/ui/dialog/glyphs.cpp
+++ b/src/ui/dialog/glyphs.cpp
@@ -336,9 +336,9 @@ GlyphsPanel::GlyphsPanel() :
{
fontSelector = new Inkscape::UI::Widget::FontSelector (false);
- fontSelector->set_fontsize_visible (false);
- fontSelector->set_size (12.0);
fontSelector->set_name ("Glyphs");
+ fontSelector->set_fontsize_visible (false);
+ fontSelector->update_size (12.0);
sigc::connection conn =
fontSelector->connectChanged(sigc::hide(sigc::mem_fun(*this, &GlyphsPanel::rebuild)));
@@ -636,11 +636,8 @@ void GlyphsPanel::readSelection( bool updateStyle, bool updateContent )
// Update family/style based on selection.
fontlister->selection_update();
- // Get fontspec for selection.
- Glib::ustring fontspec = fontlister->get_fontspec();
-
- // Update GUI.
- fontSelector->set_fontspec (fontspec);
+ // Update GUI (based on fontlister values).
+ fontSelector->update_font ();
}
}
diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp
index 2c122da49..d283e6549 100644
--- a/src/ui/dialog/text-edit.cpp
+++ b/src/ui/dialog/text-edit.cpp
@@ -248,16 +248,16 @@ void TextEdit::onReadSelection ( gboolean dostyle, gboolean /*docontent*/ )
// Update family/style based on selection.
font_lister->selection_update();
-
- // Get fontspec for selection.
Glib::ustring fontspec = font_lister->get_fontspec();
- font_selector.set_fontspec (fontspec);
+
+ // Update Font Face.
+ font_selector.update_font ();
// Update Size.
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int unit = prefs->getInt("/options/font/unitType", SP_CSS_UNIT_PT);
double size = sp_style_css_size_px_to_units(query.font_size.computed, unit);
- font_selector.set_size (size);
+ font_selector.update_size (size);
// Update Preview
setPreviewText (fontspec, phrase);