{
g_printf("%s()\n", __PRETTY_FUNCTION__);
-gps->gc1=NULL;
-gps->gc2=NULL;
-gps->gc3=NULL;
+gps->gc_w=NULL;
+gps->gc_s=NULL;
+gps->gc_sf=NULL;
gps->width=300;
gps->height=300;
gps->size=300;
gps->size=MIN(gps->width, gps->height);
gps->fs=gps->size/20;
-BOUND(gps->fs,8,20);
+BOUND(gps->fs, 8, 20);
-pango_font_description_set_size(gps->fontdesc, gps->fs*PANGO_SCALE);
+pango_font_description_set_size(gps->fontdesc, (gps->fs-1)*PANGO_SCALE);
pango_layout_set_font_description(gps->layout, gps->fontdesc);
}
gdk_window_set_user_data(widget->window, widget);
gtk_style_set_background(widget->style, widget->window, GTK_STATE_ACTIVE);
-if (!gps->gc1) {
+if (!gps->gc_s) {
color.red=0;
color.green=0;
color.blue=0;
- gps->gc1=gdk_gc_new(widget->window);
- gdk_gc_set_rgb_fg_color(gps->gc1, &color);
+ gps->gc_s=gdk_gc_new(widget->window);
+ gdk_gc_set_rgb_fg_color(gps->gc_s, &color);
}
-if (!gps->gc2) {
+if (!gps->gc_sf) {
color.red=0;
- color.green=0;
- color.blue=0xffff;
- gps->gc2=gdk_gc_new(widget->window);
- gdk_gc_set_rgb_fg_color(gps->gc2, &color);
+ color.green=0xffff;
+ color.blue=0;
+ gps->gc_sf=gdk_gc_new(widget->window);
+ gdk_gc_set_rgb_fg_color(gps->gc_sf, &color);
}
-if (!gps->gc3) {
+if (!gps->gc_w) {
color.red=0xffff;
color.green=0xffff;
color.blue=0xffff;
- gps->gc3=gdk_gc_new(widget->window);
- gdk_gc_set_rgb_fg_color(gps->gc3, &color);
+ gps->gc_w=gdk_gc_new(widget->window);
+ gdk_gc_set_rgb_fg_color(gps->gc_w, &color);
}
}
for (i=0;i<gps->data->satinview;i++) {
/* Sat used or not */
- gc=(gps->data->sat[i].fix) ? gps->gc2 : gps->gc1;
+ gc=(gps->data->sat[i].fix) ? gps->gc_sf : gps->gc_s;
tmp = (gps->data->sat[i].azimuth * (1.f / 180.f)) * G_PI;
x = xoffset + halfsize + (90 - gps->data->sat[i].elevation) * halfsize / 90 * sinf(tmp);
y = yoffset + halfsize - (90 - gps->data->sat[i].elevation) * halfsize / 90 * cosf(tmp);
- gdk_draw_arc(widget->window, gc, TRUE, x-gps->fs, y-gps->fs, gps->fs+3, gps->fs+3, 0, 64 * 360);
+ gdk_draw_arc(widget->window, gc, TRUE, x-gps->fs, y-gps->fs, gps->fs+4, gps->fs+4, 0, 64 * 360);
g_snprintf(buffer, 6, "%02d", gps->data->sat[i].prn);
pango_layout_set_text(gps->layout, buffer, -1);
pango_layout_get_pixel_size(gps->layout, &x1, &y1);
- gdk_draw_layout(widget->window, gps->gc3, x - x1 / 2, y - y1 / 2, gps->layout);
+ gdk_draw_layout(widget->window, gps->gc_w, x-gps->fs/2-x1/2, y-gps->fs/2-y1/2, gps->layout);
}
return;
if (!GTK_WIDGET_MAPPED(widget))
return;
-xoffset = 0;
-yoffset = 0;
+xoffset=0;
+yoffset=0;
/* Bootom margin - 12% */
bymargin = gps->height * 0.88f;
+gtk_paint_flat_box (widget->style,
+ widget->window,
+ GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+ NULL, widget, "trough", 0, 0,
+ gps->width, gps->height);
+
/* Bottom line */
gdk_draw_line(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
for (i = 0; i < gps->data->satinview; i++) {
/* Sat used or not */
- gc=(gps->data->sat[i].fix) ? gps->gc1 : gps->gc2;
+ gc=(gps->data->sat[i].fix) ? gps->gc_sf : gps->gc_s;
x = 5 + i * step;
snr_height = gps->data->sat[i].snr * gps->height * 0.78f / 100;