gaim/gaim

" Using the request API with only a
oldstatus
2005-02-22, Luke Schierer
8ae42493c7e9
Parents a23159e83514
Children 16e1a01a7fbd
" Using the request API with only a
GAIM_REQUEST_FIELD_LIST would result in a squished tree
view for the list (two rows high, but only the width of
the scroll-bar buttons wide). This patch adjusts things
so that list fields are displayed similarly to
multi-line text fields, with the label on top and the
field itself stretched to something more sane.

Another nice addition would be to make the window
resizable, but that's not part of this patch.

I didn't do a lot of testing. The request dialogues
from idle.c still work fine, so I guess nothing is
broken..." -- Christopher (siege) O'Brien
--- a/src/gtkrequest.c Tue Feb 22 21:08:42 2005 -0500
+++ b/src/gtkrequest.c Tue Feb 22 21:26:14 2005 -0500
@@ -1186,8 +1186,9 @@
rows++;
}
- else if (type == GAIM_REQUEST_FIELD_STRING &&
- gaim_request_field_string_is_multiline(field))
+ else if ((type == GAIM_REQUEST_FIELD_LIST) ||
+ (type == GAIM_REQUEST_FIELD_STRING &&
+ gaim_request_field_string_is_multiline(field)))
{
if (col_num > 0)
rows++;
@@ -1246,6 +1247,7 @@
gtk_size_group_add_widget(sg, label);
if (type == GAIM_REQUEST_FIELD_LABEL ||
+ type == GAIM_REQUEST_FIELD_LIST ||
(type == GAIM_REQUEST_FIELD_STRING &&
gaim_request_field_string_is_multiline(field)))
{
@@ -1294,10 +1296,19 @@
GTK_FILL | GTK_EXPAND,
5, 0);
}
- else if (type != GAIM_REQUEST_FIELD_BOOLEAN)
+ else if (type == GAIM_REQUEST_FIELD_LIST)
+ {
+ gtk_table_attach(GTK_TABLE(table), widget,
+ 0, 2 * cols,
+ row_num, row_num + 1,
+ GTK_FILL | GTK_EXPAND,
+ GTK_FILL | GTK_EXPAND,
+ 5, 0);
+ }
+ else if (type == GAIM_REQUEST_FIELD_BOOLEAN)
{
gtk_table_attach(GTK_TABLE(table), widget,
- col_offset + 1, col_offset + 2,
+ col_offset, col_offset + 1,
row_num, row_num + 1,
GTK_FILL | GTK_EXPAND,
GTK_FILL | GTK_EXPAND,
@@ -1306,7 +1317,7 @@
else
{
gtk_table_attach(GTK_TABLE(table), widget,
- col_offset, col_offset + 1,
+ 1, 2 * cols,
row_num, row_num + 1,
GTK_FILL | GTK_EXPAND,
GTK_FILL | GTK_EXPAND,