gps->width=300;
if (gps->display_mode==GTK_GPS_MODE_SKY) {
- requisition->height=300;
- gps->height=300;
+ requisition->height=400;
+ gps->height=400;
} else {
requisition->height=200;
gps->height=200;
gdk_window_set_user_data(widget->window, widget);
gtk_style_set_background(widget->style, widget->window, GTK_STATE_ACTIVE);
+/* No fix */
if (!gps->gc_s) {
color.red=0;
color.green=0;
- color.blue=0;
+ color.blue=0x1000;
gps->gc_s=gdk_gc_new(widget->window);
gdk_gc_set_rgb_fg_color(gps->gc_s, &color);
}
+/* Fix color */
if (!gps->gc_sf) {
color.red=0;
- color.green=0xffff;
+ color.green=0xdfff;
color.blue=0;
gps->gc_sf=gdk_gc_new(widget->window);
gdk_gc_set_rgb_fg_color(gps->gc_sf, &color);
xoffset + 5, yoffset + bymargin - 1,
xoffset + gps->width - 10 - 2, yoffset + bymargin - 1);
-if (gps->data->satinview > 0) {
- /* Left margin - 5pix, Right margin - 5pix */
- step = (gps->width - 10) / gps->data->satinview;
-
- for (i = 0; i < gps->data->satinview; i++) {
- /* Sat used or not */
- 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;
- y = gps->height * 0.1f + (gps->height * 0.78f - snr_height);
-
- /* draw sat rectangle... */
- gdk_draw_rectangle(widget->window,
- gc, TRUE,
- xoffset + x,
- yoffset + y, step - 2, snr_height);
-
- if (gps->data->sat[i].snr > 0) {
- /* ...snr.. */
- g_snprintf(tmp, 32, "%02d", gps->data->sat[i].snr);
- pango_layout_set_text(gps->layout, tmp, 2);
- pango_layout_get_pixel_size(gps->layout, &x1, &y1);
- gdk_draw_layout(widget->window,
- widget->style->fg_gc[GTK_STATE_NORMAL],
- xoffset + x + ((step - 2) - x1) / 2,
- yoffset + y - 15,
- gps->layout);
- }
-
- /* ...and sat number */
- g_snprintf(tmp, 32, "%02d", gps->data->sat[i].prn);
+if (gps->data->satinview==0)
+ return;
+
+/* Left margin - 5pix, Right margin - 5pix */
+step = (gps->width - 10) / gps->data->satinview;
+
+for (i=0;i<gps->data->satinview;i++) {
+ /* Sat used or not */
+ 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;
+ y = gps->height * 0.1f + (gps->height * 0.78f - snr_height);
+
+ /* draw sat rectangle... */
+ gdk_draw_rectangle(widget->window,
+ gc, TRUE,
+ xoffset + x,
+ yoffset + y, step - 2, snr_height);
+
+ if (gps->data->sat[i].snr>0) {
+ /* ...snr.. */
+ g_snprintf(tmp, 32, "%02d", gps->data->sat[i].snr);
pango_layout_set_text(gps->layout, tmp, 2);
pango_layout_get_pixel_size(gps->layout, &x1, &y1);
gdk_draw_layout(widget->window,
widget->style->fg_gc[GTK_STATE_NORMAL],
xoffset + x + ((step - 2) - x1) / 2,
- yoffset + bymargin + 1,
+ yoffset + y - 15,
gps->layout);
}
+
+ /* ...and sat number */
+ g_snprintf(tmp, 32, "%02d", gps->data->sat[i].prn);
+ pango_layout_set_text(gps->layout, tmp, 2);
+ pango_layout_get_pixel_size(gps->layout, &x1, &y1);
+ gdk_draw_layout(widget->window,
+ widget->style->fg_gc[GTK_STATE_NORMAL],
+ xoffset + x + ((step - 2) - x1) / 2,
+ yoffset + bymargin + 1,
+ gps->layout);
}
-return;
}
static void