const gchar *name;
};
+#define QPBS_X (4)
+#define QPBS_Y (3)
+#define POI_QUICK_BUTTONS (QPBS_X*QPBS_Y)
+
static struct _quick_poi_categories quick_poi_categories[] = {
{ NODE_AMENITY_SPEEDCAM, "Speedcam", },
{ NODE_AMENITY_FUEL, "Fuel", },
{ NODE_AMENITY_PARKING, "Parking", },
+ { NODE_AMENITY_TAXI, "Taxi", },
{ NODE_AMENITY_PUB, "Pub", },
{ NODE_AMENITY_CAFE, "Cafe", },
- { NODE_AMENITY_FOOD, "Food", },
+ { NODE_AMENITY_FOOD, "Fast Food", },
+ { NODE_AMENITY_RESTAURANT, "Restaurant", },
{ NODE_AMENITY_SHOP, "Shop", },
{ NODE_AMENITY_BANK, "Bank", },
{ NODE_AMENITY_ATM, "ATM", },
+ { NODE_AMENITY_POST_BOX, "Post box", },
};
static poi_quick_data qp;
}
}
-#define QPBS_X (3)
-#define QPBS_Y (3)
-#define POI_QUICK_BUTTONS (QPBS_X*QPBS_Y)
-
/**
* Return a vbox filled with POI_QUICK_BUTTONS POI buttons and one for other POI,
* with an optinal POI label.
GtkWidget *table, *vbox;
GtkWidget *buttons[POI_QUICK_BUTTONS];
GtkWidget *otherbtn;
-guint x,y;
+guint x, y;
-vbox=gtk_vbox_new(FALSE, 3);
-table = gtk_table_new(QPBS_X, QPBS_Y, FALSE);
+vbox=gtk_vbox_new(FALSE, 6);
+table = gtk_table_new(QPBS_Y, QPBS_X, TRUE);
gtk_table_set_col_spacings(GTK_TABLE(table), 6);
gtk_table_set_row_spacings(GTK_TABLE(table), 6);
-gtk_table_set_homogeneous(GTK_TABLE(table), TRUE);
-for (x=0;x<QPBS_X;x++) {
- for (y=0;y<QPBS_Y;y++) {
- guint p=x+y*QPBS_Y;
+for (y=0;y<QPBS_Y;y++) {
+ for (x=0;x<QPBS_X;x++) {
+ guint p=y*(QPBS_X)+x;
+ g_debug("B: %d (%d,%d)", p, x, y);
buttons[p]=gtk_button_new_with_label(quick_poi_categories[p].name);
poi_button_set_icon(buttons[p], quick_poi_categories[p].type);
- gtk_table_attach(GTK_TABLE(table), buttons[p], x, x+1, y, y+1, GTK_FILL, 0, 2, 4);
+ gtk_table_attach(GTK_TABLE(table), buttons[p], x, x+1, y, y+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 6);
g_object_set_data(G_OBJECT(buttons[p]), "pid", GINT_TO_POINTER(quick_poi_categories[p].type));
g_signal_connect(G_OBJECT(buttons[p]), "clicked", G_CALLBACK(poi_quick_button_cb), qpdata);
}
/* Other POI button */
otherbtn=gtk_button_new_with_label("Other POI");
poi_button_set_icon(otherbtn, NODE_AMENITY_GENERIC);
-gtk_box_pack_start(GTK_BOX(vbox), otherbtn, TRUE, TRUE, 0);
+gtk_box_pack_start(GTK_BOX(vbox), otherbtn, TRUE, FALSE, 6);
g_object_set_data(G_OBJECT(otherbtn), "pid", GINT_TO_POINTER(NODE_AMENITY_GENERIC));
g_signal_connect(G_OBJECT(otherbtn), "clicked", G_CALLBACK(poi_quick_button_cb), qpdata);
-gtk_box_pack_start(GTK_BOX(vbox), qpdata->label = gtk_entry_new(), TRUE, TRUE, 0);
+gtk_box_pack_start(GTK_BOX(vbox), qpdata->label = gtk_entry_new(), TRUE, FALSE, 0);
return vbox;
}