Commit 9eb748ad authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

named the menu separator "/fg-bg-separator", not just "/---".

2002-12-03  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpcolorbutton.c: named the menu separator
	"/fg-bg-separator", not just "/---".

	* app/widgets/gimpcolorpanel.[ch]: added a GimpContext pointer to
	get FG/BG from. Don't use "the_gimp" and don't include
	"app_procs.h".  Added gimp_color_panel_set_context(). Hide the
	FG/BG menu entries if we have no context.

	* app/gui/channels-commands.c
	* app/gui/preferences-dialog.c
	* app/gui/qmask-commands.c
	* app/display/gimpdisplayshell.c: set the color_panel's context.
parent 99df95f2
2002-12-03 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpcolorbutton.c: named the menu separator
"/fg-bg-separator", not just "/---".
* app/widgets/gimpcolorpanel.[ch]: added a GimpContext pointer to
get FG/BG from. Don't use "the_gimp" and don't include
"app_procs.h". Added gimp_color_panel_set_context(). Hide the
FG/BG menu entries if we have no context.
* app/gui/channels-commands.c
* app/gui/preferences-dialog.c
* app/gui/qmask-commands.c
* app/display/gimpdisplayshell.c: set the color_panel's context.
2002-12-03 Sven Neumann <sven@gimp.org>
* plug-ins/ifscompose/ifscompose.c: made it a lot less deprecated.
......
......@@ -307,6 +307,8 @@ channels_new_channel_query (GimpImage *gimage,
&channel_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (gimage->gimp));
/* The dialog */
options->query_box =
......@@ -454,6 +456,8 @@ channels_edit_channel_query (GimpChannel *channel)
&channel_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (options->gimage->gimp));
/* The dialog */
options->query_box =
......
......@@ -25,6 +25,7 @@
#include "gui-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimpimage-qmask.h"
......@@ -169,6 +170,8 @@ qmask_channel_query (GimpDisplayShell *shell)
&options->gimage->qmask_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (options->gimage->gimp));
/* The dialog */
options->query_box =
......
......@@ -25,6 +25,7 @@
#include "gui-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimpimage-qmask.h"
......@@ -169,6 +170,8 @@ qmask_channel_query (GimpDisplayShell *shell)
&options->gimage->qmask_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (options->gimage->gimp));
/* The dialog */
options->query_box =
......
......@@ -35,6 +35,7 @@
#include "core/gimp.h"
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpdeviceinfo.h"
#include "widgets/gimpdevices.h"
#include "widgets/gimpdialogfactory.h"
......@@ -1357,10 +1358,12 @@ prefs_dialog_new (Gimp *gimp,
prefs_enum_option_menu_add (config, "canvas-padding-mode", 0, 0,
_("Padding Mode:"),
GTK_TABLE (table), 0);
prefs_color_button_add (config, "canvas-padding-color",
_("Custom Color:"),
_("Select Custom Canvas Padding Color"),
GTK_TABLE (table), 1);
button = prefs_color_button_add (config, "canvas-padding-color",
_("Custom Color:"),
_("Select Custom Canvas Padding Color"),
GTK_TABLE (table), 1);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
gimp_get_user_context (gimp));
/* Pointer Movement Feedback */
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"),
......@@ -1380,9 +1383,9 @@ prefs_dialog_new (Gimp *gimp,
GTK_TABLE (table), 0);
/****************************************************/
/* Interface / Image Windows / Image Title Format */
/****************************************************/
/****************************************************************/
/* Interface / Image Windows / Image Title & Statusbar Format */
/****************************************************************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Image Title & Statusbar Format"),
......
......@@ -632,6 +632,8 @@ gimp_display_shell_new (GimpDisplay *gdisp,
GIMP_COLOR_AREA_FLAT,
15, 15);
GTK_WIDGET_UNSET_FLAGS (shell->padding_button, GTK_CAN_FOCUS);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (shell->padding_button),
gimp_get_user_context (gdisp->gimage->gimp));
gimp_help_set_help_data (shell->padding_button,
_("Set canvas padding color"), "#padding_button");
......@@ -655,13 +657,17 @@ gimp_display_shell_new (GimpDisplay *gdisp,
{ N_("/Dark Check Color"), NULL,
gimp_display_shell_color_button_menu_callback,
GIMP_DISPLAY_PADDING_MODE_DARK_CHECK, NULL },
{ "/---", NULL, NULL, 0, "<Separator>"},
{ N_("/Select Custom Color..."), NULL,
gimp_display_shell_color_button_menu_callback,
GIMP_DISPLAY_PADDING_MODE_CUSTOM, NULL },
GIMP_DISPLAY_PADDING_MODE_CUSTOM, "<StockItem>",
GTK_STOCK_SELECT_COLOR },
{ N_("/As in Preferences"), NULL,
gimp_display_shell_color_button_menu_callback,
0xffff, NULL }
0xffff, "<StockItem>",
GIMP_STOCK_RESET }
};
gtk_item_factory_create_items (GIMP_COLOR_BUTTON (shell->padding_button)->item_factory,
......
......@@ -632,6 +632,8 @@ gimp_display_shell_new (GimpDisplay *gdisp,
GIMP_COLOR_AREA_FLAT,
15, 15);
GTK_WIDGET_UNSET_FLAGS (shell->padding_button, GTK_CAN_FOCUS);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (shell->padding_button),
gimp_get_user_context (gdisp->gimage->gimp));
gimp_help_set_help_data (shell->padding_button,
_("Set canvas padding color"), "#padding_button");
......@@ -655,13 +657,17 @@ gimp_display_shell_new (GimpDisplay *gdisp,
{ N_("/Dark Check Color"), NULL,
gimp_display_shell_color_button_menu_callback,
GIMP_DISPLAY_PADDING_MODE_DARK_CHECK, NULL },
{ "/---", NULL, NULL, 0, "<Separator>"},
{ N_("/Select Custom Color..."), NULL,
gimp_display_shell_color_button_menu_callback,
GIMP_DISPLAY_PADDING_MODE_CUSTOM, NULL },
GIMP_DISPLAY_PADDING_MODE_CUSTOM, "<StockItem>",
GTK_STOCK_SELECT_COLOR },
{ N_("/As in Preferences"), NULL,
gimp_display_shell_color_button_menu_callback,
0xffff, NULL }
0xffff, "<StockItem>",
GIMP_STOCK_RESET }
};
gtk_item_factory_create_items (GIMP_COLOR_BUTTON (shell->padding_button)->item_factory,
......
......@@ -307,6 +307,8 @@ channels_new_channel_query (GimpImage *gimage,
&channel_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (gimage->gimp));
/* The dialog */
options->query_box =
......@@ -454,6 +456,8 @@ channels_edit_channel_query (GimpChannel *channel)
&channel_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (options->gimage->gimp));
/* The dialog */
options->query_box =
......
......@@ -35,6 +35,7 @@
#include "core/gimp.h"
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpdeviceinfo.h"
#include "widgets/gimpdevices.h"
#include "widgets/gimpdialogfactory.h"
......@@ -1357,10 +1358,12 @@ prefs_dialog_new (Gimp *gimp,
prefs_enum_option_menu_add (config, "canvas-padding-mode", 0, 0,
_("Padding Mode:"),
GTK_TABLE (table), 0);
prefs_color_button_add (config, "canvas-padding-color",
_("Custom Color:"),
_("Select Custom Canvas Padding Color"),
GTK_TABLE (table), 1);
button = prefs_color_button_add (config, "canvas-padding-color",
_("Custom Color:"),
_("Select Custom Canvas Padding Color"),
GTK_TABLE (table), 1);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
gimp_get_user_context (gimp));
/* Pointer Movement Feedback */
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"),
......@@ -1380,9 +1383,9 @@ prefs_dialog_new (Gimp *gimp,
GTK_TABLE (table), 0);
/****************************************************/
/* Interface / Image Windows / Image Title Format */
/****************************************************/
/****************************************************************/
/* Interface / Image Windows / Image Title & Statusbar Format */
/****************************************************************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Image Title & Statusbar Format"),
......
......@@ -25,6 +25,7 @@
#include "gui-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimpimage-qmask.h"
......@@ -169,6 +170,8 @@ qmask_channel_query (GimpDisplayShell *shell)
&options->gimage->qmask_color,
GIMP_COLOR_AREA_LARGE_CHECKS,
48, 64);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (options->color_panel),
gimp_get_user_context (options->gimage->gimp));
/* The dialog */
options->query_box =
......
......@@ -39,13 +39,13 @@
#include "gimpcolorpanel.h"
#include "gimpitemfactory.h"
#include "app_procs.h"
struct _GimpColorPanel
{
GimpColorButton parent;
GimpContext *context;
ColorNotebook *color_notebook;
gboolean color_notebook_active;
};
......@@ -123,6 +123,7 @@ gimp_color_panel_class_init (GimpColorPanelClass *klass)
static void
gimp_color_panel_init (GimpColorPanel *panel)
{
panel->context = NULL;
panel->color_notebook = NULL;
panel->color_notebook_active = FALSE;
}
......@@ -153,19 +154,38 @@ gimp_color_panel_button_press (GtkWidget *widget,
if (bevent->button == 3)
{
GimpColorButton *color_button;
GimpRGB fg, bg, black, white;
GimpColorPanel *color_panel;
GimpRGB black, white;
color_button = GIMP_COLOR_BUTTON (widget);
color_panel = GIMP_COLOR_PANEL (widget);
gimp_item_factory_set_visible (color_button->item_factory,
"/Foreground Color",
color_panel->context != NULL);
gimp_item_factory_set_visible (color_button->item_factory,
"/Background Color",
color_panel->context != NULL);
gimp_item_factory_set_visible (color_button->item_factory,
"/fg-bg-separator",
color_panel->context != NULL);
if (color_panel->context)
{
GimpRGB fg, bg;
gimp_context_get_foreground (color_panel->context, &fg);
gimp_context_get_background (color_panel->context, &bg);
gimp_item_factory_set_color (color_button->item_factory,
"/Foreground Color", &fg, FALSE);
gimp_item_factory_set_color (color_button->item_factory,
"/Background Color", &bg, FALSE);
}
gimp_context_get_foreground (gimp_get_user_context (the_gimp), &fg);
gimp_context_get_background (gimp_get_user_context (the_gimp), &bg);
gimp_rgba_set (&black, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
gimp_rgba_set (&white, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
gimp_item_factory_set_color (color_button->item_factory,
"/Foreground Color", &fg, FALSE);
gimp_item_factory_set_color (color_button->item_factory,
"/Background Color", &bg, FALSE);
gimp_item_factory_set_color (color_button->item_factory,
"/Black", &black, FALSE);
gimp_item_factory_set_color (color_button->item_factory,
......@@ -187,6 +207,7 @@ gimp_color_panel_new (const gchar *title,
{
GimpColorPanel *panel;
g_return_val_if_fail (title != NULL, NULL);
g_return_val_if_fail (color != NULL, NULL);
panel = g_object_new (GIMP_TYPE_COLOR_PANEL, NULL);
......@@ -200,6 +221,16 @@ gimp_color_panel_new (const gchar *title,
return GTK_WIDGET (panel);
}
void
gimp_color_panel_set_context (GimpColorPanel *panel,
GimpContext *context)
{
g_return_if_fail (GIMP_IS_COLOR_PANEL (panel));
g_return_if_fail (context == NULL || GIMP_IS_CONTEXT (context));
panel->context = context;
}
static void
gimp_color_panel_color_changed (GimpColorButton *button)
{
......
......@@ -40,13 +40,16 @@ struct _GimpColorPanelClass
};
GType gimp_color_panel_get_type (void) G_GNUC_CONST;
GType gimp_color_panel_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_color_panel_new (const gchar *title,
const GimpRGB *color,
GimpColorAreaType type,
gint width,
gint height);
GtkWidget * gimp_color_panel_new (const gchar *title,
const GimpRGB *color,
GimpColorAreaType type,
gint width,
gint height);
void gimp_color_panel_set_context (GimpColorPanel *panel,
GimpContext *context);
#endif /* __GIMP_COLOR_PANEL_H__ */
......@@ -86,7 +86,7 @@ static GtkItemFactoryEntry menu_items[] =
gimp_color_button_use_color, GIMP_COLOR_BUTTON_COLOR_FG, NULL },
{ N_("/Background Color"), NULL,
gimp_color_button_use_color, GIMP_COLOR_BUTTON_COLOR_BG, NULL },
{ "/---", NULL, NULL, 0, "<Separator>"},
{ "/fg-bg-separator", NULL, NULL, 0, "<Separator>"},
{ N_("/Black"), NULL,
gimp_color_button_use_color, GIMP_COLOR_BUTTON_COLOR_BLACK, NULL },
{ N_("/White"), NULL,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment