aspect frame use fixup

This commit is contained in:
Matthias Clasen 2020-05-02 11:05:27 -04:00
parent 4a133b4eef
commit 71433d01b3

View File

@ -267,11 +267,6 @@ start_puzzle (GdkPaintable *paintable)
guint x, y; guint x, y;
float aspect_ratio; float aspect_ratio;
/* Remove the old grid (if there is one) */
grid = gtk_bin_get_child (GTK_BIN (frame));
if (grid)
gtk_aspect_frame_set_child (GTK_ASPECT_FRAME (frame), NULL);
/* Create a new grid */ /* Create a new grid */
grid = gtk_grid_new (); grid = gtk_grid_new ();
gtk_widget_set_can_focus (grid, TRUE); gtk_widget_set_can_focus (grid, TRUE);
@ -345,7 +340,7 @@ reshuffle (void)
{ {
GtkWidget *grid; GtkWidget *grid;
grid = gtk_bin_get_child (GTK_BIN (frame)); grid = gtk_aspect_frame_get_child (GTK_ASPECT_FRAME (frame));
if (solved) if (solved)
start_puzzle (puzzle); start_puzzle (puzzle);
else else
@ -378,7 +373,7 @@ reconfigure (void)
start_puzzle (puzzle); start_puzzle (puzzle);
popover = gtk_widget_get_ancestor (size_spin, GTK_TYPE_POPOVER); popover = gtk_widget_get_ancestor (size_spin, GTK_TYPE_POPOVER);
gtk_popover_popdown (GTK_POPOVER (popover)); gtk_popover_popdown (GTK_POPOVER (popover));
grid = gtk_bin_get_child (GTK_BIN (frame)); grid = gtk_aspect_frame_get_child (GTK_ASPECT_FRAME (frame));
gtk_widget_grab_focus (grid); gtk_widget_grab_focus (grid);
} }