Mercurial > dwindows
changeset 1540:282727422698
Default scrolled items to 500x200 on GTK2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 12 Jan 2012 18:56:30 +0000 |
parents | b7136c130a66 |
children | 1c6593b0ce45 |
files | gtk/dw.c |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gtk/dw.c Thu Jan 12 18:50:17 2012 +0000 +++ b/gtk/dw.c Thu Jan 12 18:56:30 2012 +0000 @@ -10115,7 +10115,21 @@ gtk_container_forall(GTK_CONTAINER(box),_rearrange_table, GINT_TO_POINTER(boxtype == DW_VERT ? index : -(index+1))); gtk_table_attach(GTK_TABLE(box), item, x, x + 1, y, y + 1, hsize ? DW_EXPAND : 0, vsize ? DW_EXPAND : 0, pad, pad); gtk_object_set_data(GTK_OBJECT(box), "_dw_boxcount", GINT_TO_POINTER(boxcount + 1)); - gtk_widget_set_usize(item, width, height); + { + int thiswidth = width, thisheight = height; + + /* If it is a scrolled item and not expandable... + * set the default size to 500x200. + */ + if(GTK_IS_SCROLLED_WINDOW(item)) + { + if(thiswidth < 1 && !hsize) + thiswidth = 500; + if(thisheight < 1 && !vsize) + thisheight = 200; + } + gtk_widget_set_usize(item, thiswidth, thisheight); + } if(GTK_IS_RADIO_BUTTON(item)) { GSList *group;