Commit 744726d4 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

Sven Naumann <sven@gimp.org>

2002-02-28  Michael Natterer  <mitch@gimp.org>
            Sven Naumann  <sven@gimp.org>

	* configure.in
	* themes/Default/images/Makefile.am
	* themes/Default/images/preferences/Makefile.am: new directory
	for themeable preferences icons.

	* themes/Default/images/preferences/default-comment.png
	* themes/Default/images/preferences/display.png
	* themes/Default/images/preferences/environment.png
	* themes/Default/images/preferences/folders.png
	* themes/Default/images/preferences/help-system.png
	* themes/Default/images/preferences/image-windows.png
	* themes/Default/images/preferences/interface.png
	* themes/Default/images/preferences/monitor.png
	* themes/Default/images/preferences/new-image.png
	* themes/Default/images/preferences/session.png
	* themes/Default/images/preferences/tool-options.png: added some
	GPL icons from Jimmac's site (http://jimmac.musichall.cz/).

	* app/gui/gui.[ch]: added gui_themes_get_theme_dir() so we can find
	icons which are loaded on demand.

	* app/gui/preferences-dialog.c: added the icons to the tree and
	the notebook page headers. Cleaned up and reduced the code a lot
	by adding utility functions prefs_table_new() and
	prefs_check_button_new().

	* app/display/gimpdisplayshell.c
	* app/display/gimpdisplayshell-callbacks.[ch]: added a "Default"
	menu entry to the display's color button context menu so we can
	reset the padding color to the theme's bg color.
parent 6f4cbda8
2002-02-28 Michael Natterer <mitch@gimp.org>
Sven Naumann <sven@gimp.org>
* configure.in
* themes/Default/images/Makefile.am
* themes/Default/images/preferences/Makefile.am: new directory
for themeable preferences icons.
* themes/Default/images/preferences/default-comment.png
* themes/Default/images/preferences/display.png
* themes/Default/images/preferences/environment.png
* themes/Default/images/preferences/folders.png
* themes/Default/images/preferences/help-system.png
* themes/Default/images/preferences/image-windows.png
* themes/Default/images/preferences/interface.png
* themes/Default/images/preferences/monitor.png
* themes/Default/images/preferences/new-image.png
* themes/Default/images/preferences/session.png
* themes/Default/images/preferences/tool-options.png: added some
GPL icons from Jimmac's site (http://jimmac.musichall.cz/).
* app/gui/gui.[ch]: added gui_themes_get_theme_dir() so we can find
icons which are loaded on demand.
* app/gui/preferences-dialog.c: added the icons to the tree and
the notebook page headers. Cleaned up and reduced the code a lot
by adding utility functions prefs_table_new() and
prefs_check_button_new().
* app/display/gimpdisplayshell.c
* app/display/gimpdisplayshell-callbacks.[ch]: added a "Default"
menu entry to the display's color button context menu so we can
reset the padding color to the theme's bg color.
2002-02-28 Sven Neumann <sven@gimp.org>
 
