diff console/libgnt/gntmain.c @ 13927:9309d27d780c

[gaim-migrate @ 16447] Pseudo-shadow effect for the windows and buttons. Uses non-ASCII emblems for buddies in the buddy-list if locale is set to UTF. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 06 Jul 2006 17:54:46 +0000
parents 0febf380b473
children 3dbcbc5e57e1
line wrap: on
line diff
--- a/console/libgnt/gntmain.c	Thu Jul 06 09:21:57 2006 +0000
+++ b/console/libgnt/gntmain.c	Thu Jul 06 17:54:46 2006 +0000
@@ -20,6 +20,8 @@
 static int Y_MIN;
 static int Y_MAX;
 
+static gboolean ascii_only;
+
 static GMainLoop *loop;
 static struct
 {
@@ -314,10 +316,12 @@
 				}
 				else if (strcmp(buffer + 1, "m") == 0 && focus_list)
 				{
+					/* Move a window */
 					mode = GNT_KP_MODE_MOVE;
 				}
 				else if (strcmp(buffer + 1, "w") == 0 && focus_list)
 				{
+					/* Window list */
 					mode = GNT_KP_MODE_WINDOW_LIST;
 					show_window_list();
 				}
@@ -375,11 +379,11 @@
 
 			if (changed)
 			{
-				lock_focus_list = 1;
-				gnt_widget_hide(widget);
+				GntNode *node = g_hash_table_lookup(nodes, widget);
 				gnt_widget_set_position(widget, x, y);
-				gnt_widget_show(widget);
-				lock_focus_list = 0;
+				move_panel(node->panel, y, x);
+				update_panels();
+				doupdate();
 			}
 		}
 		else if (*buffer == '\r')
@@ -419,8 +423,13 @@
 	int result = g_io_add_watch(channel, 
 					(G_IO_IN | G_IO_HUP | G_IO_ERR),
 					io_invoke, NULL);
+	const char *locale = setlocale(LC_ALL, "");
 
-	setlocale(LC_ALL, "");
+	if (locale && (strstr(locale, "UTF") || strstr(locale, "utf")))
+		ascii_only = FALSE;
+	else
+		ascii_only = TRUE;
+
 	initscr();
 	start_color();
 	gnt_init_colors();
@@ -459,6 +468,7 @@
 free_node(gpointer data)
 {
 	GntNode *node = data;
+	hide_panel(node->panel);
 	del_panel(node->panel);
 	g_free(node);
 }
@@ -582,3 +592,8 @@
 	endwin();
 }
 
+gboolean gnt_ascii_only()
+{
+	return ascii_only;
+}
+