changeset 10080:8e6329b8dcc1

[gaim-migrate @ 11062] A final change for today. This puts the conversation formatting toolbar in the same frame as the entry widget. It more closely associates the toolbar with the entry and also looks cooler. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 03 Oct 2004 22:59:26 +0000
parents f8e2e8ee9aa0
children ff4be2d1401d
files src/gtkconv.c src/gtkimhtmltoolbar.c src/gtkimhtmltoolbar.h
diffstat 3 files changed, 47 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconv.c	Sun Oct 03 20:47:58 2004 +0000
+++ b/src/gtkconv.c	Sun Oct 03 22:59:26 2004 +0000
@@ -3995,7 +3995,7 @@
 	GaimGtkChatPane *gtkchat;
 	GaimConnection *gc;
 	GtkWidget *vpaned, *hpaned;
-	GtkWidget *vbox, *hbox;
+	GtkWidget *vbox, *hbox, *frame, *vbox2, *sep;
 	GtkWidget *lbox, *bbox;
 	GtkWidget *label;
 	GtkWidget *list;
@@ -4184,13 +4184,12 @@
 	gtkconv->info = button;
 
 	/* Build the toolbar. */
+	frame = gtk_frame_new(NULL);
+	
 	vbox = gtk_vbox_new(FALSE, 6);
 	gtk_paned_pack2(GTK_PANED(vpaned), vbox, FALSE, TRUE);
 	gtk_widget_show(vbox);
 
-	gtkconv->toolbar = gtk_imhtmltoolbar_new();
-	gtk_box_pack_start(GTK_BOX(vbox), gtkconv->toolbar, FALSE, FALSE, 0);
-
 	gtkconv->lower_hbox = gtk_hbox_new(FALSE, 6);
 	gtk_box_pack_start(GTK_BOX(vbox), gtkconv->lower_hbox, TRUE, TRUE, 0);
 	gtk_widget_show(gtkconv->lower_hbox);
@@ -4199,6 +4198,20 @@
 	gtk_box_pack_end(GTK_BOX(gtkconv->lower_hbox), vbox, TRUE, TRUE, 0);
 	gtk_widget_show(vbox);
 
+	frame = gtk_frame_new(NULL);
+	gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+	gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
+	vbox2 = gtk_vbox_new(FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(frame), vbox2);
+	gtk_widget_show_all(frame);
+	
+       	gtkconv->toolbar = gtk_imhtmltoolbar_new();
+	gtk_box_pack_start(GTK_BOX(vbox2), gtkconv->toolbar, FALSE, FALSE, 0);
+
+	sep = gtk_hseparator_new();
+	gtk_box_pack_start(GTK_BOX(vbox2), sep, FALSE, FALSE, 0);
+	gtk_widget_show(sep);
+
 	/* Setup the entry widget.
 	 * We never show the horizontal scrollbar because it was causing weird
 	 * lockups when typing text just as you type the character that would 
@@ -4206,10 +4219,10 @@
 	 */
 	sw = gtk_scrolled_window_new(NULL, NULL);
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-								   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+				       GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
-										GTK_SHADOW_IN);
-	gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
+					    GTK_SHADOW_NONE);
+	gtk_box_pack_start(GTK_BOX(vbox2), sw, TRUE, TRUE, 0);
 	gtk_widget_show(sw);
 
 	gtkconv->entry = gtk_imhtml_new(NULL, NULL);
@@ -4270,8 +4283,8 @@
 	GaimGtkConversation *gtkconv;
 	GaimGtkImPane *gtkim;
 	GtkWidget *paned;
-	GtkWidget *vbox;
-	GtkWidget *vbox2;
+	GtkWidget *vbox, *sep;
+	GtkWidget *vbox2, *vbox3, *frame;
 	GtkWidget *sw;
 	GList *focus_chain = NULL;
 
@@ -4321,10 +4334,6 @@
 	gtk_paned_pack2(GTK_PANED(paned), vbox2, FALSE, TRUE);
 	gtk_widget_show(vbox2);
 
-	/* Build the toolbar. */
-	gtkconv->toolbar = gtk_imhtmltoolbar_new();
-	gtk_box_pack_start(GTK_BOX(vbox2), gtkconv->toolbar, FALSE, FALSE, 0);
-
 	/* Setup the entry widget.
 	 * We never show the horizontal scrollbar because it was causing weird
 	 * lockups when typing text just as you type the character that would
@@ -4338,12 +4347,27 @@
 	gtk_box_pack_end(GTK_BOX(gtkconv->lower_hbox), vbox2, TRUE, TRUE, 0);
 	gtk_widget_show(vbox2);
 
+	frame = gtk_frame_new(NULL);
+	gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
+	gtk_box_pack_start(GTK_BOX(vbox2), frame, TRUE, TRUE, 0);
+	vbox3 = gtk_vbox_new(FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(frame), vbox3);
+	gtk_widget_show_all(frame);
+
+	/* Build the toolbar. */
+	gtkconv->toolbar = gtk_imhtmltoolbar_new();
+	gtk_box_pack_start(GTK_BOX(vbox3), gtkconv->toolbar, FALSE, FALSE, 0);
+	
+	sep = gtk_hseparator_new();
+	gtk_box_pack_start(GTK_BOX(vbox3), sep, FALSE, FALSE, 0);
+	gtk_widget_show(sep);
+
 	sw = gtk_scrolled_window_new(NULL, NULL);
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
 								   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
