slightly increased size of the quick-mask and zoom-mode buttons. Also

2006-12-12  Sven Neumann  <sven@gimp.org>

	* 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.
This commit is contained in:
Sven Neumann 2006-12-12 11:20:59 +00:00 committed by Sven Neumann
parent e4acf07f67
commit d0e118dc9c
14 changed files with 87 additions and 38 deletions

View File

@ -1,3 +1,34 @@
2006-12-12 Sven Neumann <sven@gimp.org>
* 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 <sven@gimp.org>
* app/display/gimpstatusbar.c: only show the Cancel button while

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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 */

View File

@ -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"

View File

@ -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;
}

View File

@ -158,14 +158,14 @@ RTL variant
<!-- ##### MACRO GIMP_STOCK_QUICK_MASK_OFF ##### -->
<para xml:base="../gimpstock.xml">
<inlinegraphic fileref="stock-quick-mask-off-16.png" format="png"></inlinegraphic>
<inlinegraphic fileref="stock-quick-mask-off-12.png" format="png"></inlinegraphic>
</para>
<!-- ##### MACRO GIMP_STOCK_QUICK_MASK_ON ##### -->
<para xml:base="../gimpstock.xml">
<inlinegraphic fileref="stock-quick-mask-on-16.png" format="png"></inlinegraphic>
<inlinegraphic fileref="stock-quick-mask-on-12.png" format="png"></inlinegraphic>
</para>

View File

@ -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 },

View File

@ -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 \

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B