[OTR-dev] Pidgin plugin development and GUI look

Ian Goldberg ian at cypherpunks.ca
Tue May 27 16:50:39 EDT 2008


On Tue, May 27, 2008 at 04:24:11PM -0400, Ian Goldberg wrote:
> On Tue, May 27, 2008 at 10:14:38PM +0200, hcat at gmx.net wrote:
> > > I wanted at least some help text that doesn't entail going to the web.
> > > You're suggesting just having "What's this?" open the HTML widget
> > > directly, with the current first-level text as its first paragraph?
> > 
> > I didn't realize that it embeds a HTML widget. I just don't see the
> > need for two expanders here, if a user really wants some help text
> > he/she will most likely open the second expander as well, just to see
> > what's written there.
> 
> I can see about making this change.  Not today, though.

Maybe I'm wrong.  I'm not going to check this in right now, but apply
this patch and tell me what you think.

   - Ian

-------------- next part --------------
Index: gtk-dialog.c
===================================================================
RCS file: /cvsroot/otr/gaim-otr/gtk-dialog.c,v
retrieving revision 1.18
diff -u -r1.18 gtk-dialog.c
--- gtk-dialog.c	27 May 2008 19:54:06 -0000	1.18
+++ gtk-dialog.c	27 May 2008 20:48:05 -0000
@@ -423,33 +423,21 @@
 	const char *moremarkup)
 {
     GtkWidget *expander;
-    GtkWidget *ebox;
-    GtkWidget *whatsthis;
-    GtkWidget *more;
-    GtkWidget *frame;
     GtkWidget *scrl;
     GtkWidget *imh;
     GdkFont *font;
+    char *alltext;
 
     expander = gtk_expander_new_with_mnemonic(_("_What's this?"));
     gtk_box_pack_start(GTK_BOX(vbox), expander, FALSE, FALSE, 0);
-    frame = gtk_frame_new(NULL);
-    gtk_container_add(GTK_CONTAINER(expander), frame);
-    ebox = gtk_vbox_new(FALSE, 10);
-    gtk_container_add(GTK_CONTAINER(frame), ebox);
-    whatsthis = gtk_label_new(NULL);
-    gtk_label_set_line_wrap(GTK_LABEL(whatsthis), TRUE);
-    gtk_label_set_markup(GTK_LABEL(whatsthis), whatsthismarkup);
-
-    gtk_box_pack_start(GTK_BOX(ebox), whatsthis, FALSE, FALSE, 0);
-    more = gtk_expander_new_with_mnemonic(_("_More..."));
-    gtk_box_pack_start(GTK_BOX(ebox), more, FALSE, FALSE, 0);
     scrl = gtk_scrolled_window_new(NULL, NULL);
-    gtk_container_add(GTK_CONTAINER(more), scrl);
+    gtk_container_add(GTK_CONTAINER(expander), scrl);
 
     imh = gtk_imhtml_new(NULL, NULL);
     pidgin_setup_imhtml(imh);
-    gtk_imhtml_append_text(GTK_IMHTML(imh), moremarkup, GTK_IMHTML_NO_SCROLL);
+    alltext = g_strdup_printf("%s\n\n%s", whatsthismarkup, moremarkup);
+    gtk_imhtml_append_text(GTK_IMHTML(imh), alltext, GTK_IMHTML_NO_SCROLL);
+    g_free(alltext);
 
     gtk_container_add(GTK_CONTAINER(scrl), imh);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrl),
@@ -459,7 +447,7 @@
      * is (a) complicated, and (b) not fully supported by older versions
      * of libpango, which some people may have. */
     font = gtk_style_get_font(imh->style);
-    gtk_widget_set_size_request(scrl, -1, 6 * (font->ascent + font->descent));
+    gtk_widget_set_size_request(scrl, -1, 10 * (font->ascent + font->descent));
 }
 
 


More information about the OTR-dev mailing list