-										GTK_SHADOW_IN);
-	gtk_box_pack_start(GTK_BOX(vbox2), sw, TRUE, TRUE, 0);
+										GTK_SHADOW_NONE);
+	gtk_box_pack_start(GTK_BOX(vbox3), sw, TRUE, TRUE, 0);
 	gtk_widget_show(sw);
 
 	gtkconv->entry = gtk_imhtml_new(NULL, NULL);
--- a/src/gtkimhtmltoolbar.c	Sun Oct 03 20:47:58 2004 +0000
+++ b/src/gtkimhtmltoolbar.c	Sun Oct 03 22:59:26 2004 +0000
@@ -33,7 +33,7 @@
 #include "gtkimhtmltoolbar.h"
 #include "gtkutils.h"
 
-static GtkVBoxClass *parent_class = NULL;
+static GtkHBoxClass *parent_class = NULL;
 
 static void do_bold(GtkWidget *bold, GtkIMHtmlToolbar *toolbar)
 {
@@ -849,22 +849,13 @@
 	GObjectClass   *gobject_class;
 	object_class = (GtkObjectClass*) class;
 	gobject_class = (GObjectClass*) class;
-	parent_class = gtk_type_class(GTK_TYPE_VBOX);
-	/*	signals[URL_CLICKED] = g_signal_new(url_clicked",
-						G_TYPE_FROM_CLASS(gobject_class),
-						G_SIGNAL_RUN_FIRST,
-						G_STRUCT_OFFSET(GtkIMHtmlClass, url_clicked),
-						NULL,
-						0,
-						g_cclosure_marshal_VOID__POINTER,
-						G_TYPE_NONE, 1,
-						G_TYPE_POINTER);*/
+	parent_class = gtk_type_class(GTK_TYPE_HBOX);
 	gobject_class->finalize = gtk_imhtmltoolbar_finalize;
 }
 
 static void gtk_imhtmltoolbar_init (GtkIMHtmlToolbar *toolbar)
 {
-	GtkWidget *hbox;
+	GtkWidget *hbox = GTK_HBOX(toolbar);
 	GtkWidget *button;
 	GtkWidget *sep;
 	GtkSizeGroup *sg;
@@ -878,16 +869,10 @@
 	toolbar->image_dialog = NULL;
 
 	toolbar->tooltips = gtk_tooltips_new();
-
+	
+	gtk_box_set_spacing(GTK_BOX(toolbar), 6);
 	sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
 
-	sep = gtk_hseparator_new();
-	gtk_box_pack_start(GTK_BOX(toolbar), sep, FALSE, FALSE, 0);
-	gtk_widget_show(sep);
-
-	hbox = gtk_hbox_new(FALSE, 6);
-	gtk_box_pack_start(GTK_BOX(toolbar), hbox, FALSE, FALSE, 0);
-
 	/* Bold */
 	button = gaim_pixbuf_toolbar_button_from_stock(GTK_STOCK_BOLD);
 	gtk_size_group_add_widget(sg, button);
@@ -1026,10 +1011,6 @@
 
 	toolbar->smiley = button;
 
-
-	sep = gtk_hseparator_new();
-	gtk_box_pack_start(GTK_BOX(toolbar), sep, FALSE, FALSE, 0);
-	gtk_widget_show(sep);
 	toolbar->sml = NULL;
 	gtk_widget_show_all(hbox);
 }
@@ -1056,7 +1037,7 @@
 			(GInstanceInitFunc) gtk_imhtmltoolbar_init
 		};
 
-		imhtmltoolbar_type = g_type_register_static(GTK_TYPE_VBOX,
+		imhtmltoolbar_type = g_type_register_static(GTK_TYPE_HBOX,
 				"GtkIMHtmlToolbar", &imhtmltoolbar_info, 0);
 	}
 
--- a/src/gtkimhtmltoolbar.h	Sun Oct 03 20:47:58 2004 +0000
+++ b/src/gtkimhtmltoolbar.h	Sun Oct 03 22:59:26 2004 +0000
@@ -40,7 +40,7 @@
 typedef struct _GtkIMHtmlToolbarClass		GtkIMHtmlToolbarClass;
 
 struct _GtkIMHtmlToolbar {
-	GtkVBox box;
+	GtkHBox box;
 
 	GtkWidget *imhtml;
 
@@ -74,7 +74,7 @@
 };
 
 struct _GtkIMHtmlToolbarClass {
-	GtkVBoxClass parent_class;
+	GtkHBoxClass parent_class;
 
 };