diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-01-27 21:37:03 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-02-18 21:18:27 +0000 |
| commit | 47c3e89671c6de12fc08977db56ed3de227807a4 (patch) | |
| tree | 5918b5c4c4a6b0ae97198d8e168f1b072b8690ee /src/ui | |
| parent | Add CSS function to check we are in dark theme (diff) | |
| download | inkscape-47c3e89671c6de12fc08977db56ed3de227807a4.tar.gz inkscape-47c3e89671c6de12fc08977db56ed3de227807a4.zip | |
adding symbols
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/livepatheffect-add.cpp | 51 | ||||
| -rw-r--r-- | src/ui/dialog/livepatheffect-add.h | 5 |
2 files changed, 15 insertions, 41 deletions
diff --git a/src/ui/dialog/livepatheffect-add.cpp b/src/ui/dialog/livepatheffect-add.cpp index b11ee66b7..886dbb38f 100644 --- a/src/ui/dialog/livepatheffect-add.cpp +++ b/src/ui/dialog/livepatheffect-add.cpp @@ -150,28 +150,22 @@ bool LivePathEffectAdd::on_filter(Gtk::FlowBoxChild *child) return false; } - mainVBox->pack_start(scrolled_window, true, true); - 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 ) ); - - add_button.grab_default(); - - show_all_children(); +void LivePathEffectAdd::on_search() +{ + _visiblelpe = 0; + _LPESelectorFlowBox->set_filter_func(sigc::mem_fun(*this, &LivePathEffectAdd::on_filter)); + if (_visiblelpe == 0) { + _LPEInfo->set_text(_("Your search do a empty result, please try again")); + _LPEInfo->set_visible(true); + _LPEInfo->get_style_context()->add_class("lpeinfowarn"); + } else { + _LPEInfo->set_visible(false); + _LPEInfo->get_style_context()->remove_class("lpeinfowarn"); + } } void LivePathEffectAdd::onAdd() { - applied = true; onClose(); } @@ -187,27 +181,6 @@ void LivePathEffectAdd::onKeyEvent(GdkEventKey* evt) } } -void LivePathEffectAdd::onButtonEvent(GdkEventButton* evt) -{ - // Double click on tree is same as clicking the add button - if (evt->type == GDK_2BUTTON_PRESS) { - onAdd(); - } -} - -const Util::EnumData<LivePathEffect::EffectType>* -LivePathEffectAdd::getActiveData() -{ - Gtk::TreeModel::iterator iter = instance().effectlist_treeview.get_selection()->get_selected(); - if ( iter ) { - Gtk::TreeModel::Row row = *iter; - return row[instance()._columns.data]; - } - - return nullptr; -} - - void LivePathEffectAdd::show(SPDesktop *desktop) { LivePathEffectAdd &dial = instance(); diff --git a/src/ui/dialog/livepatheffect-add.h b/src/ui/dialog/livepatheffect-add.h index 003c9c127..4127553ac 100644 --- a/src/ui/dialog/livepatheffect-add.h +++ b/src/ui/dialog/livepatheffect-add.h @@ -50,12 +50,13 @@ public: * Close button was clicked */ void onClose(); - + bool on_filter(Gtk::FlowBoxChild *child); + void on_search(); + void on_activate(Gtk::FlowBoxChild *child); /** * Add button was clicked */ void onAdd(); - /** * Tree was clicked */ |
