Skip to content

Commit

Permalink
gtk4: Make popup image to use natural size
Browse files Browse the repository at this point in the history
Ignore image size parameters to popup_image(). They are
to be removed completely.

See RM #669

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
  • Loading branch information
cazfi committed Jul 26, 2024
1 parent c711453 commit f68e730
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/gui-gtk-4.0/dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1673,15 +1673,17 @@ void request_action_confirmation(const char *expl,
/**********************************************************************//**
Popup image window
**************************************************************************/
void popup_image(const char *tag, int width, int height)
void popup_image(const char *tag, int width_discard, int height_discard)
{
struct sprite *spr = load_popup_sprite(tag);

if (spr != NULL) {
GdkPixbuf *pix = sprite_get_pixbuf(spr);
GtkWidget *win = gtk_window_new();
GtkWidget *img = gtk_image_new_from_pixbuf(pix);
int width, height;

get_sprite_dimensions(spr, &width, &height);
gtk_window_set_default_size(GTK_WINDOW(win), width, height);
gtk_window_set_child(GTK_WINDOW(win), img);
gtk_widget_show(win);
Expand Down

0 comments on commit f68e730

Please sign in to comment.