[gnome-todo] list-selector-grid-item: Allow control-click for selection mode.
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] list-selector-grid-item: Allow control-click for selection mode.
- Date: Fri, 28 Apr 2017 22:50:44 +0000 (UTC)
commit 4d7c2979fcc92c865d28f81fc32081350965b3ca
Author: Linus Probert <linus probert gmail com>
Date: Fri Apr 28 00:33:29 2017 +0200
list-selector-grid-item: Allow control-click for selection mode.
Currently entering selection mode is possible through clicking the 'selection
mode' button or by right-clicking a grid item.
According to the style guide it's recomended to enable selection mode by
control/shift-clicking an item.
To remedy this we now allow ctrl-left-click on grid items to enter
selection mode and mark them as selected.
https://bugzilla.gnome.org/show_bug.cgi?id=778675
src/views/gtd-list-selector-grid-item.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/views/gtd-list-selector-grid-item.c b/src/views/gtd-list-selector-grid-item.c
index 6147e09..5e0ab02 100644
--- a/src/views/gtd-list-selector-grid-item.c
+++ b/src/views/gtd-list-selector-grid-item.c
@@ -340,11 +340,16 @@ gtd_list_selector_grid_item__button_press_event_cb (GtkWidget *widget,
{
GtdListSelectorGridItem *item;
GdkEventButton *button_ev;
+ gboolean right_click;
+ gboolean left_click_with_ctrl;
item = GTD_LIST_SELECTOR_GRID_ITEM (user_data);
button_ev = (GdkEventButton*) event;
- if (button_ev->button == 3)
+ right_click = button_ev->button == 3;
+ left_click_with_ctrl = button_ev->button == 1 && button_ev->state & GDK_CONTROL_MASK;
+
+ if (right_click || left_click_with_ctrl)
{
if (item->mode == GTD_WINDOW_MODE_NORMAL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]