mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Ben Hutchings' patch to allow Gtk windows to be shrunk as well as grown
(from Debian bug#379452). Tested on Gtk 2. I've been unable to find a Gtk+-1.2 installation on which Puzzles compiles, so not tested there. [originally from svn r7367]
This commit is contained in:
13
gtk.c
13
gtk.c
@ -1113,6 +1113,12 @@ static void resize_fe(frontend *fe)
|
|||||||
gtk_widget_size_request(GTK_WIDGET(fe->window), &req);
|
gtk_widget_size_request(GTK_WIDGET(fe->window), &req);
|
||||||
gtk_window_resize(GTK_WINDOW(fe->window), req.width, req.height);
|
gtk_window_resize(GTK_WINDOW(fe->window), req.width, req.height);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* Now that we've established the preferred size of the window,
|
||||||
|
* reduce the drawing area's size request so the user can shrink
|
||||||
|
* the window.
|
||||||
|
*/
|
||||||
|
gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void menu_preset_event(GtkMenuItem *menuitem, gpointer data)
|
static void menu_preset_event(GtkMenuItem *menuitem, gpointer data)
|
||||||
@ -1756,6 +1762,13 @@ static frontend *new_window(char *arg, int argtype, char **error)
|
|||||||
gtk_widget_show(fe->area);
|
gtk_widget_show(fe->area);
|
||||||
gtk_widget_show(fe->window);
|
gtk_widget_show(fe->window);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Now that we've established the preferred size of the window,
|
||||||
|
* reduce the drawing area's size request so the user can shrink
|
||||||
|
* the window.
|
||||||
|
*/
|
||||||
|
gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), 1, 1);
|
||||||
|
|
||||||
gdk_window_set_background(fe->area->window, &fe->colours[0]);
|
gdk_window_set_background(fe->area->window, &fe->colours[0]);
|
||||||
gdk_window_set_background(fe->window->window, &fe->colours[0]);
|
gdk_window_set_background(fe->window->window, &fe->colours[0]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user