mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-03 04:22:47 -05:00
GTK: allow Event Log list box to grow vertically.
Now, when you resize the Event Log window, the list box grows in both directions. Previously, as a side effect of the Columns-based layout, it grew only horizontally. I've arranged this by adding an extra wrinkle to the Columns layout system, which allows you to tag _exactly one_ widget in the whole container as the 'vexpand' widget. When the Columns is size-allocated taller than its minimum height, the vexpand widget is given all the extra space. This technique ports naturally across all versions of GTK (since the hard part is done in my own code). But it's limited: you can't set more than one widget to be vexpand (which saves having to figure out whether they're side by side and can expand in parallel, or vertically separated and each have to get half the available extra space, etc). And in complex layouts where the widget you really want to expand is in a sub-Columns, there's no system for recursively searching down to find it. In other words, this is a one-shot bodge for the Event Log, and it will want more work if we ever plan to extend it to list boxes in the main config dialog.
This commit is contained in:
@ -30,6 +30,7 @@ struct Columns_tag {
|
||||
/* private after here */
|
||||
GList *children; /* this holds ColumnsChild structures */
|
||||
GList *taborder; /* this just holds GtkWidgets */
|
||||
ColumnsChild *vexpand;
|
||||
gint spacing;
|
||||
};
|
||||
|
||||
@ -57,6 +58,7 @@ void columns_add(Columns *cols, GtkWidget *child,
|
||||
void columns_taborder_last(Columns *cols, GtkWidget *child);
|
||||
void columns_force_left_align(Columns *cols, GtkWidget *child);
|
||||
void columns_force_same_height(Columns *cols, GtkWidget *ch1, GtkWidget *ch2);
|
||||
void columns_vexpand(Columns *cols, GtkWidget *child);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user