[anjuta] document-manager: bgo#550027 - Open a source tab in full window size



commit f1fe843f077d0fbf97398fe3e1478c365c00cda9
Author: Dragos Dena <dragos dena gmail com>
Date:   Mon Apr 19 19:10:54 2010 +0200

    document-manager: bgo#550027  - Open a source tab in full window size

 plugins/document-manager/anjuta-docman.c |   20 ++++++++++++++++++++
 plugins/document-manager/anjuta-docman.h |    1 +
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/plugins/document-manager/anjuta-docman.c b/plugins/document-manager/anjuta-docman.c
index 1e2dfb7..68961c4 100644
--- a/plugins/document-manager/anjuta-docman.c
+++ b/plugins/document-manager/anjuta-docman.c
@@ -356,6 +356,22 @@ on_notebook_tab_btnrelease (GtkWidget *widget, GdkEventButton *event, AnjutaDocm
 	return FALSE;
 }
 
+static gboolean
+on_notebook_tab_double_click(GtkWidget *widget, GdkEventButton *event, 
+                             AnjutaDocman* docman)
+{
+	if (event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS)
+	{
+		if(!docman->maximized)
+			anjuta_shell_maximize_widget(docman->shell, "AnjutaDocumentManager", NULL);
+		else
+			anjuta_shell_unmaximize(docman->shell, NULL);
+		docman->maximized = docman->maximized ? FALSE:TRUE;
+	}
+
+  return FALSE;
+}
+
 static void
 on_notebook_page_reordered (GtkNotebook *notebook, GtkWidget *child,
 							guint page_num, AnjutaDocman *docman)
@@ -524,6 +540,9 @@ anjuta_docman_page_init (AnjutaDocman *docman, IAnjutaDocument *doc,
 	g_signal_connect (G_OBJECT (box), "button-release-event",
 					  G_CALLBACK (on_notebook_tab_btnrelease),
 					  docman);
+	g_signal_connect (G_OBJECT (box), "event",
+	                  G_CALLBACK (on_notebook_tab_double_click),
+	                  docman);
 
 	page->widget = GTK_WIDGET (doc);	/* this is the notebook-page child widget */
 	page->doc = doc;
@@ -907,6 +926,7 @@ anjuta_docman_new (DocmanPlugin* plugin, AnjutaPreferences *pref)
 		real_docman->priv->plugin = plugin;
 		real_docman->priv->preferences = pref;
 		real_docman->priv->documents_action_group = gtk_action_group_new ("ActionGroupDocument");
+		real_docman->maximized = FALSE;
 		ui = anjuta_shell_get_ui (ANJUTA_PLUGIN (plugin)->shell, NULL);
 		gtk_ui_manager_insert_action_group (GTK_UI_MANAGER (ui), real_docman->priv->documents_action_group, 0);
 		g_object_unref (real_docman->priv->documents_action_group);
diff --git a/plugins/document-manager/anjuta-docman.h b/plugins/document-manager/anjuta-docman.h
index d5764d4..3835ff3 100644
--- a/plugins/document-manager/anjuta-docman.h
+++ b/plugins/document-manager/anjuta-docman.h
@@ -44,6 +44,7 @@ struct _AnjutaDocman {
 	GtkNotebook parent;
 	AnjutaDocmanPriv *priv;
 	AnjutaShell *shell;
+	gboolean maximized;
 };
 
 struct _AnjutaDocmanClass {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]