* 'ui-tweaks' of https://github.com/nathansamson/diveclog:
  Some UI beauty patches:
This commit is contained in:
Linus Torvalds 2011-09-04 13:49:45 -07:00
commit e007e70053
2 changed files with 11 additions and 9 deletions

9
info.c
View file

@ -119,15 +119,15 @@ GtkWidget *dive_info_frame(void)
frame = gtk_frame_new("Dive info"); frame = gtk_frame_new("Dive info");
gtk_widget_show(frame); gtk_widget_show(frame);
vbox = gtk_vbox_new(TRUE, 5); vbox = gtk_vbox_new(TRUE, 6);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 3); gtk_container_set_border_width(GTK_CONTAINER(vbox), 3);
gtk_container_add(GTK_CONTAINER(frame), vbox); gtk_container_add(GTK_CONTAINER(frame), vbox);
hbox = gtk_hbox_new(TRUE, 5); hbox = gtk_hbox_new(TRUE, 6);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 3); gtk_container_set_border_width(GTK_CONTAINER(hbox), 3);
gtk_container_add(GTK_CONTAINER(vbox), hbox); gtk_container_add(GTK_CONTAINER(vbox), hbox);
hbox2 = gtk_hbox_new(FALSE, 0); hbox2 = gtk_hbox_new(FALSE, 6);
gtk_container_set_border_width(GTK_CONTAINER(hbox2), 3); gtk_container_set_border_width(GTK_CONTAINER(hbox2), 3);
gtk_container_add(GTK_CONTAINER(vbox), hbox2); gtk_container_add(GTK_CONTAINER(vbox), hbox2);
@ -185,9 +185,10 @@ GtkWidget *extended_dive_info_widget(void)
{ {
GtkWidget *vbox; GtkWidget *vbox;
vbox = gtk_vbox_new(FALSE, 5); vbox = gtk_vbox_new(FALSE, 6);
location = text_entry(vbox, "Location"); location = text_entry(vbox, "Location");
gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
notes = text_view(vbox, "Notes", TRUE); notes = text_view(vbox, "Notes", TRUE);
/* Add extended info here: name, description, yadda yadda */ /* Add extended info here: name, description, yadda yadda */

11
main.c
View file

@ -134,7 +134,7 @@ static void quit(GtkWidget *w, gpointer data)
} }
static GtkActionEntry menu_items[] = { static GtkActionEntry menu_items[] = {
{ "FileMenuAction", GTK_STOCK_FILE, "File", NULL, NULL, NULL}, { "FileMenuAction", GTK_STOCK_FILE, "Log", NULL, NULL, NULL},
{ "OpenFile", GTK_STOCK_OPEN, NULL, "<control>O", NULL, G_CALLBACK(file_open) }, { "OpenFile", GTK_STOCK_OPEN, NULL, "<control>O", NULL, G_CALLBACK(file_open) },
{ "SaveFile", GTK_STOCK_SAVE, NULL, "<control>S", NULL, G_CALLBACK(file_save) }, { "SaveFile", GTK_STOCK_SAVE, NULL, "<control>S", NULL, G_CALLBACK(file_save) },
{ "Quit", GTK_STOCK_QUIT, NULL, "<control>Q", NULL, G_CALLBACK(quit) }, { "Quit", GTK_STOCK_QUIT, NULL, "<control>Q", NULL, G_CALLBACK(quit) },
@ -147,6 +147,7 @@ static const gchar* ui_string = " \
<menu name=\"FileMenu\" action=\"FileMenuAction\"> \ <menu name=\"FileMenu\" action=\"FileMenuAction\"> \
<menuitem name=\"Open\" action=\"OpenFile\" /> \ <menuitem name=\"Open\" action=\"OpenFile\" /> \
<menuitem name=\"Save\" action=\"SaveFile\" /> \ <menuitem name=\"Save\" action=\"SaveFile\" /> \
<separator name=\"Seperator\"/> \
<menuitem name=\"Quit\" action=\"Quit\" /> \ <menuitem name=\"Quit\" action=\"Quit\" /> \
</menu> \ </menu> \
</menubar> \ </menubar> \
@ -217,16 +218,16 @@ int main(int argc, char **argv)
gtk_paned_add1(GTK_PANED(paned), divelist); gtk_paned_add1(GTK_PANED(paned), divelist);
/* VBox for dive info, and tabs */ /* VBox for dive info, and tabs */
info_box = gtk_vbox_new(FALSE, 5); info_box = gtk_vbox_new(FALSE, 6);
gtk_paned_add2(GTK_PANED(paned), info_box); gtk_paned_add2(GTK_PANED(paned), info_box);
/* Frame for minimal dive info */ /* Frame for minimal dive info */
frame = dive_info_frame(); frame = dive_info_frame();
gtk_box_pack_start(GTK_BOX(info_box), frame, FALSE, TRUE, 5); gtk_box_pack_start(GTK_BOX(info_box), frame, FALSE, TRUE, 6);
/* Notebook for dive info vs profile vs .. */ /* Notebook for dive info vs profile vs .. */
notebook = gtk_notebook_new(); notebook = gtk_notebook_new();
gtk_box_pack_start(GTK_BOX(info_box), notebook, TRUE, TRUE, 5); gtk_box_pack_start(GTK_BOX(info_box), notebook, TRUE, TRUE, 6);
/* Frame for dive profile */ /* Frame for dive profile */
dive_profile = dive_profile_widget(); dive_profile = dive_profile_widget();
@ -234,7 +235,7 @@ int main(int argc, char **argv)
/* Frame for extended dive info */ /* Frame for extended dive info */
dive_info = extended_dive_info_widget(); dive_info = extended_dive_info_widget();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dive_info, gtk_label_new("Extended dive Info")); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dive_info, gtk_label_new("Extended Dive Info"));
gtk_widget_set_app_paintable(win, TRUE); gtk_widget_set_app_paintable(win, TRUE);
gtk_widget_show_all(win); gtk_widget_show_all(win);