diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-07-21 03:36:25 +0000 |
|---|---|---|
| committer | John Smith <john.smith7545@yahoo.com> | 2012-07-21 03:36:25 +0000 |
| commit | 9c7757e7fc10db2004c188a7aff95ab54b0e80d6 (patch) | |
| tree | 88ddb04c252ac2377cf061fdcb8f1ebbfcff16ce /src | |
| parent | Fix for 960240 : Rename Edit:Find to Find Replace (diff) | |
| download | inkscape-9c7757e7fc10db2004c188a7aff95ab54b0e80d6.tar.gz inkscape-9c7757e7fc10db2004c188a7aff95ab54b0e80d6.zip | |
Fix for 816496 : Alt+mouse wheel z-order cycling, add option to cycle wrap
(bzr r11561)
Diffstat (limited to 'src')
| -rw-r--r-- | src/select-context.cpp | 13 | ||||
| -rw-r--r-- | src/select-context.h | 1 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 7 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.h | 1 |
4 files changed, 18 insertions, 4 deletions
diff --git a/src/select-context.cpp b/src/select-context.cpp index 91e0e6298..4555e51aa 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -122,6 +122,7 @@ sp_select_context_init(SPSelectContext *sc) sc->cycling_items_cmp = NULL; sc->cycling_items_selected_before = NULL; sc->cycling_cur_item = NULL; + sc->cycling_wrap = true; sc->_seltrans = NULL; sc->_describer = NULL; @@ -457,15 +458,17 @@ sp_select_context_cycle_through_items(SPSelectContext *sc, Inkscape::Selection * GList *next; if (scroll_event->direction == GDK_SCROLL_UP) { next = sc->cycling_cur_item->next; - if (next == NULL) + if (next == NULL && sc->cycling_wrap) next = sc->cycling_items; } else { next = sc->cycling_cur_item->prev; - if (next == NULL) + if (next == NULL && sc->cycling_wrap) next = g_list_last(sc->cycling_items); } - sc->cycling_cur_item = next; - item = SP_ITEM(sc->cycling_cur_item->data); + if (next) { + sc->cycling_cur_item = next; + item = SP_ITEM(sc->cycling_cur_item->data); + } arenaitem = item->get_arenaitem(desktop->dkey); arenaitem->setOpacity(1.0); @@ -856,6 +859,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) sc->cycling_cur_item = g_list_last(sc->cycling_items); } + sc->cycling_wrap = prefs->getBool("/options/selection/cycleWrap", true); + // Cycle through the items underneath the mouse pointer, one-by-one sp_select_context_cycle_through_items(sc, selection, scroll_event, shift_pressed); diff --git a/src/select-context.h b/src/select-context.h index d579f7ebc..ce2039a2d 100644 --- a/src/select-context.h +++ b/src/select-context.h @@ -42,6 +42,7 @@ struct SPSelectContext : public SPEventContext { GList *cycling_items_cmp; GList *cycling_items_selected_before; GList *cycling_cur_item; + bool cycling_wrap; SPItem *item; SPCanvasItem *grabbed; diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index f2de350a0..b0cbc1b9f 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1089,6 +1089,13 @@ void InkscapePreferences::initPageBehavior() _page_select.add_line( false, "", _sel_layer_deselects, "", _("Uncheck this to be able to keep the current objects selected when the current layer changes")); + + _sel_cycle.init ( _("Wrap when cycling objects in z-order"), "/options/selection/cycleWrap", true); + + _page_select.add_group_header( _("Alt+Scroll Wheel")); + _page_select.add_line( true, "", _sel_cycle, "", + _("Wrap around at start and end when cycling objects in z-order")); + this->AddPage(_page_select, _("Selecting"), iter_behavior, PREFS_PAGE_BEHAVIOR_SELECTING); // Transforms options diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 1cf5cc975..49818110a 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -279,6 +279,7 @@ protected: UI::Widget::PrefCheckButton _sel_hidden; UI::Widget::PrefCheckButton _sel_locked; UI::Widget::PrefCheckButton _sel_layer_deselects; + UI::Widget::PrefCheckButton _sel_cycle; UI::Widget::PrefSpinButton _importexport_export; UI::Widget::PrefSlider _snap_delay; |
