diff --git a/ChangeLog b/ChangeLog index f877582fd0..ff2a75f90f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2006-12-12 Sven Neumann + + * app/display/gimpdisplayshell.c (gimp_display_shell_new): + slightly increased size of the quick-mask and zoom-mode buttons. + Also changed the style to not displace the icon when the buttons + are pressed. + + * app/display/gimpdisplayshell.[ch] + * app/display/gimpdisplayshell-appearance.c: changed "origin_button" + to "origin". Don't draw it as a button but use an event box just + like we do for the navigation icon in the lower right corner. + + * app/display/gimpdisplayshell-title.c + (gimp_display_shell_format_title): use the viewable description + for the drawable's name. We don't want to see "Qmask" in the + statusbar. + + * app/widgets/gimpwidgets-utils.c (gimp_button_menu_position): fix + for the case where button is not really a GtkButton but has it's + own window. + + * app/widgets/gimphelp-ids.h: changed help ID, removed unused one. + + * libgimpwidgets/gimpstock.c + * themes/Default/images/Makefile.am + * themes/Default/images/stock-quick-mask-off-12.png + * themes/Default/images/stock-quick-mask-off-16.png + * themes/Default/images/stock-quick-mask-on-12.png + * themes/Default/images/stock-quick-mask-on-16.png: cropped empty + space from the quick-mask icon. + 2006-12-12 Sven Neumann * app/display/gimpstatusbar.c: only show the Cancel button while diff --git a/app/display/gimpdisplayshell-appearance.c b/app/display/gimpdisplayshell-appearance.c index 7aaf22856f..e3438b7153 100644 --- a/app/display/gimpdisplayshell-appearance.c +++ b/app/display/gimpdisplayshell-appearance.c @@ -137,7 +137,7 @@ gimp_display_shell_set_show_rulers (GimpDisplayShell *shell, if (show) { - gtk_widget_show (shell->origin_button); + gtk_widget_show (shell->origin); gtk_widget_show (shell->hrule); gtk_widget_show (shell->vrule); @@ -146,7 +146,7 @@ gimp_display_shell_set_show_rulers (GimpDisplayShell *shell, } else { - gtk_widget_hide (shell->origin_button); + gtk_widget_hide (shell->origin); gtk_widget_hide (shell->hrule); gtk_widget_hide (shell->vrule); diff --git a/app/display/gimpdisplayshell-title.c b/app/display/gimpdisplayshell-title.c index ef70559382..e41f683102 100644 --- a/app/display/gimpdisplayshell-title.c +++ b/app/display/gimpdisplayshell-title.c @@ -324,10 +324,18 @@ gimp_display_shell_format_title (GimpDisplayShell *shell, GimpDrawable *drawable = gimp_image_active_drawable (image); if (drawable) - i += print (title, title_len, i, "%s", - gimp_object_get_name (GIMP_OBJECT (drawable))); + { + gchar *desc; + + desc = gimp_viewable_get_description (GIMP_VIEWABLE (drawable), NULL); + i += print (title, title_len, i, "%s", desc); + + g_free (desc); + } else - i += print (title, title_len, i, "%s", _("(none)")); + { + i += print (title, title_len, i, "%s", _("(none)")); + } } break; diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 40f248078d..74b9645744 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -137,8 +137,14 @@ static const gchar display_rc_style[] = " GtkMenuBar::shadow-type = none\n" " GtkMenuBar::internal-padding = 0\n" "}\n" - "widget \"*.gimp-menubar-fullscreen\" style \"fullscreen-menubar-style\""; - + "widget \"*.gimp-menubar-fullscreen\" style \"fullscreen-menubar-style\"\n" + "\n" + "style \"check-button-style\"\n" + "{\n" + " GtkToggleButton::child-displacement-x = 0\n" + " GtkToggleButton::child-displacement-y = 0\n" + "}\n" + "widget \"*\" style \"check-button-style\""; static void gimp_display_shell_class_init (GimpDisplayShellClass *klass) @@ -240,7 +246,7 @@ gimp_display_shell_init (GimpDisplayShell *shell) shell->hrule = NULL; shell->vrule = NULL; - shell->origin_button = NULL; + shell->origin = NULL; shell->quick_mask_button = NULL; shell->zoom_button = NULL; shell->nav_ebox = NULL; @@ -526,7 +532,7 @@ gimp_display_shell_popup_menu (GtkWidget *widget) gimp_ui_manager_ui_popup (shell->popup_manager, "/dummy-menubar/image-popup", GTK_WIDGET (shell), gimp_display_shell_menu_position, - shell->origin_button, + shell->origin, NULL, NULL); return TRUE; @@ -828,19 +834,16 @@ gimp_display_shell_new (GimpDisplay *display, /* create the contents of the inner_table ********************************/ /* the menu popup button */ - shell->origin_button = gtk_button_new (); - GTK_WIDGET_UNSET_FLAGS (shell->origin_button, GTK_CAN_FOCUS); - + shell->origin = gtk_event_box_new (); image = gtk_image_new_from_stock (GIMP_STOCK_MENU_RIGHT, GTK_ICON_SIZE_MENU); - gtk_container_add (GTK_CONTAINER (shell->origin_button), image); + gtk_container_add (GTK_CONTAINER (shell->origin), image); gtk_widget_show (image); - g_signal_connect (shell->origin_button, "button-press-event", + g_signal_connect (shell->origin, "button-press-event", G_CALLBACK (gimp_display_shell_origin_button_press), shell); - gimp_help_set_help_data (shell->origin_button, NULL, - GIMP_HELP_IMAGE_WINDOW_ORIGIN_BUTTON); + gimp_help_set_help_data (shell->origin, NULL, GIMP_HELP_IMAGE_WINDOW_ORIGIN); shell->canvas = gimp_canvas_new (); @@ -934,9 +937,11 @@ gimp_display_shell_new (GimpDisplay *display, shell); /* create the contents of the right_vbox *********************************/ - shell->zoom_button = gtk_check_button_new (); - gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (shell->zoom_button), FALSE); - gtk_widget_set_size_request (GTK_WIDGET (shell->zoom_button), 16, 16); + shell->zoom_button = g_object_new (GTK_TYPE_CHECK_BUTTON, + "draw-indicator", FALSE, + "width-request", 18, + "height-request", 18, + NULL); GTK_WIDGET_UNSET_FLAGS (shell->zoom_button, GTK_CAN_FOCUS); image = gtk_image_new_from_stock (GIMP_STOCK_ZOOM_FOLLOW_WINDOW, @@ -955,10 +960,11 @@ gimp_display_shell_new (GimpDisplay *display, /* create the contents of the lower_hbox *********************************/ /* the quick mask button */ - shell->quick_mask_button = gtk_check_button_new (); - gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (shell->quick_mask_button), - FALSE); - gtk_widget_set_size_request (GTK_WIDGET (shell->quick_mask_button), 16, 16); + shell->quick_mask_button = g_object_new (GTK_TYPE_CHECK_BUTTON, + "draw-indicator", FALSE, + "width-request", 18, + "height-request", 18, + NULL); GTK_WIDGET_UNSET_FLAGS (shell->quick_mask_button, GTK_CAN_FOCUS); image = gtk_image_new_from_stock (GIMP_STOCK_QUICK_MASK_OFF, @@ -1006,7 +1012,7 @@ gimp_display_shell_new (GimpDisplay *display, /* pack all the widgets **************************************************/ /* fill the inner_table */ - gtk_table_attach (GTK_TABLE (inner_table), shell->origin_button, 0, 1, 0, 1, + gtk_table_attach (GTK_TABLE (inner_table), shell->origin, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); gtk_table_attach (GTK_TABLE (inner_table), shell->hrule, 1, 2, 0, 1, GTK_EXPAND | GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0); @@ -1031,7 +1037,7 @@ gimp_display_shell_new (GimpDisplay *display, if (shell->options->show_rulers) { - gtk_widget_show (shell->origin_button); + gtk_widget_show (shell->origin); gtk_widget_show (shell->hrule); gtk_widget_show (shell->vrule); } diff --git a/app/display/gimpdisplayshell.h b/app/display/gimpdisplayshell.h index d5443fe5ec..0c708eb36f 100644 --- a/app/display/gimpdisplayshell.h +++ b/app/display/gimpdisplayshell.h @@ -108,7 +108,7 @@ struct _GimpDisplayShell GtkWidget *hrule; /* rulers */ GtkWidget *vrule; - GtkWidget *origin_button; /* NW: origin button */ + GtkWidget *origin; /* NW: origin */ GtkWidget *quick_mask_button; /* SW: quick mask button */ GtkWidget *zoom_button; /* NE: zoom toggle button */ GtkWidget *nav_ebox; /* SE: navigation event box */ diff --git a/app/widgets/gimphelp-ids.h b/app/widgets/gimphelp-ids.h index 2a698a9e3b..2f0b8c995d 100644 --- a/app/widgets/gimphelp-ids.h +++ b/app/widgets/gimphelp-ids.h @@ -99,8 +99,7 @@ #define GIMP_HELP_VIEW_CHANGE_SCREEN "gimp-view-change-screen" #define GIMP_HELP_IMAGE_WINDOW "gimp-image-window" -#define GIMP_HELP_IMAGE_WINDOW_ORIGIN_BUTTON "gimp-image-window-origin-button" -#define GIMP_HELP_IMAGE_WINDOW_PADDING_BUTTON "gimp-image-window-padding-button" +#define GIMP_HELP_IMAGE_WINDOW_ORIGIN "gimp-image-window-origin" #define GIMP_HELP_IMAGE_WINDOW_ZOOM_FOLLOW_BUTTON "gimp-image-window-zoom-follow-button" #define GIMP_HELP_IMAGE_WINDOW_QUICK_MASK_BUTTON "gimp-image-window-quick-mask-button" #define GIMP_HELP_IMAGE_WINDOW_NAV_BUTTON "gimp-image-window-nav-button" diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c index 0e573fe3d0..2245846972 100644 --- a/app/widgets/gimpwidgets-utils.c +++ b/app/widgets/gimpwidgets-utils.c @@ -173,7 +173,8 @@ gimp_button_menu_position (GtkWidget *button, gtk_menu_set_screen (menu, screen); - *x += button->allocation.x; + if (GTK_WIDGET_NO_WINDOW (button)) + *x += button->allocation.x; switch (position) { @@ -194,10 +195,14 @@ gimp_button_menu_position (GtkWidget *button, break; } - *y += button->allocation.y + button->allocation.height / 2; + if (GTK_WIDGET_NO_WINDOW (button)) + *y += button->allocation.y; + + *y += button->allocation.height / 2; if (*y + menu_requisition.height > rect.y + rect.height) *y -= menu_requisition.height; + if (*y < rect.y) *y = rect.y; } diff --git a/devel-docs/libgimpwidgets/tmpl/gimpstock.sgml b/devel-docs/libgimpwidgets/tmpl/gimpstock.sgml index 1bb15fd0be..ec711e8571 100644 --- a/devel-docs/libgimpwidgets/tmpl/gimpstock.sgml +++ b/devel-docs/libgimpwidgets/tmpl/gimpstock.sgml @@ -158,14 +158,14 @@ RTL variant - + - + diff --git a/libgimpwidgets/gimpstock.c b/libgimpwidgets/gimpstock.c index 5665f9ac02..a7a70d33c3 100644 --- a/libgimpwidgets/gimpstock.c +++ b/libgimpwidgets/gimpstock.c @@ -562,10 +562,10 @@ gimp_stock_menu_pixbufs[] = { GIMP_STOCK_SELECTION_BORDER, stock_selection_border_16 }, { GIMP_STOCK_NAVIGATION, stock_navigation_16 }, - { GIMP_STOCK_QUICK_MASK_OFF, stock_quick_mask_off_16 }, - { GIMP_STOCK_QUICK_MASK_ON, stock_quick_mask_on_16 }, - { "gimp-qmask-off", /* compat */ stock_quick_mask_off_16 }, - { "gimp-qmask-on", /* compat */ stock_quick_mask_on_16 }, + { GIMP_STOCK_QUICK_MASK_OFF, stock_quick_mask_off_12 }, + { GIMP_STOCK_QUICK_MASK_ON, stock_quick_mask_on_12 }, + { "gimp-qmask-off", /* compat */ stock_quick_mask_off_12 }, + { "gimp-qmask-on", /* compat */ stock_quick_mask_on_12 }, { GIMP_STOCK_LIST, stock_list_16 }, { GIMP_STOCK_GRID, stock_grid_16 }, diff --git a/themes/Default/images/Makefile.am b/themes/Default/images/Makefile.am index ef3cf078af..1297d967ac 100644 --- a/themes/Default/images/Makefile.am +++ b/themes/Default/images/Makefile.am @@ -90,8 +90,8 @@ STOCK_MENU_IMAGES = \ stock-plugin-16.png \ stock-portrait-16.png \ stock-print-resolution-16.png \ - stock-quick-mask-off-16.png \ - stock-quick-mask-on-16.png \ + stock-quick-mask-off-12.png \ + stock-quick-mask-on-12.png \ stock-reshow-filter-16.png \ stock-resize-16.png \ stock-rotate-180-16.png \ diff --git a/themes/Default/images/stock-quick-mask-off-12.png b/themes/Default/images/stock-quick-mask-off-12.png new file mode 100644 index 0000000000..296f260082 Binary files /dev/null and b/themes/Default/images/stock-quick-mask-off-12.png differ diff --git a/themes/Default/images/stock-quick-mask-off-16.png b/themes/Default/images/stock-quick-mask-off-16.png deleted file mode 100644 index 488dab9053..0000000000 Binary files a/themes/Default/images/stock-quick-mask-off-16.png and /dev/null differ diff --git a/themes/Default/images/stock-quick-mask-on-12.png b/themes/Default/images/stock-quick-mask-on-12.png new file mode 100644 index 0000000000..b2f8690b5d Binary files /dev/null and b/themes/Default/images/stock-quick-mask-on-12.png differ diff --git a/themes/Default/images/stock-quick-mask-on-16.png b/themes/Default/images/stock-quick-mask-on-16.png deleted file mode 100644 index 94d7efe465..0000000000 Binary files a/themes/Default/images/stock-quick-mask-on-16.png and /dev/null differ