[gnome-commander] tabs: start a new tab when CTRL+click/midclick on dir indicator
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] tabs: start a new tab when CTRL+click/midclick on dir indicator
- Date: Sat, 19 Jun 2010 17:28:18 +0000 (UTC)
commit dab835ece88d1aa69eb06db817470244aee27758
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Sat Jun 19 19:23:39 2010 +0200
tabs: start a new tab when CTRL+click/midclick on dir indicator
src/gnome-cmd-dir-indicator.cc | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-cmd-dir-indicator.cc b/src/gnome-cmd-dir-indicator.cc
index 3b2f933..382b33f 100644
--- a/src/gnome-cmd-dir-indicator.cc
+++ b/src/gnome-cmd-dir-indicator.cc
@@ -88,7 +88,10 @@ static gboolean on_dir_indicator_clicked (GnomeCmdDirIndicator *indicator, GdkEv
{
g_return_val_if_fail (GNOME_CMD_IS_DIR_INDICATOR (indicator), FALSE);
- if (event->type==GDK_BUTTON_PRESS && event->button==1)
+ if (event->type!=GDK_BUTTON_PRESS)
+ return FALSE;
+
+ if (event->button==1 || event->button==2)
{
// left click - work out the path
const gchar *labelText = gtk_label_get_text (GTK_LABEL (indicator->priv->label));
@@ -100,7 +103,14 @@ static gboolean on_dir_indicator_clicked (GnomeCmdDirIndicator *indicator, GdkEv
{
chTo[indicator->priv->slashCharPosition[i]] = 0;
main_win->switch_fs(fs);
- fs->goto_directory(chTo);
+ if (event->button==2 || event->state&GDK_CONTROL_MASK)
+ {
+ GnomeCmdCon *con = fs->get_connection();
+ GnomeCmdDir *dir = gnome_cmd_dir_new (con, gnome_cmd_con_create_path (con, chTo));
+ fs->new_tab(dir);
+ }
+ else
+ fs->goto_directory(chTo);
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]