diff options
| author | Jabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es> | 2017-12-27 17:05:55 +0000 |
|---|---|---|
| committer | Jabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es> | 2017-12-27 17:05:55 +0000 |
| commit | 76aab6da8d642a2e72c0a8e0f38c6994a6e62b35 (patch) | |
| tree | 047c4f9d208f8cf8b647acec494a2bb7a5d160ec /src | |
| parent | Merge branch 'master' into powerpencilII (diff) | |
| parent | Stop using deprecated gtk_adjustment_value_changed (diff) | |
| download | inkscape-76aab6da8d642a2e72c0a8e0f38c6994a6e62b35.tar.gz inkscape-76aab6da8d642a2e72c0a8e0f38c6994a6e62b35.zip | |
Merge branch 'master' into powerpencilII
Diffstat (limited to 'src')
| -rw-r--r-- | src/svg-view-slideshow.cpp | 36 | ||||
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 12 | ||||
| -rw-r--r-- | src/ui/dialog/filter-effects-dialog.cpp | 10 | ||||
| -rw-r--r-- | src/ui/dialog/layers.cpp | 5 | ||||
| -rw-r--r-- | src/ui/dialog/objects.cpp | 6 | ||||
| -rw-r--r-- | src/ui/dialog/svg-fonts-dialog.cpp | 12 | ||||
| -rw-r--r-- | src/ui/dialog/symbols.cpp | 20 | ||||
| -rw-r--r-- | src/ui/dialog/tags.cpp | 4 | ||||
| -rw-r--r-- | src/ui/tools/tool-base.cpp | 5 | ||||
| -rw-r--r-- | src/ui/uxmanager.cpp | 22 | ||||
| -rw-r--r-- | src/ui/widget/panel.cpp | 4 | ||||
| -rw-r--r-- | src/ui/widget/selected-style.cpp | 12 | ||||
| -rw-r--r-- | src/widgets/arc-toolbar.cpp | 12 | ||||
| -rw-r--r-- | src/widgets/connector-toolbar.cpp | 3 | ||||
| -rw-r--r-- | src/widgets/ege-adjustment-action.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/pencil-toolbar.cpp | 3 | ||||
| -rw-r--r-- | src/widgets/rect-toolbar.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/spiral-toolbar.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/star-toolbar.cpp | 12 | ||||
| -rw-r--r-- | src/widgets/toolbox.cpp | 16 |
20 files changed, 205 insertions, 7 deletions
diff --git a/src/svg-view-slideshow.cpp b/src/svg-view-slideshow.cpp index 23ac5f06c..0e50d582b 100644 --- a/src/svg-view-slideshow.cpp +++ b/src/svg-view-slideshow.cpp @@ -31,6 +31,10 @@ #include <glibmm/main.h> +#if GTKMM_CHECK_VERSION(3,22,0) +# include <gdkmm/monitor.h> +#endif + #include <gtkmm/button.h> #include <gtkmm/buttonbox.h> #include <gtkmm/image.h> @@ -44,6 +48,9 @@ #include "svg-view-slideshow.h" #include "svg-view-widget.h" +#if GTKMM_CHECK_VERSION(3,22,0) +# include <gdkmm/monitor.h> +#endif SPSlideShow::SPSlideShow(std::vector<Glib::ustring> const &slides, bool full_screen, int timer, double scale) @@ -57,9 +64,34 @@ SPSlideShow::SPSlideShow(std::vector<Glib::ustring> const &slides, bool full_scr , _ctrlwin(NULL) { // setup initial document +#if GTKMM_CHECK_VERSION(3,22,0) + auto display = Gdk::Display::get_default(); + auto monitor = display->get_primary_monitor(); + + // Fallback to monitor number 0 if the user hasn't configured a primary monitor + if (!monitor) { + monitor = display->get_monitor(0); + } + + if (monitor) { + Gdk::Rectangle monitor_geometry; + monitor->get_geometry(monitor_geometry); + + auto const monitor_width = monitor_geometry.get_width(); + auto const monitor_height = monitor_geometry.get_height(); + +#else auto default_screen = Gdk::Screen::get_default(); - set_default_size(MIN ((int)_doc->getWidth().value("px")*_scale, default_screen->get_width() - 64), - MIN ((int)_doc->getHeight().value("px")*_scale, default_screen->get_height() - 64)); + + if (default_screen) { + auto const monitor_width = default_screen->get_width(); + auto const monitor_height = default_screen->get_height(); +#endif + + set_default_size(MIN ((int)_doc->getWidth().value("px")*_scale, monitor_width - 64), + MIN ((int)_doc->getHeight().value("px")*_scale, monitor_height - 64)); + + } _view = sp_svg_view_widget_new(_doc); SP_SVG_VIEW_WIDGET(_view)->setResize( false, _doc->getWidth().value("px"), _doc->getHeight().value("px") ); diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 3d246f4cb..48e0042b4 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -564,21 +564,33 @@ void DocumentProperties::populate_linked_profiles_box() void DocumentProperties::external_scripts_list_button_release(GdkEventButton* event) { if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +#if GTKMM_CHECK_VERSION(3,22,0) + _ExternalScriptsContextMenu.popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _ExternalScriptsContextMenu.popup(event->button, event->time); +#endif } } void DocumentProperties::embedded_scripts_list_button_release(GdkEventButton* event) { if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +#if GTKMM_CHECK_VERSION(3,22,0) + _EmbeddedScriptsContextMenu.popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _EmbeddedScriptsContextMenu.popup(event->button, event->time); +#endif } } void DocumentProperties::linked_profiles_list_button_release(GdkEventButton* event) { if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +#if GTKMM_CHECK_VERSION(3,22,0) + _EmbProfContextMenu.popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _EmbProfContextMenu.popup(event->button, event->time); +#endif } } diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 9764618ec..bfebc687d 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1624,7 +1624,12 @@ void FilterEffectsDialog::FilterModifier::filter_list_button_release(GdkEventBut auto items = _menu->get_children(); items[0]->set_sensitive(sensitive); items[1]->set_sensitive(sensitive); + +#if GTKMM_CHECK_VERSION(3,22,0) + _menu->popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _menu->popup(event->button, event->time); +#endif } } @@ -2484,7 +2489,12 @@ bool FilterEffectsDialog::PrimitiveList::on_button_release_event(GdkEventButton* auto items = _primitive_menu->get_children(); items[0]->set_sensitive(sensitive); items[1]->set_sensitive(sensitive); + +#if GTKMM_CHECK_VERSION(3,22,0) + _primitive_menu->popup_at_pointer(reinterpret_cast<GdkEvent *>(e)); +#else _primitive_menu->popup(e->button, e->time); +#endif return true; } diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index ed2babf80..2a59bac00 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -572,7 +572,12 @@ bool LayersPanel::_handleButtonEvent(GdkEventButton* event) int y = static_cast<int>(event->y); if ( _tree.get_path_at_pos( x, y, path ) ) { _checkTreeSelection(); + +#if GTKMM_CHECK_VERSION(3,22,0) + _popupMenu.popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _popupMenu.popup(event->button, event->time); +#endif } } diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index 2be1f115f..6d2e884b0 100644 --- a/src/ui/dialog/objects.cpp +++ b/src/ui/dialog/objects.cpp @@ -779,7 +779,13 @@ bool ObjectsPanel::_handleButtonEvent(GdkEventButton* event) int y = static_cast<int>(event->y); if ( _tree.get_path_at_pos( x, y, path ) ) { _checkTreeSelection(); + +#if GTKMM_CHECK_VERSION(3,22,0) + _popupMenu.popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _popupMenu.popup(event->button, event->time); +#endif + if (_tree.get_selection()->is_selected(path)) { return true; } diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 5284940be..d58e0a064 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -276,21 +276,33 @@ void SvgFontsDialog::on_kerning_value_changed(){ void SvgFontsDialog::glyphs_list_button_release(GdkEventButton* event) { if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +#if GTKMM_CHECK_VERSION(3,22,0) + _GlyphsContextMenu.popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _GlyphsContextMenu.popup(event->button, event->time); +#endif } } void SvgFontsDialog::kerning_pairs_list_button_release(GdkEventButton* event) { if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +#if GTKMM_CHECK_VERSION(3,22,0) + _KerningPairsContextMenu.popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _KerningPairsContextMenu.popup(event->button, event->time); +#endif } } void SvgFontsDialog::fonts_list_button_release(GdkEventButton* event) { if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +#if GTKMM_CHECK_VERSION(3,22,0) + _FontsContextMenu.popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _FontsContextMenu.popup(event->button, event->time); +#endif } } diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 1642ff04c..108d186ab 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -114,8 +114,15 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : /******************** Table *************************/ auto table = new Gtk::Grid(); + +#if GTKMM_CHECK_VERSION(3,12,0) + table->set_margin_start(3); + table->set_margin_end(3); +#else table->set_margin_left(3); table->set_margin_right(3); +#endif + table->set_margin_top(4); // panel is a cloked Gtk::VBox _getContents()->pack_start(*Gtk::manage(table), Gtk::PACK_EXPAND_WIDGET); @@ -154,8 +161,15 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : search->set_tooltip_text(_("Return to start search.")); search->signal_key_press_event().connect_notify( sigc::mem_fun(*this, &SymbolsDialog::beforeSearch)); search->signal_key_release_event().connect_notify(sigc::mem_fun(*this, &SymbolsDialog::unsensitive)); + +#if GTKMM_CHECK_VERSION(3,12,0) + search->set_margin_start(10); + search->set_margin_end(10); +#else search->set_margin_left(10); search->set_margin_right(10); +#endif + search->set_margin_bottom(6); search->signal_search_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::clearSearch)); table->attach(*Gtk::manage(search),0,row,2,1); @@ -237,8 +251,14 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : progress->pack_start(* progress_bar, Gtk::PACK_EXPAND_WIDGET); progress->set_margin_top(15); progress->set_margin_bottom(15); + +#if GTKMM_CHECK_VERSION(3,12,0) + progress->set_margin_start(20); + progress->set_margin_end(20); +#else progress->set_margin_left(20); progress->set_margin_right(20); +#endif ++row; diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp index ae45654a7..ebd36da01 100644 --- a/src/ui/dialog/tags.cpp +++ b/src/ui/dialog/tags.cpp @@ -571,7 +571,11 @@ bool TagsPanel::_handleButtonEvent(GdkEventButton* event) int y = static_cast<int>(event->y); if ( _tree.get_path_at_pos( x, y, path ) ) { _checkTreeSelection(); +#if GTKMM_CHECK_VERSION(3,22,0) + _popupMenu.popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _popupMenu.popup(event->button, event->time); +#endif if (_tree.get_selection()->is_selected(path)) { return true; } diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 79e1cbc10..83a084a60 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -1126,10 +1126,15 @@ void sp_event_root_menu_popup(SPDesktop *desktop, SPItem *item, GdkEvent *event) switch (event->type) { case GDK_BUTTON_PRESS: +#if GTKMM_CHECK_VERSION(3,22,0) + case GDK_KEY_PRESS: + CM->popup_at_pointer(event); +#else CM->popup(event->button.button, event->button.time); break; case GDK_KEY_PRESS: CM->popup(0, event->key.time); +#endif break; default: break; diff --git a/src/ui/uxmanager.cpp b/src/ui/uxmanager.cpp index c263eaded..f48f40879 100644 --- a/src/ui/uxmanager.cpp +++ b/src/ui/uxmanager.cpp @@ -20,6 +20,10 @@ #include "util/ege-tags.h" #include "widgets/toolbox.h" +#if GTKMM_CHECK_VERSION(3,22,0) +# include <gdkmm/monitor.h> +#endif + using std::vector; class TrackItem @@ -120,10 +124,28 @@ UXManagerImpl::UXManagerImpl() : tags.addTag(ege::Tag("General")); tags.addTag(ege::Tag("Icons")); + // Figure out if we're on a widescreen display +#if GTKMM_CHECK_VERSION(3,22,0) + auto display = Gdk::Display::get_default(); + auto monitor = display->get_primary_monitor(); + + // Fallback to monitor number 0 if the user hasn't configured a primary monitor + if (!monitor) { + monitor = display->get_monitor(0); + } + + if(monitor) { + Gdk::Rectangle monitor_geometry; + monitor->get_geometry(monitor_geometry); + + int const width = monitor_geometry.get_width(); + int const height = monitor_geometry.get_height(); +#else Glib::RefPtr<Gdk::Screen> defaultScreen = Gdk::Screen::get_default(); if (defaultScreen) { int width = defaultScreen->get_width(); int height = defaultScreen->get_height(); +#endif gdouble aspect = static_cast<gdouble>(width) / static_cast<gdouble>(height); if (aspect > 1.65) { _widescreen = true; diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index aea9b7e8e..cc17262af 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -83,7 +83,11 @@ void Panel::_popper(GdkEventButton* event) { if ( (event->type == GDK_BUTTON_PRESS) && (event->button == 3 || event->button == 1) ) { if (_menu) { +#if GTKMM_CHECK_VERSION(3,22,0) + _menu->popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _menu->popup(event->button, event->time); +#endif } } } diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index d9b93f6db..1c6556884 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -822,7 +822,11 @@ SelectedStyle::on_fill_click(GdkEventButton *event) fs->showPageFill(); } else if (event->button == 3) { // right-click, popup menu +#if GTKMM_CHECK_VERSION(3,22,0) + _popup[SS_FILL].popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _popup[SS_FILL].popup(event->button, event->time); +#endif } else if (event->button == 2) { // middle click, toggle none/lastcolor if (_mode[SS_FILL] == SS_NONE) { on_fill_lastused(); @@ -840,7 +844,11 @@ SelectedStyle::on_stroke_click(GdkEventButton *event) if (Dialog::FillAndStroke *fs = get_fill_and_stroke_panel(_desktop)) fs->showPageStrokePaint(); } else if (event->button == 3) { // right-click, popup menu +#if GTKMM_CHECK_VERSION(3,22,0) + _popup[SS_STROKE].popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _popup[SS_STROKE].popup(event->button, event->time); +#endif } else if (event->button == 2) { // middle click, toggle none/lastcolor if (_mode[SS_STROKE] == SS_NONE) { on_stroke_lastused(); @@ -858,7 +866,11 @@ SelectedStyle::on_sw_click(GdkEventButton *event) if (Dialog::FillAndStroke *fs = get_fill_and_stroke_panel(_desktop)) fs->showPageStrokeStyle(); } else if (event->button == 3) { // right-click, popup menu +#if GTKMM_CHECK_VERSION(3,22,0) + _popup_sw.popup_at_pointer(reinterpret_cast<GdkEvent *>(event)); +#else _popup_sw.popup(event->button, event->time); +#endif } else if (event->button == 2) { // middle click, toggle none/lastwidth? // } diff --git a/src/widgets/arc-toolbar.cpp b/src/widgets/arc-toolbar.cpp index 907285a60..d6bb80850 100644 --- a/src/widgets/arc-toolbar.cpp +++ b/src/widgets/arc-toolbar.cpp @@ -285,11 +285,17 @@ static void sp_arctb_defaults(GtkWidget *, GObject *obj) adj = GTK_ADJUSTMENT( g_object_get_data(obj, "start") ); gtk_adjustment_set_value(adj, 0.0); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif adj = GTK_ADJUSTMENT( g_object_get_data(obj, "end") ); gtk_adjustment_set_value(adj, 0.0); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif spinbutton_defocus(GTK_WIDGET(obj)); } @@ -320,12 +326,18 @@ static void arc_tb_event_attr_changed(Inkscape::XML::Node *repr, gchar const * / adj = GTK_ADJUSTMENT( g_object_get_data(tbl, "rx") ); gdouble rx = ge->getVisibleRx(); gtk_adjustment_set_value(adj, Quantity::convert(rx, "px", unit)); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif adj = GTK_ADJUSTMENT( g_object_get_data(tbl, "ry") ); gdouble ry = ge->getVisibleRy(); gtk_adjustment_set_value(adj, Quantity::convert(ry, "px", unit)); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif } gdouble start = 0.; diff --git a/src/widgets/connector-toolbar.cpp b/src/widgets/connector-toolbar.cpp index 9c4980f4c..349163255 100644 --- a/src/widgets/connector-toolbar.cpp +++ b/src/widgets/connector-toolbar.cpp @@ -267,7 +267,10 @@ static void connector_tb_event_attr_changed(Inkscape::XML::Node *repr, sp_repr_get_double(repr, "inkscape:connector-spacing", &spacing); gtk_adjustment_set_value(adj, spacing); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif spinbutton_defocus(tbl); } diff --git a/src/widgets/ege-adjustment-action.cpp b/src/widgets/ege-adjustment-action.cpp index 0f0d205e2..318e6ced2 100644 --- a/src/widgets/ege-adjustment-action.cpp +++ b/src/widgets/ege-adjustment-action.cpp @@ -792,10 +792,14 @@ static gboolean event_cb( EgeAdjustmentAction* act, GdkEvent* evt ) if ( evt->type == GDK_BUTTON_PRESS ) { if ( evt->button.button == 3 ) { if ( IS_EGE_ADJUSTMENT_ACTION(act) ) { - GdkEventButton* btnevt = (GdkEventButton*)evt; GtkWidget* menu = create_popup_number_menu(act); gtk_widget_show_all( menu ); +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer( GTK_MENU(menu), evt ); +#else + GdkEventButton* btnevt = (GdkEventButton*)evt; gtk_menu_popup( GTK_MENU(menu), NULL, NULL, NULL, NULL, btnevt->button, btnevt->time ); +#endif } handled = TRUE; } diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index bc5112a89..688eb2cf0 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -265,7 +265,10 @@ static void sp_pencil_tb_defaults(GtkWidget * /*widget*/, GObject *obj) adj = GTK_ADJUSTMENT(g_object_get_data(obj, "tolerance")); gtk_adjustment_set_value(adj, tolerance); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif spinbutton_defocus(tbl); } diff --git a/src/widgets/rect-toolbar.cpp b/src/widgets/rect-toolbar.cpp index de599cbfb..5b7362e09 100644 --- a/src/widgets/rect-toolbar.cpp +++ b/src/widgets/rect-toolbar.cpp @@ -152,12 +152,18 @@ static void sp_rtb_defaults( GtkWidget * /*widget*/, GObject *obj) adj = GTK_ADJUSTMENT( g_object_get_data(obj, "rx") ); gtk_adjustment_set_value(adj, 0.0); + +#if !GTK_CHECK_VERSION(3,18,0) // this is necessary if the previous value was 0, but we still need to run the callback to change all selected objects gtk_adjustment_value_changed(adj); +#endif adj = GTK_ADJUSTMENT( g_object_get_data(obj, "ry") ); gtk_adjustment_set_value(adj, 0.0); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif sp_rtb_sensitivize( obj ); } diff --git a/src/widgets/spiral-toolbar.cpp b/src/widgets/spiral-toolbar.cpp index ef9f5bce8..a2d5ec44e 100644 --- a/src/widgets/spiral-toolbar.cpp +++ b/src/widgets/spiral-toolbar.cpp @@ -126,7 +126,10 @@ static void sp_spl_tb_defaults(GtkWidget * /*widget*/, GObject *obj) adj = GTK_ADJUSTMENT(g_object_get_data(obj, "revolution")); gtk_adjustment_set_value(adj, rev); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif adj = GTK_ADJUSTMENT(g_object_get_data(obj, "expansion")); gtk_adjustment_set_value(adj, exp); @@ -134,7 +137,10 @@ static void sp_spl_tb_defaults(GtkWidget * /*widget*/, GObject *obj) adj = GTK_ADJUSTMENT(g_object_get_data(obj, "t0")); gtk_adjustment_set_value(adj, t0); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif spinbutton_defocus(tbl); } diff --git a/src/widgets/star-toolbar.cpp b/src/widgets/star-toolbar.cpp index 657b38f18..13c4440ca 100644 --- a/src/widgets/star-toolbar.cpp +++ b/src/widgets/star-toolbar.cpp @@ -417,19 +417,31 @@ static void sp_stb_defaults( GtkWidget * /*widget*/, GObject *dataKludge ) adj = GTK_ADJUSTMENT( g_object_get_data( dataKludge, "magnitude" ) ); gtk_adjustment_set_value(adj, mag); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif adj = GTK_ADJUSTMENT( g_object_get_data( dataKludge, "proportion" ) ); gtk_adjustment_set_value(adj, prop); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif adj = GTK_ADJUSTMENT( g_object_get_data( dataKludge, "rounded" ) ); gtk_adjustment_set_value(adj, rounded); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif adj = GTK_ADJUSTMENT( g_object_get_data( dataKludge, "randomized" ) ); gtk_adjustment_set_value(adj, randomized); + +#if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_value_changed(adj); +#endif } static void star_toolbox_watch_ec(SPDesktop* dt, Inkscape::UI::Tools::ToolBase* ec, GObject* holder); diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 447af9c71..11be3b15d 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -1038,11 +1038,19 @@ void setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop) swatch->setDesktop( desktop ); swatch->setClickVerb( aux_toolboxes[i].swatch_verb_id ); swatch->setWatchedTool( aux_toolboxes[i].swatch_tool, true ); + +#if GTKMM_CHECK_VERSION(3,12,0) + swatch->set_margin_start(AUX_BETWEEN_BUTTON_GROUPS); + swatch->set_margin_end(AUX_BETWEEN_BUTTON_GROUPS); +#else + swatch->set_margin_left(AUX_BETWEEN_BUTTON_GROUPS); + swatch->set_margin_right(AUX_BETWEEN_BUTTON_GROUPS); +#endif + + swatch->set_margin_top(AUX_SPACING); + swatch->set_margin_bottom(AUX_SPACING); + auto swatch_ = GTK_WIDGET( swatch->gobj() ); - gtk_widget_set_margin_left(swatch_, AUX_BETWEEN_BUTTON_GROUPS); - gtk_widget_set_margin_right(swatch_, AUX_BETWEEN_BUTTON_GROUPS); - gtk_widget_set_margin_top(swatch_, AUX_SPACING); - gtk_widget_set_margin_bottom(swatch_, AUX_SPACING); gtk_grid_attach( GTK_GRID(holder), swatch_, 1, 0, 1, 1); } if(i==0){ |
