作図ソフト dia の改良版
Révision | 446a48ec2b74d36098832c04d0be092361d5a219 (tree) |
---|---|
l'heure | 2015-01-12 05:11:47 |
Auteur | Hans Breuer <hans@breu...> |
Commiter | Hans Breuer |
Move navigation button to top-left corner for integrated GUI
@@ -511,7 +511,7 @@ _ddisplay_setup_scrollbars (DDisplay *ddisp, GtkWidget *table, int width, int he | ||
511 | 511 | gtk_widget_show (ddisp->vsb); |
512 | 512 | } |
513 | 513 | static void |
514 | -_ddisplay_setup_navigation (DDisplay *ddisp, GtkWidget *table) | |
514 | +_ddisplay_setup_navigation (DDisplay *ddisp, GtkWidget *table, gboolean top_left) | |
515 | 515 | { |
516 | 516 | GtkWidget *navigation_button; |
517 | 517 |
@@ -522,8 +522,14 @@ _ddisplay_setup_navigation (DDisplay *ddisp, GtkWidget *table) | ||
522 | 522 | gtk_widget_show(navigation_button); |
523 | 523 | |
524 | 524 | /* harder to change position in the table, but we did not do it for years ;) */ |
525 | - gtk_table_attach (GTK_TABLE (table), navigation_button, 2, 3, 2, 3, | |
526 | - GTK_FILL, GTK_FILL, 0, 0); | |
525 | + if (top_left) | |
526 | + gtk_table_attach (GTK_TABLE (table), navigation_button, 0, 1, 0, 1, | |
527 | + GTK_FILL, GTK_FILL, 0, 0); | |
528 | + else | |
529 | + gtk_table_attach (GTK_TABLE (table), navigation_button, 2, 3, 2, 3, | |
530 | + GTK_FILL, GTK_FILL, 0, 0); | |
531 | + if (!ddisp->origin) | |
532 | + ddisp->origin = g_object_ref (navigation_button); | |
527 | 533 | } |
528 | 534 | /** |
529 | 535 | * @param ddisp The diagram display object that a window is created for |
@@ -599,9 +605,7 @@ use_integrated_ui_for_display_shell(DDisplay *ddisp, char *title) | ||
599 | 605 | gtk_box_pack_start( GTK_BOX(ddisp->container), table, TRUE, TRUE, 0 ); |
600 | 606 | |
601 | 607 | /* scrollbars, rulers, canvas, menu popup button */ |
602 | - ddisp->origin = gtk_frame_new (NULL); | |
603 | - gtk_frame_set_shadow_type (GTK_FRAME (ddisp->origin), GTK_SHADOW_OUT); | |
604 | - | |
608 | + ddisp->origin = NULL; | |
605 | 609 | _ddisplay_setup_rulers (ddisp, ddisp->container, table); |
606 | 610 | |
607 | 611 | /* Get the width/height of the Notebook child area */ |
@@ -609,13 +613,11 @@ use_integrated_ui_for_display_shell(DDisplay *ddisp, char *title) | ||
609 | 613 | width = 100; |
610 | 614 | height = 100; |
611 | 615 | _ddisplay_setup_scrollbars (ddisp, table, width, height); |
612 | - _ddisplay_setup_navigation (ddisp, table); | |
616 | + _ddisplay_setup_navigation (ddisp, table, TRUE); | |
613 | 617 | |
614 | 618 | ddisp->canvas = create_canvas (ddisp); |
615 | 619 | |
616 | - /* place all remaining widgets */ | |
617 | - gtk_table_attach (GTK_TABLE (table), ddisp->origin, 0, 1, 0, 1, | |
618 | - GTK_FILL, GTK_FILL, 0, 0); | |
620 | + /* place all remaining widgets (no 'origin' anymore, since navigation is top-left */ | |
619 | 621 | gtk_table_attach (GTK_TABLE (table), ddisp->canvas, 1, 2, 1, 2, |
620 | 622 | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
621 | 623 | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
@@ -745,7 +747,7 @@ create_display_shell(DDisplay *ddisp, | ||
745 | 747 | |
746 | 748 | _ddisplay_setup_rulers (ddisp, ddisp->shell, table); |
747 | 749 | _ddisplay_setup_scrollbars (ddisp, table, width, height); |
748 | - _ddisplay_setup_navigation (ddisp, table); | |
750 | + _ddisplay_setup_navigation (ddisp, table, FALSE); | |
749 | 751 | |
750 | 752 | ddisp->canvas = create_canvas (ddisp); |
751 | 753 |
@@ -760,8 +762,7 @@ create_display_shell(DDisplay *ddisp, | ||
760 | 762 | ddisp->accel_group = menus_get_display_accels (); |
761 | 763 | gtk_window_add_accel_group(GTK_WINDOW(ddisp->shell), ddisp->accel_group); |
762 | 764 | |
763 | - if (use_mbar) | |
764 | - { | |
765 | + if (use_mbar) { | |
765 | 766 | ddisp->menu_bar = menus_create_display_menubar (&ddisp->ui_manager, &ddisp->actions); |
766 | 767 | g_assert (ddisp->menu_bar); |
767 | 768 | gtk_box_pack_start (GTK_BOX (root_vbox), ddisp->menu_bar, FALSE, TRUE, 0); |