diff options
| author | Moritz Eberl <moritz@semiodesk.com> | 2016-04-13 10:22:31 +0000 |
|---|---|---|
| committer | Moritz Eberl <moritz@semiodesk.com> | 2016-04-13 10:22:31 +0000 |
| commit | 9dc9b855edf5f891856ad1c9a63eae2266bb9cfa (patch) | |
| tree | 45c8c6d192dbf72c2e543f6e4b5716999c3bb3af /src/ui | |
| parent | Modified the windows build to integrate gmodule-2.0 and loader.cpp/.h (diff) | |
| parent | Fixed FIXMEs in Cmake build (set flags when needed) (diff) | |
| download | inkscape-9dc9b855edf5f891856ad1c9a63eae2266bb9cfa.tar.gz inkscape-9dc9b855edf5f891856ad1c9a63eae2266bb9cfa.zip | |
Merge
(bzr r14761.1.4)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/clipboard.cpp | 43 | ||||
| -rw-r--r-- | src/ui/dialog/aboutbox.cpp | 12 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 5 | ||||
| -rw-r--r-- | src/ui/dialog/ocaldialogs.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/ocaldialogs.h | 6 | ||||
| -rw-r--r-- | src/ui/dialog/tags.cpp | 12 | ||||
| -rw-r--r-- | src/ui/interface.cpp | 4 | ||||
| -rw-r--r-- | src/ui/tool/event-utils.cpp | 8 | ||||
| -rw-r--r-- | src/ui/tools/connector-tool.cpp | 4 | ||||
| -rw-r--r-- | src/ui/widget/gimpcolorwheel.c | 2 | ||||
| -rw-r--r-- | src/ui/widget/selected-style.cpp | 24 |
11 files changed, 56 insertions, 68 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index f0dc33740..d581dbf7e 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -146,8 +146,6 @@ private: void _setClipboardColor(guint32); void _userWarn(SPDesktop *, char const *); - void _inkscape_wait_for_targets(std::list<Glib::ustring> &); - // private properites SPDocument *_clipboardSPDoc; ///< Document that stores the clipboard until someone requests it Inkscape::XML::Node *_defs; ///< Reference to the clipboard document's defs node @@ -1302,9 +1300,11 @@ Geom::Scale ClipboardManagerImpl::_getScale(SPDesktop *desktop, Geom::Point cons */ Glib::ustring ClipboardManagerImpl::_getBestTarget() { - // GTKmm's wait_for_targets() is broken, see the comment in _inkscape_wait_for_targets() - std::list<Glib::ustring> targets; // = _clipboard->wait_for_targets(); - _inkscape_wait_for_targets(targets); +#if WITH_GTKMM_3_0 + std::vector<Glib::ustring> targets = _clipboard->wait_for_targets(); +#else + std::list<Glib::ustring> targets = _clipboard->wait_for_targets(); +#endif // clipboard target debugging snippet /* @@ -1456,39 +1456,6 @@ void ClipboardManagerImpl::_userWarn(SPDesktop *desktop, char const *msg) desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, msg); } - -// GTKMM's clipboard::wait_for_targets is buggy and might return bogus, see -// -// https://bugs.launchpad.net/inkscape/+bug/296778 -// http://mail.gnome.org/archives/gtk-devel-list/2009-June/msg00062.html -// -// for details. Until this has been fixed upstream we will use our own implementation -// of this method, as copied from /gtkmm-2.16.0/gtk/gtkmm/clipboard.cc. -void ClipboardManagerImpl::_inkscape_wait_for_targets(std::list<Glib::ustring> &listTargets) -{ - //Get a newly-allocated array of atoms: - GdkAtom* targets = NULL; - gint n_targets = 0; - gboolean test = gtk_clipboard_wait_for_targets( gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), &targets, &n_targets ); - if (!test || (targets == NULL)) { - return; - } - - //Add the targets to the C++ container: - for (int i = 0; i < n_targets; i++) - { - //Convert the atom to a string: - gchar* const atom_name = gdk_atom_name(targets[i]); - - Glib::ustring target; - if (atom_name) { - target = Glib::ScopedPtr<char>(atom_name).get(); //This frees the gchar*. - } - - listTargets.push_back(target); - } -} - /* ####################################### ClipboardManager class ####################################### */ diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index 81f48e6ef..b653a630d 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -120,10 +120,22 @@ AboutBox::AboutBox() : Gtk::Dialog(_("About Inkscape")) { label->set_selectable(true); label->show(); + Gtk::Label *link = new Gtk::Label(); + const gchar *website_link = + "<a href=\"https://www.inkscape.org\"> https://www.inkscape.org</a>"; + + link->set_markup(website_link); + link->set_alignment(Gtk::ALIGN_END); + link->set_padding(5,5); + link->set_selectable(true); + link->show(); + #if WITH_GTKMM_3_0 get_content_area()->pack_start(*manage(label), false, false); + get_content_area()->pack_start(*manage(link), false, false); #else get_vbox()->pack_start(*manage(label), false, false); + get_vbox()->pack_start(*manage(link), false, false); #endif Gtk::Requisition requisition; diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index b20f71a6a..c7a168dee 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -613,8 +613,9 @@ void InkscapePreferences::initPageUI() _("Set the language for menus and number formats"), false); { - Glib::ustring sizeLabels[] = {C_("Icon size", "Large"), C_("Icon size", "Small"), C_("Icon size", "Smaller")}; - int sizeValues[] = {0, 1, 2}; + Glib::ustring sizeLabels[] = {C_("Icon size", "Larger"), C_("Icon size", "Large"), C_("Icon size", "Small"), C_("Icon size", "Smaller")}; + int sizeValues[] = {3, 0, 1, 2}; + // "Larger" is 3 to not break existing preference files. Should fix in GTK3 _misc_small_tools.init( "/toolbox/tools/small", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), 0 ); _page_ui.add_line( false, _("Toolbox icon size:"), _misc_small_tools, "", diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp index a1c7d41bd..f2ee79d06 100644 --- a/src/ui/dialog/ocaldialogs.cpp +++ b/src/ui/dialog/ocaldialogs.cpp @@ -573,7 +573,7 @@ void StatusWidget::end_process() clear(); } -#if !GTK_CHECK_VERSION(3,6,0) +#if !GTK_CHECK_VERSION(3,0,0) SearchEntry::SearchEntry() : Gtk::Entry() { signal_changed().connect(sigc::mem_fun(*this, &SearchEntry::_on_changed)); @@ -1222,7 +1222,7 @@ ImportDialog::ImportDialog(Gtk::Window& parent_window, FileDialogType file_types label_not_found = new Gtk::Label(); label_description = new Gtk::Label(); -#if GTK_CHECK_VERSION(3,6,0) +#if GTK_CHECK_VERSION(3,0,0) entry_search = new Gtk::SearchEntry(); #else entry_search = new SearchEntry(); diff --git a/src/ui/dialog/ocaldialogs.h b/src/ui/dialog/ocaldialogs.h index 6ceceb9ef..9de24d821 100644 --- a/src/ui/dialog/ocaldialogs.h +++ b/src/ui/dialog/ocaldialogs.h @@ -26,7 +26,7 @@ #include <cairomm/refptr.h> -#if GTK_CHECK_VERSION(3,6,0) +#if GTK_CHECK_VERSION(3,0,0) # include <gtkmm/searchentry.h> #endif @@ -336,7 +336,7 @@ public: Gtk::Label* label; }; -#if !GTK_CHECK_VERSION(3,6,0) +#if !GTK_CHECK_VERSION(3,0,0) /** * A Gtk::Entry with search & clear icons */ @@ -460,7 +460,7 @@ private: Glib::ustring filename_image; Glib::ustring filename_thumbnail; -#if GTK_CHECK_VERSION(3,6,0) +#if GTK_CHECK_VERSION(3,0,0) Gtk::SearchEntry *entry_search; #else SearchEntry *entry_search; diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp index cbb2fb953..c99c1bff3 100644 --- a/src/ui/dialog/tags.cpp +++ b/src/ui/dialog/tags.cpp @@ -935,7 +935,17 @@ TagsPanel::TagsPanel() : _tree.set_headers_visible(false); _tree.set_reorderable(true); _tree.enable_model_drag_dest (Gdk::ACTION_MOVE); - + + // This string is constructed to use already translated strings. + // The tooltip applies to the whole tree area. It would be better + // if the tooltip was split into parts and only applied to the + // icons but doing that is quite complicated. + Glib::ustring tooltip_string = "'+': "; + tooltip_string += (_("Add selection to set")); + tooltip_string += "; '×': "; + tooltip_string += (_("Remove from selection set")); + _tree.set_tooltip_text( tooltip_string ); + Inkscape::UI::Widget::AddToIcon * addRenderer = manage( new Inkscape::UI::Widget::AddToIcon()); int addColNum = _tree.append_column("type", *addRenderer) - 1; Gtk::TreeViewColumn *col = _tree.get_column(addColNum); diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index 531aa728d..8639861f8 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -1018,7 +1018,7 @@ sp_ui_drag_data_received(GtkWidget *widget, { int destX = 0; int destY = 0; - gtk_widget_translate_coordinates( widget, &(desktop->canvas->widget), x, y, &destX, &destY ); + gtk_widget_translate_coordinates( widget, GTK_WIDGET(desktop->canvas), x, y, &destX, &destY ); Geom::Point where( sp_canvas_window_to_world( desktop->canvas, Geom::Point( destX, destY ) ) ); Geom::Point const button_dt(desktop->w2d(where)); Geom::Point const button_doc(desktop->dt2doc(button_dt)); @@ -1141,7 +1141,7 @@ sp_ui_drag_data_received(GtkWidget *widget, if ( worked ) { int destX = 0; int destY = 0; - gtk_widget_translate_coordinates( widget, &(desktop->canvas->widget), x, y, &destX, &destY ); + gtk_widget_translate_coordinates( widget, GTK_WIDGET(desktop->canvas), x, y, &destX, &destY ); Geom::Point where( sp_canvas_window_to_world( desktop->canvas, Geom::Point( destX, destY ) ) ); Geom::Point const button_dt(desktop->w2d(where)); Geom::Point const button_doc(desktop->dt2doc(button_dt)); diff --git a/src/ui/tool/event-utils.cpp b/src/ui/tool/event-utils.cpp index 079275d63..6b8d5f0dc 100644 --- a/src/ui/tool/event-utils.cpp +++ b/src/ui/tool/event-utils.cpp @@ -60,8 +60,8 @@ unsigned combine_motion_events(SPCanvas *canvas, GdkEventMotion &event, gint mas } GdkEvent *event_next; gint i = 0; - event.x -= canvas->x0; - event.y -= canvas->y0; + event.x -= canvas->_x0; + event.y -= canvas->_y0; event_next = gdk_event_get(); // while the next event is also a motion notify @@ -92,8 +92,8 @@ unsigned combine_motion_events(SPCanvas *canvas, GdkEventMotion &event, gint mas if (event_next) { gdk_event_put(event_next); } - event.x += canvas->x0; - event.y += canvas->y0; + event.x += canvas->_x0; + event.y += canvas->_y0; return i; } diff --git a/src/ui/tools/connector-tool.cpp b/src/ui/tools/connector-tool.cpp index b84d16686..74f2664fe 100644 --- a/src/ui/tools/connector-tool.cpp +++ b/src/ui/tools/connector-tool.cpp @@ -247,7 +247,7 @@ void ConnectorTool::setup() { // Make sure we see all enter events for canvas items, // even if a mouse button is depressed. - this->desktop->canvas->gen_all_enter_events = true; + this->desktop->canvas->_gen_all_enter_events = true; } void ConnectorTool::set(const Inkscape::Preferences::Entry& val) { @@ -276,7 +276,7 @@ void ConnectorTool::finish() { this->cc_clear_active_conn(); // Restore the default event generating behaviour. - this->desktop->canvas->gen_all_enter_events = false; + this->desktop->canvas->_gen_all_enter_events = false; } //----------------------------------------------------------------------------- diff --git a/src/ui/widget/gimpcolorwheel.c b/src/ui/widget/gimpcolorwheel.c index c857cfa8a..3642848df 100644 --- a/src/ui/widget/gimpcolorwheel.c +++ b/src/ui/widget/gimpcolorwheel.c @@ -1246,7 +1246,7 @@ paint_triangle (GimpColorWheel *wheel, #endif } -#if GTK_CHECK_VERSION(3,2,0) +#if GTK_CHECK_VERSION(3,0,0) static gboolean gimp_color_wheel_draw (GtkWidget *widget, cairo_t *cr) diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 9e283fc64..87cf0b8c4 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -363,19 +363,6 @@ SelectedStyle::SelectedStyle(bool /*layout*/) _popup_sw.show_all(); } - _fill_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_fill_click)); - _stroke_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_stroke_click)); - _opacity_place.signal_button_press_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_click)); - _stroke_width_place.signal_button_press_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_sw_click)); - _stroke_width_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_sw_click)); - - - _opacity_sb.signal_populate_popup().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_menu)); - _opacity_sb.signal_value_changed().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_changed)); - // Connect to key-press to ensure focus is consistent with other spin buttons when using the keys vs mouse-click - g_signal_connect (G_OBJECT (_opacity_sb.gobj()), "key-press-event", G_CALLBACK (spinbutton_keypress), _opacity_sb.gobj()); - g_signal_connect (G_OBJECT (_opacity_sb.gobj()), "focus-in-event", G_CALLBACK (spinbutton_focus_in), _opacity_sb.gobj()); - _fill_place.add(_na[SS_FILL]); _fill_place.set_tooltip_text(__na[SS_FILL]); @@ -452,6 +439,17 @@ SelectedStyle::SelectedStyle(bool /*layout*/) "drag_data_received", G_CALLBACK(dragDataReceived), _drop[SS_FILL]); + + _fill_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_fill_click)); + _stroke_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_stroke_click)); + _opacity_place.signal_button_press_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_click)); + _stroke_width_place.signal_button_press_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_sw_click)); + _stroke_width_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_sw_click)); + _opacity_sb.signal_populate_popup().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_menu)); + _opacity_sb.signal_value_changed().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_changed)); + // Connect to key-press to ensure focus is consistent with other spin buttons when using the keys vs mouse-click + g_signal_connect (G_OBJECT (_opacity_sb.gobj()), "key-press-event", G_CALLBACK (spinbutton_keypress), _opacity_sb.gobj()); + g_signal_connect (G_OBJECT (_opacity_sb.gobj()), "focus-in-event", G_CALLBACK (spinbutton_focus_in), _opacity_sb.gobj()); } SelectedStyle::~SelectedStyle() |
