summaryrefslogtreecommitdiff
path: root/pluma/pluma-notebook.c
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-04-19 15:18:59 +0200
committerraveit65 <[email protected]>2017-05-12 10:56:41 +0200
commit5bed2111c37a1d39eaf7cdad489bd954b5f06227 (patch)
tree132993b013cde958cb2449b80ab60bf7ed94ba95 /pluma/pluma-notebook.c
parentc271f003e7e24728bde3df9acff1d57e8f590dcb (diff)
downloadpluma-5bed2111c37a1d39eaf7cdad489bd954b5f06227.tar.bz2
pluma-5bed2111c37a1d39eaf7cdad489bd954b5f06227.tar.xz
double click to the right of the last open tab to open a new tab
New feature Fixes #185
Diffstat (limited to 'pluma/pluma-notebook.c')
-rw-r--r--pluma/pluma-notebook.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/pluma/pluma-notebook.c b/pluma/pluma-notebook.c
index d2b35d25..591b6220 100644
--- a/pluma/pluma-notebook.c
+++ b/pluma/pluma-notebook.c
@@ -591,6 +591,9 @@ button_press_cb (PlumaNotebook *notebook,
GdkEventButton *event,
gpointer data)
{
+ static gboolean newfile = FALSE;
+ static gint tab1click = -1;
+
gint tab_clicked;
if (notebook->priv->drag_in_progress)
@@ -599,7 +602,7 @@ button_press_cb (PlumaNotebook *notebook,
tab_clicked = find_tab_num_at_pos (notebook,
event->x_root,
event->y_root);
-
+
if ((event->button == 1) &&
(event->type == GDK_BUTTON_PRESS) &&
(tab_clicked >= 0))
@@ -633,6 +636,23 @@ button_press_cb (PlumaNotebook *notebook,
}
}
+ if (event->button == 1)
+ {
+ if (event->type == GDK_BUTTON_PRESS)
+ {
+ tab1click = gtk_notebook_get_current_page (notebook);
+ newfile = (tab_clicked == -1);
+ }
+ else if (event->type == GDK_2BUTTON_PRESS)
+ {
+ if ((tab1click != gtk_notebook_get_current_page (notebook)) ||
+ (tab_clicked >= 0) || ((tab_clicked == -1) && (!newfile)))
+ return TRUE;
+
+ newfile = FALSE;
+ }
+ }
+
return FALSE;
}