mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 19:42:48 -05:00
Make string_width() work in GTK3.
This was another piece of code that determined text size by instantiating a GtkLabel and asking for its size, which I had to fix in gtkfont.c recently because that strategy doesn't work in GTK3. Replaced the implementation of string_width() with a call to the function I added in gtkfont.c, and now dialog boxes which depend on that for their width measurement (e.g. the one in reallyclose()) don't come out in silly sizes on GTK3 any more.
This commit is contained in:
@ -3428,11 +3428,9 @@ int messagebox(GtkWidget *parentwin, const char *title, const char *msg,
|
||||
|
||||
int string_width(const char *text)
|
||||
{
|
||||
GtkWidget *label = gtk_label_new(text);
|
||||
GtkRequisition req;
|
||||
gtk_widget_size_request(label, &req);
|
||||
g_object_ref_sink(G_OBJECT(label));
|
||||
return req.width;
|
||||
int ret;
|
||||
get_label_text_dimensions(text, &ret, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int reallyclose(void *frontend)
|
||||
|
Reference in New Issue
Block a user