diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2013-01-04 09:35:53 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2013-01-04 09:35:53 +0000 |
| commit | f3ebae385211512a9cbd727b5aa532f6aa1b711b (patch) | |
| tree | 52dc68f71cc252254ffebdbcd1107d35aa9fa895 /src/ui | |
| parent | Re-add omitted UI pref from prefences dialog rewrite (diff) | |
| download | inkscape-f3ebae385211512a9cbd727b5aa532f6aa1b711b.tar.gz inkscape-f3ebae385211512a9cbd727b5aa532f6aa1b711b.zip | |
ocaldialog: Use GtkSearchEntry in Gtk+ >= 3.6
(bzr r12008)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/ocaldialogs.cpp | 9 | ||||
| -rw-r--r-- | src/ui/dialog/ocaldialogs.h | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp index 82bc85099..75c766566 100644 --- a/src/ui/dialog/ocaldialogs.cpp +++ b/src/ui/dialog/ocaldialogs.cpp @@ -561,6 +561,7 @@ void StatusWidget::end_process() clear(); } +#if !GTK_CHECK_VERSION(3,6,0) SearchEntry::SearchEntry() : Gtk::Entry() { signal_changed().connect(sigc::mem_fun(*this, &SearchEntry::_on_changed)); @@ -589,6 +590,8 @@ void SearchEntry::_on_changed() set_icon_from_stock(Gtk::Stock::CLEAR, Gtk::ENTRY_ICON_SECONDARY); } } +#endif + BaseBox::BaseBox() : Gtk::EventBox() { @@ -1208,7 +1211,13 @@ ImportDialog::ImportDialog(Gtk::Window& parent_window, FileDialogType file_types BaseBox *basebox_no_search_results = new BaseBox(); label_not_found = new Gtk::Label(); label_description = new Gtk::Label(); + +#if GTK_CHECK_VERSION(3,6,0) + entry_search = new Gtk::SearchEntry(); +#else entry_search = new SearchEntry(); +#endif + button_search = new Gtk::Button(_("Search")); #if WITH_GTKMM_3_0 diff --git a/src/ui/dialog/ocaldialogs.h b/src/ui/dialog/ocaldialogs.h index 1cdfa15bb..326542579 100644 --- a/src/ui/dialog/ocaldialogs.h +++ b/src/ui/dialog/ocaldialogs.h @@ -21,6 +21,11 @@ #include <gtkmm/listviewtext.h> #include <gtkmm/scrolledwindow.h> #include <gtkmm/window.h> + +#if GTK_CHECK_VERSION(3,6,0) +# include <gtkmm/searchentry.h> +#endif + #include <giomm/file.h> //Inkscape includes @@ -328,6 +333,7 @@ public: Gtk::Label* label; }; +#if !GTK_CHECK_VERSION(3,6,0) /** * A Gtk::Entry with search & clear icons */ @@ -340,6 +346,7 @@ private: void _on_icon_pressed(Gtk::EntryIconPosition icon_position, const GdkEventButton* event); void _on_changed(); }; +#endif /** * A box which paints an overlay of the OCAL logo @@ -449,7 +456,13 @@ protected: private: Glib::ustring filename_image; Glib::ustring filename_thumbnail; + +#if GTK_CHECK_VERSION(3,6,0) + Gtk::SearchEntry *entry_search; +#else SearchEntry *entry_search; +#endif + LogoArea *drawingarea_logo; SearchResultList *list_results; PreviewWidget *preview_files; |
