mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
GTK: change implementation of 100%-width editboxes.
Previously, in the code that instantiated the dialog.h portable control spec, an edit control with width=100 would be implemented as a small Columns object containing the label and the edit control atop each other. Now, instead, the two controls are placed separately into the containing Columns. Combined with the changes just made to the align_next_to system, this means that you can put buttons to the right of such an edit box and have them line up with the actual edit box, instead of trying to line up with the combination of the box and its label. (The Windows alignment system already identified the specific edit box control as the relevant one, so this was already working there.)
This commit is contained in:
parent
b5ab90143a
commit
22a80a234d
@ -2089,19 +2089,20 @@ GtkWidget *layout_ctrls(
|
||||
#endif
|
||||
|
||||
if (ctrl->label) {
|
||||
GtkWidget *label, *container;
|
||||
GtkWidget *label;
|
||||
|
||||
label = gtk_label_new(ctrl->label);
|
||||
|
||||
shortcut_add(scs, label, ctrl->editbox.shortcut,
|
||||
SHORTCUT_FOCUS, uc->entry);
|
||||
|
||||
container = columns_new(4);
|
||||
if (ctrl->editbox.percentwidth == 100) {
|
||||
columns_add(COLUMNS(container), label, 0, 1);
|
||||
columns_force_left_align(COLUMNS(container), label);
|
||||
columns_add(COLUMNS(container), w, 0, 1);
|
||||
columns_add(cols, label,
|
||||
COLUMN_START(ctrl->column),
|
||||
COLUMN_SPAN(ctrl->column));
|
||||
columns_force_left_align(cols, label);
|
||||
} else {
|
||||
GtkWidget *container = columns_new(4);
|
||||
gint percentages[2];
|
||||
percentages[1] = ctrl->editbox.percentwidth;
|
||||
percentages[0] = 100 - ctrl->editbox.percentwidth;
|
||||
@ -2110,11 +2111,11 @@ GtkWidget *layout_ctrls(
|
||||
columns_force_left_align(COLUMNS(container), label);
|
||||
columns_add(COLUMNS(container), w, 1, 1);
|
||||
columns_align_next_to(COLUMNS(container), label, w);
|
||||
gtk_widget_show(w);
|
||||
w = container;
|
||||
}
|
||||
gtk_widget_show(label);
|
||||
gtk_widget_show(w);
|
||||
|
||||
w = container;
|
||||
gtk_widget_show(label);
|
||||
uc->label = label;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user