SF.net SVN: geany: [1527] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri May 11 16:43:15 UTC 2007


Revision: 1527
          http://svn.sourceforge.net/geany/?rev=1527&view=rev
Author:   ntrel
Date:     2007-05-11 09:43:13 -0700 (Fri, 11 May 2007)

Log Message:
-----------
Wrap notebook pages when switching tabs.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/utils.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-05-11 16:34:18 UTC (rev 1526)
+++ trunk/ChangeLog	2007-05-11 16:43:13 UTC (rev 1527)
@@ -21,6 +21,8 @@
    Add optional title parameter for open dialog with ui_path_box_new()
    and ui_setup_open_button_callback().
    Use Windows folder dialog in ui_path_box_open_clicked().
+ * src/utils.c:
+   Wrap notebook pages when switching tabs.
 
 
 2007-05-10  Nick Treleaven  <nick.treleaven at btinternet.com>

Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c	2007-05-11 16:34:18 UTC (rev 1526)
+++ trunk/src/utils.c	2007-05-11 16:43:13 UTC (rev 1527)
@@ -1038,13 +1038,19 @@
 	gint page_count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook));
 	gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook));
 
-	if (direction == LEFT && cur_page > 0)
+	if (direction == LEFT)
 	{
-		gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), cur_page - 1);
+		if (cur_page > 0)
+			gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), cur_page - 1);
+		else
+			gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), page_count - 1);
 	}
-	else if (direction == RIGHT && cur_page < page_count)
+	else if (direction == RIGHT)
 	{
-		gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), cur_page + 1);
+		if (cur_page < page_count - 1)
+			gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), cur_page + 1);
+		else
+			gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), 0);
 	}
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list