1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

gtk-askpass: add margins on left and right of the prompt.

If the prompt got big enough to reach to the edges of the dialog box,
it looked ugly without any margins. Previously I hadn't noticed,
because the prompt text was never that big.
This commit is contained in:
Simon Tatham 2021-04-02 12:54:52 +01:00
parent e0bbe1e6c0
commit fc9fbfe1e4

View File

@ -432,6 +432,13 @@ static const char *gtk_askpass_setup(struct askpass_ctx *ctx,
gtk_label_set_line_wrap(GTK_LABEL(ctx->promptlabel), true);
#if GTK_CHECK_VERSION(3,0,0)
gtk_label_set_width_chars(GTK_LABEL(ctx->promptlabel), 48);
#endif
int margin = string_width("MM");
#if GTK_CHECK_VERSION(3,12,0)
gtk_widget_set_margin_start(ctx->promptlabel, margin);
gtk_widget_set_margin_end(ctx->promptlabel, margin);
#else
gtk_misc_set_padding(GTK_MISC(ctx->promptlabel), margin, 0);
#endif
our_dialog_add_to_content_area(GTK_WINDOW(ctx->dialog),
ctx->promptlabel, true, true, 0);