* app/gui/file-commands.c: fixed message string.
......
This diff is collapsed.
......@@ -138,14 +138,14 @@ gimp_display_shell_canvas_realize (GtkWidget *canvas,
gimp_rgb_set_uchar (&shell->padding_color, r, g, b);
g_signal_handlers_block_by_func (G_OBJECT (shell->padding_button),
gimp_display_shell_color_changed,
gimp_display_shell_color_button_changed,
shell);
gimp_color_button_set_color (GIMP_COLOR_BUTTON (shell->padding_button),
&shell->padding_color);
g_signal_handlers_unblock_by_func (G_OBJECT (shell->padding_button),
gimp_display_shell_color_changed,
gimp_display_shell_color_button_changed,
shell);
}
......@@ -1093,11 +1093,37 @@ gimp_display_shell_origin_button_press (GtkWidget *widget,
return TRUE;
}
gboolean
gimp_display_shell_color_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell)
{
if (bevent->button == 3)
{
GimpColorButton *color_button;
guchar r, g, b;
GimpRGB color;
color_button = GIMP_COLOR_BUTTON (widget);
r = shell->canvas->style->bg[GTK_STATE_NORMAL].red >> 8;
g = shell->canvas->style->bg[GTK_STATE_NORMAL].green >> 8;
b = shell->canvas->style->bg[GTK_STATE_NORMAL].blue >> 8;
gimp_rgba_set_uchar (&color, r, g, b, 255);
gimp_item_factory_set_color (color_button->item_factory,
"/Default Color", &color, FALSE);
}
return FALSE;
}
void
gimp_display_shell_color_changed (GtkWidget *widget,
GimpDisplayShell *shell)
gimp_display_shell_color_button_changed (GtkWidget *widget,
GimpDisplayShell *shell)
{
GdkColor color;
GdkColor gdk_color;
guchar r, g, b;
gimp_color_button_get_color (GIMP_COLOR_BUTTON (widget),
......@@ -1105,16 +1131,37 @@ gimp_display_shell_color_changed (GtkWidget *widget,
gimp_rgb_get_uchar (&shell->padding_color, &r, &g, &b);
color.red = r + r * 256;
color.green = g + g * 256;
color.blue = b + b * 256;
gdk_color.red = r + r * 256;
gdk_color.green = g + g * 256;
gdk_color.blue = b + b * 256;
gdk_gc_set_rgb_fg_color (shell->padding_gc, &color);
gdk_gc_set_rgb_fg_color (shell->padding_gc, &gdk_color);
gimp_display_shell_expose_full (shell);
gimp_display_shell_flush (shell);
}
void
gimp_display_shell_color_button_default (gpointer callback_data,
guint callback_action,
GtkWidget *widget)
{
GimpDisplayShell *shell;
guchar r, g, b;
GimpRGB color;
shell = GIMP_DISPLAY_SHELL (callback_data);
r = shell->canvas->style->bg[GTK_STATE_NORMAL].red >> 8;
g = shell->canvas->style->bg[GTK_STATE_NORMAL].green >> 8;
b = shell->canvas->style->bg[GTK_STATE_NORMAL].blue >> 8;
gimp_rgb_set_uchar (&color, r, g, b);
gimp_color_button_set_color (GIMP_COLOR_BUTTON (shell->padding_button),
&color);
}
gboolean
gimp_display_shell_qmask_button_press (GtkWidget *widget,
GdkEventButton *event,
......
......@@ -33,46 +33,52 @@
GDK_PROXIMITY_OUT_MASK)
gboolean gimp_display_shell_events (GtkWidget *widget,
GdkEvent *event,
GimpDisplayShell *shell);
gboolean gimp_display_shell_events (GtkWidget *widget,
GdkEvent *event,
GimpDisplayShell *shell);
void gimp_display_shell_canvas_realize (GtkWidget *widget,
GimpDisplayShell *shell);
gboolean gimp_display_shell_canvas_configure (GtkWidget *widget,
GdkEventConfigure *cevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_canvas_expose (GtkWidget *widget,
GdkEventExpose *eevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_canvas_focus_in (GtkWidget *widget,
GdkEventFocus *fevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_canvas_focus_out (GtkWidget *widget,
GdkEventFocus *fevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_canvas_tool_events (GtkWidget *widget,
GdkEvent *event,
GimpDisplayShell *shell);
void gimp_display_shell_canvas_realize (GtkWidget *widget,
GimpDisplayShell *shell);
gboolean gimp_display_shell_canvas_configure (GtkWidget *widget,
GdkEventConfigure *cevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_canvas_expose (GtkWidget *widget,
GdkEventExpose *eevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_canvas_focus_in (GtkWidget *widget,
GdkEventFocus *fevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_canvas_focus_out (GtkWidget *widget,
GdkEventFocus *fevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_canvas_tool_events (GtkWidget *widget,
GdkEvent *event,
GimpDisplayShell *shell);
gboolean gimp_display_shell_hruler_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_vruler_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_origin_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_hruler_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_vruler_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell);
gboolean gimp_display_shell_origin_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell);
void gimp_display_shell_color_changed (GtkWidget *widget,
GimpDisplayShell *shell);
gboolean gimp_display_shell_color_button_press (GtkWidget *widget,
GdkEventButton *bevent,
GimpDisplayShell *shell);
void gimp_display_shell_color_button_changed (GtkWidget *widget,
GimpDisplayShell *shell);
void gimp_display_shell_color_button_default (gpointer data,
guint action,
GtkWidget *widget);
gboolean gimp_display_shell_qmask_button_press (GtkWidget *widget,
GdkEventButton *event,
GimpDisplayShell *shell);
void gimp_display_shell_qmask_toggled (GtkWidget *widget,
GimpDisplayShell *shell);
gboolean gimp_display_shell_qmask_button_press (GtkWidget *widget,
GdkEventButton *event,
GimpDisplayShell *shell);
void gimp_display_shell_qmask_toggled (GtkWidget *widget,
GimpDisplayShell *shell);
#endif /* __GIMP_DISPLAY_SHELL_CALLBACKS_H__ */
......@@ -608,10 +608,27 @@ gimp_display_shell_new (GimpDisplay *gdisp)
gimp_help_set_help_data (shell->padding_button,
_("Set canvas padding color"), "#padding_button");
g_signal_connect (G_OBJECT (shell->padding_button), "button_press_event",
G_CALLBACK (gimp_display_shell_color_button_press),
shell);
g_signal_connect (G_OBJECT (shell->padding_button), "color_changed",
G_CALLBACK (gimp_display_shell_color_changed),
G_CALLBACK (gimp_display_shell_color_button_changed),
shell);
{
static GtkItemFactoryEntry menu_items[] =
{
{ "/---", NULL, NULL, 0, "<Separator>"},
{ N_("/Default Color"), NULL,
gimp_display_shell_color_button_default, 0, NULL }
};
gtk_item_factory_create_items (GIMP_COLOR_BUTTON (shell->padding_button)->item_factory,
G_N_ELEMENTS (menu_items),
menu_items,
shell);
}
/* create the contents of the lower_hbox *********************************/
/* the qmask button */
......
......@@ -608,10 +608,27 @@ gimp_display_shell_new (GimpDisplay *gdisp)
gimp_help_set_help_data (shell->padding_button,
_("Set canvas padding color"), "#padding_button");
g_signal_connect (G_OBJECT (shell->padding_button), "button_press_event",
G_CALLBACK (gimp_display_shell_color_button_press),
shell);
g_signal_connect (G_OBJECT (shell->padding_button), "color_changed",
G_CALLBACK (gimp_display_shell_color_changed),
G_CALLBACK (gimp_display_shell_color_button_changed),
shell);
{
static GtkItemFactoryEntry menu_items[] =
{
{ "/---", NULL, NULL, 0, "<Separator>"},
{ N_("/Default Color"), NULL,
gimp_display_shell_color_button_default, 0, NULL }
};
gtk_item_factory_create_items (GIMP_COLOR_BUTTON (shell->padding_button)->item_factory,
G_N_ELEMENTS (menu_items),
menu_items,
shell);
}
/* create the contents of the lower_hbox *********************************/
/* the qmask button */
......
......@@ -78,6 +78,8 @@ static void gui_message (Gimp *gimp,
static GimpObject * gui_display_new (GimpImage *gimage,
guint scale);
static void gui_themes_dir_foreach_func (const gchar *filename,
gpointer loader_data);
static gint gui_rotate_the_shield_harmonics (GtkWidget *widget,
GdkEvent *eevent,
gpointer data);
......@@ -101,25 +103,6 @@ static GHashTable *themes_hash = NULL;
/* public functions */
static void
gui_themes_dir_foreach_func (const gchar *filename,
gpointer loader_data)
{
Gimp *gimp;
gchar *basename;
gimp = (Gimp *) loader_data;
basename = g_path_get_basename (filename);
if (gimp->be_verbose)
g_print (_("Adding theme '%s' (%s)\n"), basename, filename);
g_hash_table_insert (themes_hash,
basename,
g_strdup (filename));
}
void
gui_libs_init (gint *argc,
gchar ***argv)
......@@ -144,8 +127,8 @@ gui_libs_init (gint *argc,
void
gui_themes_init (Gimp *gimp)
{
gchar *theme_dir;
gchar *gtkrc;
const gchar *theme_dir;
gchar *gtkrc;
g_return_if_fail (GIMP_IS_GIMP (gimp));
......@@ -162,10 +145,7 @@ gui_themes_init (Gimp *gimp)
gimp);
}
if (gimprc.theme)
theme_dir = g_hash_table_lookup (themes_hash, gimprc.theme);
else
theme_dir = g_hash_table_lookup (themes_hash, "Default");
theme_dir = gui_themes_get_theme_dir (gimp);
if (theme_dir)
{
......@@ -210,6 +190,15 @@ gui_themes_init (Gimp *gimp)
gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
}
const gchar *
gui_themes_get_theme_dir (Gimp *gimp)
{
if (gimprc.theme)
return g_hash_table_lookup (themes_hash, gimprc.theme);
return g_hash_table_lookup (themes_hash, "Default");
}
void
gui_init (Gimp *gimp)
{
......@@ -469,6 +458,25 @@ gui_display_new (GimpImage *gimage,
return GIMP_OBJECT (gdisp);
}
static void
gui_themes_dir_foreach_func (const gchar *filename,
gpointer loader_data)
{
Gimp *gimp;
gchar *basename;
gimp = (Gimp *) loader_data;
basename = g_path_get_basename (filename);
if (gimp->be_verbose)
g_print (_("Adding theme '%s' (%s)\n"), basename, filename);
g_hash_table_insert (themes_hash,
basename,
g_strdup (filename));
}
static gint
gui_rotate_the_shield_harmonics (GtkWidget *widget,
GdkEvent *eevent,
......
......@@ -20,23 +20,24 @@
#define __GUI_H__
void gui_libs_init (gint *argc,
gchar ***argv);
void gui_libs_init (gint *argc,
gchar ***argv);
void gui_themes_init (Gimp *gimp);
void gui_themes_init (Gimp *gimp);
const gchar * gui_themes_get_theme_dir (Gimp *gimp);
void gui_init (Gimp *gimp);
void gui_restore (Gimp *gimp,
gboolean restore_session);
void gui_post_init (Gimp *gimp);
void gui_init (Gimp *gimp);
void gui_restore (Gimp *gimp,
gboolean restore_session);
void gui_post_init (Gimp *gimp);
void gui_shutdown (Gimp *gimp);
void gui_exit (Gimp *gimp);
void gui_shutdown (Gimp *gimp);
void gui_exit (Gimp *gimp);
void gui_get_screen_resolution (gdouble *xres,
gdouble *yres);
void gui_get_screen_resolution (gdouble *xres,
gdouble *yres);
void gui_really_quit_dialog (GCallback quit_func);
void gui_really_quit_dialog (GCallback quit_func);
#endif /* __GUI_H__ */
This diff is collapsed.
......@@ -930,6 +930,7 @@ cursors/Makefile
themes/Makefile
themes/Default/Makefile
themes/Default/images/Makefile
themes/Default/images/preferences/Makefile
themes/Default/images/tools/Makefile
data/Makefile
data/misc/Makefile
......
## Process this file with automake to produce Makefile.in
SUBDIRS = tools
SUBDIRS = preferences tools
themedatadir = $(gimpdatadir)/themes/Default/images
......
Makefile
Makefile.in
.xvpics
.thumbnails
## Process this file with automake to produce Makefile.in
themedatadir = $(gimpdatadir)/themes/Default/images/preferences
PREFS_IMAGES = @STRIP_BEGIN@ \
default-comment.png \
display.png \
environment.png \
folders.png \
help-system.png \
image-windows.png \
interface.png \
monitor.png \
new-image.png \
session.png \
tool-options.png \
@STRIP_END@
themedata_DATA = $(PREFS_IMAGES)
EXTRA_DIST = $(themedata_DATA)
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