diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/libnrtype/FontFactory.h | 2 | ||||
| -rw-r--r-- | src/widgets/text-toolbar.cpp | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/libnrtype/FontFactory.h b/src/libnrtype/FontFactory.h index bd5a4460c..4c8c2cb29 100644 --- a/src/libnrtype/FontFactory.h +++ b/src/libnrtype/FontFactory.h @@ -68,7 +68,7 @@ public: }; // Map type for gathering UI family and style names -typedef std::map<Glib::ustring, std::list<StyleNames> > FamilyToStylesMap; +// typedef std::map<Glib::ustring, std::list<StyleNames> > FamilyToStylesMap; class font_factory { public: diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index 3d2e6eef8..ec011fffd 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -162,11 +162,17 @@ static void sp_text_fontfamily_value_changed( Ink_ComboBoxEntry_Action *act, GOb fontlister->fill_css( css ); SPDesktop *desktop = SP_ACTIVE_DESKTOP; - sp_desktop_set_style (desktop, css, true, true); // Results in selection change called twice. + if( desktop->getSelection()->isEmpty() ) { + // Update default + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->mergeStyle("/tools/text/style", css); + } else { + // If there is a selection, update + sp_desktop_set_style (desktop, css, true, true); // Results in selection change called twice. + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, + _("Text: Change font family")); + } sp_repr_css_attr_unref (css); - - DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, - _("Text: Change font family")); } // unfreeze |
