summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-10-12 04:15:19 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-10-12 04:15:19 +0000
commita67988fae58348562bcde83ea1c5fb8aa4eecb78 (patch)
tree461d4530abd06799974d7cc9d09919a66fad6556
parentTranslation update (diff)
downloadinkscape-a67988fae58348562bcde83ea1c5fb8aa4eecb78.tar.gz
inkscape-a67988fae58348562bcde83ea1c5fb8aa4eecb78.zip
Fix for 177931 : Shift click layer icons to trigger solo
(bzr r11784)
-rw-r--r--src/ui/dialog/layers.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp
index 457f7c147..55a2f19a5 100644
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
@@ -562,26 +562,36 @@ void LayersPanel::_handleButtonEvent(GdkEventButton* event)
{
static unsigned doubleclick = 0;
- // TODO - fix to a better is-popup function
if ( (event->type == GDK_BUTTON_PRESS) && (event->button == 3) ) {
+ // TODO - fix to a better is-popup function
+ Gtk::TreeModel::Path path;
+ int x = static_cast<int>(event->x);
+ int y = static_cast<int>(event->y);
+ if ( _tree.get_path_at_pos( x, y, path ) ) {
+ _checkTreeSelection();
+ _popupMenu.popup(event->button, event->time);
+ }
+ }
- {
- Gtk::TreeModel::Path path;
- Gtk::TreeViewColumn* col = 0;
- int x = static_cast<int>(event->x);
- int y = static_cast<int>(event->y);
- int x2 = 0;
- int y2 = 0;
- if ( _tree.get_path_at_pos( x, y,
- path, col,
- x2, y2 ) ) {
- _checkTreeSelection();
- _popupMenu.popup(event->button, event->time);
+ if ( event->type == GDK_BUTTON_RELEASE && (event->button == 1)
+ && (event->state & GDK_SHIFT_MASK)) {
+ // Shift left click on the visible/lock columns toggles "solo" mode
+ Gtk::TreeModel::Path path;
+ Gtk::TreeViewColumn* col = 0;
+ int x = static_cast<int>(event->x);
+ int y = static_cast<int>(event->y);
+ int x2 = 0;
+ int y2 = 0;
+ if ( _tree.get_path_at_pos( x, y, path, col, x2, y2 ) ) {
+ if (col == _tree.get_column(COL_VISIBLE-1)) {
+ _takeAction(BUTTON_SOLO);
+ } else if (col == _tree.get_column(COL_LOCKED-1)) {
+ _takeAction(BUTTON_LOCK_OTHERS);
}
}
-
}
+
if ( (event->type == GDK_2BUTTON_PRESS) && (event->button == 1) ) {
doubleclick = 1;
}