diff options
| -rw-r--r-- | share/keys/default.xml | 3 | ||||
| -rw-r--r-- | share/keys/inkscape.xml | 3 | ||||
| -rw-r--r-- | src/ui/previewholder.cpp | 17 | ||||
| -rw-r--r-- | src/ui/previewholder.h | 1 |
4 files changed, 24 insertions, 0 deletions
diff --git a/share/keys/default.xml b/share/keys/default.xml index 74822e6d1..619db8cdb 100644 --- a/share/keys/default.xml +++ b/share/keys/default.xml @@ -676,4 +676,7 @@ override) the bindings in the main default.xml. <bind key="j" modifiers="Ctrl,Alt" action="org.inkscape.typography.nextglyphlayer" display="true"/> <bind key="J" modifiers="Ctrl,Alt" action="org.inkscape.typography.nextglyphlayer"/> + <bind key="p" modifiers="Shift,Alt" action="TogglePalette" display="true" /> + <bind key="P" modifiers="Shift,Alt" action="TogglePalette" /> + </keys> diff --git a/share/keys/inkscape.xml b/share/keys/inkscape.xml index 74822e6d1..619db8cdb 100644 --- a/share/keys/inkscape.xml +++ b/share/keys/inkscape.xml @@ -676,4 +676,7 @@ override) the bindings in the main default.xml. <bind key="j" modifiers="Ctrl,Alt" action="org.inkscape.typography.nextglyphlayer" display="true"/> <bind key="J" modifiers="Ctrl,Alt" action="org.inkscape.typography.nextglyphlayer"/> + <bind key="p" modifiers="Shift,Alt" action="TogglePalette" display="true" /> + <bind key="P" modifiers="Shift,Alt" action="TogglePalette" /> + </keys> diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp index 0dac18665..24049d2f9 100644 --- a/src/ui/previewholder.cpp +++ b/src/ui/previewholder.cpp @@ -17,6 +17,7 @@ #include <gtkmm/scrolledwindow.h> #include <gtkmm/sizegroup.h> #include <gtkmm/scrollbar.h> +#include <gtkmm/adjustment.h> #define COLUMNS_FOR_SMALL 16 #define COLUMNS_FOR_LARGE 8 @@ -56,9 +57,25 @@ PreviewHolder::PreviewHolder() : PreviewHolder::~PreviewHolder() { + } +bool PreviewHolder::on_scroll_event(GdkEventScroll *event) +{ + // Scroll horizontally by page on mouse wheel + Gtk::Adjustment *adj = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hadjustment(); + if (!adj) { + return FALSE; + } + + int move = (event->direction == GDK_SCROLL_DOWN) ? adj->get_page_size() : -adj->get_page_size(); + double value = std::min(adj->get_upper() - move, adj->get_value() + move ); + + adj->set_value(value); + + return FALSE; +} void PreviewHolder::clear() { diff --git a/src/ui/previewholder.h b/src/ui/previewholder.h index 8363498a6..4c591bfaf 100644 --- a/src/ui/previewholder.h +++ b/src/ui/previewholder.h @@ -46,6 +46,7 @@ public: protected: virtual void on_size_allocate( Gtk::Allocation& allocation ); + virtual bool on_scroll_event(GdkEventScroll*); // virtual void on_size_request( Gtk::Requisition* requisition ); |
