X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/0eb4d76e8f053158cd4578c7b3ff678a92ba96ae..9b185b04d84ce479f224700d1dc83497719e22df:/gtk.c diff --git a/gtk.c b/gtk.c index 802c42e..07f2535 100644 --- a/gtk.c +++ b/gtk.c @@ -116,7 +116,6 @@ struct frontend { GtkWidget *cfgbox; void *paste_data; int paste_data_len; - char *laststatus; int pw, ph; /* pixmap size (w, h are area size) */ int ox, oy; /* offset of pixmap in drawing area */ char *filesel_name; @@ -141,19 +140,11 @@ void frontend_default_colour(frontend *fe, float *output) void gtk_status_bar(void *handle, char *text) { frontend *fe = (frontend *)handle; - char *rewritten; assert(fe->statusbar); - rewritten = midend_rewrite_statusbar(fe->me, text); - if (!fe->laststatus || strcmp(rewritten, fe->laststatus)) { - gtk_statusbar_pop(GTK_STATUSBAR(fe->statusbar), fe->statusctx); - gtk_statusbar_push(GTK_STATUSBAR(fe->statusbar), fe->statusctx, rewritten); - sfree(fe->laststatus); - fe->laststatus = rewritten; - } else { - sfree(rewritten); - } + gtk_statusbar_pop(GTK_STATUSBAR(fe->statusbar), fe->statusctx); + gtk_statusbar_push(GTK_STATUSBAR(fe->statusbar), fe->statusctx, text); } void gtk_start_draw(void *handle) @@ -290,6 +281,8 @@ void gtk_draw_text(void *handle, int x, int y, int fonttype, int fontsize, if (align & ALIGN_VCENTRE) rect.y -= rect.height / 2; + else + rect.y -= rect.height; if (align & ALIGN_HCENTRE) rect.x -= rect.width / 2; @@ -317,6 +310,8 @@ void gtk_draw_text(void *handle, int x, int y, int fonttype, int fontsize, &lb, &rb, &wid, &asc, &desc); if (align & ALIGN_VCENTRE) y += asc - (asc+desc)/2; + else + y += asc; /* * ... but horizontal extents with respect to the provided @@ -1666,8 +1661,6 @@ static frontend *new_window(char *arg, char **error) fe->fonts = NULL; fe->nfonts = fe->fontsize = 0; - fe->laststatus = NULL; - fe->paste_data = NULL; fe->paste_data_len = 0;