diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-04-26 23:27:03 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-04-26 23:27:03 +0000 |
| commit | cf159c3d0415a1a761eb7ca760256cd224927d3c (patch) | |
| tree | 03cfd9a7f543ec07377c96ed23b9f5b0626a6e2a /src/ui | |
| parent | Redesign of the BSpline LPE widgets (diff) | |
| parent | Clean up of style code: Patch from suv: SPStyle: struct -> class (diff) | |
| download | inkscape-cf159c3d0415a1a761eb7ca760256cd224927d3c.tar.gz inkscape-cf159c3d0415a1a761eb7ca760256cd224927d3c.zip | |
update to trunk
(bzr r11950.1.336)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/font-substitution.cpp | 18 | ||||
| -rw-r--r-- | src/ui/dialog/livepatheffect-add.cpp | 14 | ||||
| -rw-r--r-- | src/ui/dialog/livepatheffect-add.h | 4 | ||||
| -rw-r--r-- | src/ui/widget/style-subject.h | 2 | ||||
| -rw-r--r-- | src/ui/widget/style-swatch.h | 2 |
5 files changed, 29 insertions, 11 deletions
diff --git a/src/ui/dialog/font-substitution.cpp b/src/ui/dialog/font-substitution.cpp index bf9133086..6e9ecc3c8 100644 --- a/src/ui/dialog/font-substitution.cpp +++ b/src/ui/dialog/font-substitution.cpp @@ -200,16 +200,16 @@ GSList * FontSubstitution::getFontReplacedItems(SPDocument* doc, Glib::ustring * } } - if (style && style->text) { + if (style) { gchar const *style_font = NULL; - if (style->text->font_family.set) - style_font = style->text->font_family.value; - else if (style->text->font_specification.set) - style_font = style->text->font_specification.value; - else if (style->text->font_family.value) - style_font = style->text->font_family.value; - else if (style->text->font_specification.value) - style_font = style->text->font_specification.value; + if (style->font_family.set) + style_font = style->font_family.value; + else if (style->font_specification.set) + style_font = style->font_specification.value; + else if (style->font_family.value) + style_font = style->font_family.value; + else if (style->font_specification.value) + style_font = style->font_specification.value; if (style_font) { if (has_visible_text(item)) { diff --git a/src/ui/dialog/livepatheffect-add.cpp b/src/ui/dialog/livepatheffect-add.cpp index b5f51d81d..c558eddaf 100644 --- a/src/ui/dialog/livepatheffect-add.cpp +++ b/src/ui/dialog/livepatheffect-add.cpp @@ -38,6 +38,7 @@ LivePathEffectAdd::LivePathEffectAdd() : scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); scrolled_window.set_shadow_type(Gtk::SHADOW_IN); scrolled_window.set_size_request(250, 200); + scrolled_window.set_can_focus(); /** * Effect Store and Tree @@ -83,10 +84,12 @@ LivePathEffectAdd::LivePathEffectAdd() : add_action_widget(close_button, Gtk::RESPONSE_CLOSE); add_action_widget(add_button, Gtk::RESPONSE_APPLY); + /** * Signal handlers */ effectlist_treeview.signal_button_press_event().connect_notify( sigc::mem_fun(*this, &LivePathEffectAdd::onButtonEvent) ); + effectlist_treeview.signal_key_press_event().connect_notify(sigc::mem_fun(*this, &LivePathEffectAdd::onKeyEvent)); close_button.signal_clicked().connect(sigc::mem_fun(*this, &LivePathEffectAdd::onClose)); add_button.signal_clicked().connect(sigc::mem_fun(*this, &LivePathEffectAdd::onAdd)); signal_delete_event().connect( sigc::bind_return(sigc::hide(sigc::mem_fun(*this, &LivePathEffectAdd::onClose)), true ) ); @@ -107,6 +110,16 @@ void LivePathEffectAdd::onClose() hide(); } +void LivePathEffectAdd::onKeyEvent(GdkEventKey* evt) +{ + if (evt->keyval == GDK_KEY_Return) { + onAdd(); + } + if (evt->keyval == GDK_KEY_Escape) { + onClose(); + } +} + void LivePathEffectAdd::onButtonEvent(GdkEventButton* evt) { // Double click on tree is same as clicking the add button @@ -135,6 +148,7 @@ void LivePathEffectAdd::show(SPDesktop *desktop) dial.set_modal(true); desktop->setWindowTransient (dial.gobj()); dial.property_destroy_with_parent() = true; + dial.effectlist_treeview.grab_focus(); dial.run(); } diff --git a/src/ui/dialog/livepatheffect-add.h b/src/ui/dialog/livepatheffect-add.h index 7fa766272..99ead878c 100644 --- a/src/ui/dialog/livepatheffect-add.h +++ b/src/ui/dialog/livepatheffect-add.h @@ -74,6 +74,10 @@ protected: */ void onButtonEvent(GdkEventButton* evt); + /** + * Key event + */ + void onKeyEvent(GdkEventKey* evt); private: Gtk::TreeView effectlist_treeview; diff --git a/src/ui/widget/style-subject.h b/src/ui/widget/style-subject.h index c2941d995..47da91732 100644 --- a/src/ui/widget/style-subject.h +++ b/src/ui/widget/style-subject.h @@ -20,7 +20,7 @@ class SPDesktop; class SPObject; class SPCSSAttr; -struct SPStyle; +class SPStyle; namespace Inkscape { class Selection; diff --git a/src/ui/widget/style-swatch.h b/src/ui/widget/style-swatch.h index 23ecbdfda..557ca82e2 100644 --- a/src/ui/widget/style-swatch.h +++ b/src/ui/widget/style-swatch.h @@ -29,7 +29,7 @@ #include "desktop.h" #include "preferences.h" -struct SPStyle; +class SPStyle; class SPCSSAttr; namespace Gtk { |
