struct graphics_gc_priv {
GdkGC *gc;
struct graphics_priv *gr;
+ int level;
};
struct graphics_image_priv {
gdkc.green=c->g;
gdkc.blue=c->b;
gdk_colormap_alloc_color(gc->gr->colormap, &gdkc, FALSE, TRUE);
- if (fg)
+ if (fg) {
gdk_gc_set_foreground(gc->gc, &gdkc);
- else
+ gc->level=(c->r+c->g+c->b)/3;
+ } else
gdk_gc_set_background(gc->gc, &gdkc);
}
if (! font)
return;
if (bg) {
- gdk_gc_set_function(fg->gc, GDK_AND_INVERT);
- gdk_gc_set_function(bg->gc, GDK_OR);
+ if (bg->level > 32767) {
+ gdk_gc_set_function(fg->gc, GDK_AND_INVERT);
+ gdk_gc_set_function(bg->gc, GDK_OR);
+ } else {
+ gdk_gc_set_function(fg->gc, GDK_OR);
+ gdk_gc_set_function(bg->gc, GDK_AND_INVERT);
+ }
}
t=display_text_render(text, font, dx, dy, p->x, p->y);
struct graphics_gc *background2;
struct graphics_gc *highlight_background;
struct graphics_gc *foreground;
+ struct graphics_gc *text_foreground;
+ struct graphics_gc *text_background;
int spacing;
int font_size;
int fullscreen;
struct point pnt=w->p;
gui_internal_background_render(this, w);
pnt.y+=w->h-this->spacing;
- graphics_draw_text(this->gra, this->foreground, NULL, this->font, w->text, &pnt, 0x10000, 0x0);
+ graphics_draw_text(this->gra, this->text_foreground, this->text_background, this->font, w->text, &pnt, 0x10000, 0x0);
}
static struct widget *
height=wc->h;
width+=wc->w;
if (wc->flags & flags_expand)
- expand+=wc->w;
+ expand+=wc->w ? wc->w : 1;
l=g_list_next(l);
if (l)
width+=w->spx;
width=wc->w;
height+=wc->h;
if (wc->flags & flags_expand)
- expand+=wc->h;
+ expand+=wc->h ? wc->h : 1;
l=g_list_next(l);
if (l)
height+=w->spy;
wc->p.x=x;
if (wc->flags & flags_fill)
wc->h=w->h;
- if (wc->flags & flags_expand)
+ if (wc->flags & flags_expand) {
+ if (! wc->w)
+ wc->w=1;
wc->w=wc->w*expand/100;
+ }
if (w->flags & gravity_top)
wc->p.y=y;
if (w->flags & gravity_ycenter)
wc->p.y=y;
if (wc->flags & flags_fill)
wc->w=w->w;
- if (wc->flags & flags_expand)
+ if (wc->flags & flags_expand) {
+ if (! wc->h)
+ wc->h=1;
wc->h=wc->h*expand/100;
+ }
if (w->flags & gravity_left)
wc->p.x=x;
if (w->flags & gravity_xcenter)
struct color cb2={0x4141,0x4141,0x4141,0xffff};
struct color cbh={0x9fff,0x9fff,0x9fff,0xffff};
struct color cf={0xbfff,0xbfff,0xbfff,0xffff};
+ struct color cw={0xffff,0xffff,0xffff,0xffff};
struct transformation *trans=navit_get_trans(this->nav);
win=graphics_get_data(gra, "window");
graphics_gc_set_foreground(this->highlight_background, &cbh);
this->foreground=graphics_gc_new(gra);
graphics_gc_set_foreground(this->foreground, &cf);
+ this->text_background=graphics_gc_new(gra);
+ graphics_gc_set_foreground(this->text_background, &cb);
+ this->text_foreground=graphics_gc_new(gra);
+ graphics_gc_set_foreground(this->text_foreground, &cw);
return 0;
}