color.blue=0x0000;
compass->gc_h=gdk_gc_new(widget->window);
gdk_gc_set_rgb_fg_color(compass->gc_h, &color);
- gdk_gc_set_line_attributes(compass->gc_h, 6, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND);
+ gdk_gc_set_line_attributes(compass->gc_h, 2, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND);
}
if (!compass->gc_d) {
compass->width, compass->height);
gdk_draw_layout(widget->window,
- widget->style->fg_gc[GTK_STATE_NORMAL],
+ compass->gc_h,
compass->xoffset+size/2-x/2,
compass->yoffset+size-y-2, compass->layout);
gdk_draw_arc(widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
+ compass->gc_h,
FALSE,
compass->xoffset, compass->yoffset+size/2, size, size, 0, 64 * 180);
/* Simple arrow for heading */
gdk_draw_line(widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
+ compass->gc_h,
compass->xoffset + size / 2 + 3,
compass->yoffset + size - y - 5,
compass->xoffset + size / 2, compass->yoffset + size / 2 + 5);
gdk_draw_line(widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
+ compass->gc_h,
compass->xoffset + size / 2 - 3,
compass->yoffset + size - y - 5,
compass->xoffset + size / 2, compass->yoffset + size / 2 + 5);
gdk_draw_line(widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
+ compass->gc_h,
compass->xoffset + size / 2 - 3,
compass->yoffset + size - y - 5,
compass->xoffset + size / 2, compass->yoffset + size - y - 8);
gdk_draw_line(widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
+ compass->gc_h,
compass->xoffset + size / 2 + 3,
compass->yoffset + size - y - 5,
compass->xoffset + size / 2, compass->yoffset + size - y - 8);
tmp = ((dir - compass->data->heading) * (1.f / 180.f)) * G_PI;
- gtk_compass_draw_mark(compass, widget->style->fg_gc[GTK_WIDGET_STATE(widget)], tmp, 6);
+ gtk_compass_draw_mark(compass, compass->gc_h, tmp, 6);
x = fsize[i];
if (abs((guint) (compass->data->heading / 45) * 45 - compass->data->heading)
pango_matrix_rotate (&matrix, -(dir-compass->data->heading));
pango_context_set_matrix (compass->context, &matrix);
pango_layout_get_pixel_size(compass->layout, &x, &y);
- x = compass->xoffset + size / 2 + ((size / 2 + 15) * sinf(tmp)) - x / 2,
- y = compass->yoffset + size - ((size / 2 + 15) * cosf(tmp)) - y / 2,
- gdk_draw_layout(widget->window, widget->style->fg_gc[GTK_STATE_NORMAL], x, y, compass->layout);
+ x = compass->xoffset + size / 2 + ((size / 2 + 15 + fs) * sinf(tmp)) - x / 2,
+ y = compass->yoffset + size - ((size / 2 + 15 + fs) * cosf(tmp)) - y / 2,
+ gdk_draw_layout(widget->window, compass->gc_h, x, y, compass->layout);
}
if (compass->dest_valid)