mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Wrap the status bar in a viewport, to avoid it expanding if the text
doesn't fit in it. This not only looked ugly, but caused unnecessary calls to configure_area() and kept destroying the pixmap. [originally from svn r4180]
This commit is contained in:
16
gtk.c
16
gtk.c
@ -510,13 +510,25 @@ static frontend *new_window(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (midend_wants_statusbar(fe->me)) {
|
if (midend_wants_statusbar(fe->me)) {
|
||||||
|
GtkWidget *viewport;
|
||||||
|
GtkRequisition req;
|
||||||
|
|
||||||
|
viewport = gtk_viewport_new(NULL, NULL);
|
||||||
|
gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_NONE);
|
||||||
fe->statusbar = gtk_statusbar_new();
|
fe->statusbar = gtk_statusbar_new();
|
||||||
gtk_box_pack_end(vbox, fe->statusbar, FALSE, FALSE, 0);
|
gtk_container_add(GTK_CONTAINER(viewport), fe->statusbar);
|
||||||
|
gtk_widget_show(viewport);
|
||||||
|
gtk_box_pack_end(vbox, viewport, FALSE, FALSE, 0);
|
||||||
gtk_widget_show(fe->statusbar);
|
gtk_widget_show(fe->statusbar);
|
||||||
fe->statusctx = gtk_statusbar_get_context_id
|
fe->statusctx = gtk_statusbar_get_context_id
|
||||||
(GTK_STATUSBAR(fe->statusbar), "game");
|
(GTK_STATUSBAR(fe->statusbar), "game");
|
||||||
gtk_statusbar_push(GTK_STATUSBAR(fe->statusbar), fe->statusctx,
|
gtk_statusbar_push(GTK_STATUSBAR(fe->statusbar), fe->statusctx,
|
||||||
"");
|
"test");
|
||||||
|
gtk_widget_size_request(fe->statusbar, &req);
|
||||||
|
#if 0
|
||||||
|
/* For GTK 2.0, should we be using gtk_widget_set_size_request? */
|
||||||
|
#endif
|
||||||
|
gtk_widget_set_usize(viewport, x, req.height);
|
||||||
} else
|
} else
|
||||||
fe->statusbar = NULL;
|
fe->statusbar = NULL;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user