added preference for Susan's alternative toolbar icons, which still

added preference for Susan's alternative toolbar icons, which still
	default to the standard Gnome ones.
This commit is contained in:
Andy Hertzfeld 2000-05-29 05:53:54 +00:00
parent 72ae16521f
commit 60f644a4d2
20 changed files with 173 additions and 46 deletions

View file

@ -1,3 +1,34 @@
2000-05-28 Andy Hertzfeld <set EMAIL_ADDRESS environment variable>
added a preference for alternative toolbar icons, which defaults to the
standard Gnome icons.
* libnautilus-extensions/nautilus-global-preferences.c:
(global_preferences_create_dialog),
(global_preferences_register_for_ui):
added a checkbox for alternative toolbar icons in appearance pane
* libnautilus-extensions/nautilus-global-preferences.h:
added NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS
* src/nautilus-window-private.h:
added field to remember home button
* src/nautilus-window-toolbars.c: (remember_buttons),
(setup_button), (setup_toolbar_images),
added code to change the button images according to the preference
(nautilus_window_initialize_toolbars),
restructured to choose proper icons, and added a callback to watch the preference
(nautilus_window_toolbar_remove_theme_callback):
* src/nautilus-window.c: (nautilus_window_destroy):
* src/nautilus-window.h:
made it remove the preference callback when the window is destroyed
* icons/eazel/Makefile.am:
* icons/eazel/Back.png:
* icons/eazel/Forward.png:
* icons/eazel/Up.png:
* icons/eazel/Home.png:
added Susan's icons to eazel images folder
2000-05-28 Ramiro Estrugo <ramiro@eazel.com>
* src/nautilus-sidebar-tabs.c: (nautilus_index_tabs_add_view),

BIN
icons/eazel/Back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

BIN
icons/eazel/Forward.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

BIN
icons/eazel/Home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

View file

@ -1,6 +1,9 @@
eazeldir = $(datadir)/pixmaps/nautilus/eazel
eazel_DATA = \
Back.png \
Forward.png \
Home.png \
i-directory.png \
i-directory-24.png \
i-directory-36.png \
@ -14,6 +17,7 @@ eazel_DATA = \
i-regular.xml \
i-regular-36.png \
i-regular-72.png \
i-regular-96.png
i-regular-96.png \
Up.png
EXTRA_DIST = $(eazel_DATA)

BIN
icons/eazel/Up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

View file

@ -26,6 +26,8 @@
#include <liboaf/liboaf.h>
#include "nautilus-global-preferences.h"
#include <gtk/gtkbox.h>
#include <nautilus-widgets/nautilus-preferences-group.h>
#include <nautilus-widgets/nautilus-preferences-item.h>
#include <nautilus-widgets/nautilus-preferences-dialog.h>
@ -73,7 +75,6 @@ global_preferences_create_dialog (void)
GtkWidget *sidebar_panels_pane;
GtkWidget *appearance_pane;
/*
* In the soon to come star trek future, the following widgetry
* might be either fetched from a glade file or generated from
@ -172,13 +173,22 @@ global_preferences_create_dialog (void)
"Appearance",
"Appearance Options");
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), "Appearance");
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), "Smoother Graphics");
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (appearance_pane),
0,
NAUTILUS_PREFERENCES_ANTI_ALIASED_CANVAS,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), "Toolbar Icons");
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (appearance_pane),
1,
NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
/* all done */
return prefs_dialog;
}
@ -380,13 +390,7 @@ global_preferences_register_for_ui (void)
"Display text in icons even for remote text files",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* Anti-aliased canvas */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_ANTI_ALIASED_CANVAS,
"Use smoother (but slower) graphics",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* User level */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_USER_LEVEL_KEY,
"User Level",
@ -417,7 +421,13 @@ global_preferences_register_for_ui (void)
"Use smoother (but slower) graohics",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* toolbar icons */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS,
"Use Eazel's toolbar icons",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* miscellaneous */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,

View file

@ -48,7 +48,6 @@ BEGIN_GNOME_DECLS
/* Preferences not (currently?) displayed in dialog */
#define NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ATTRIBUTE_NAMES "/nautilus/icon_view/text_attribute_names"
#define NAUTILUS_PREFERENCES_ICON_THEME "/nautilus/preferences/icon_theme"
#define NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME "/nautilus/preferences/show_real_file_name"
/* Single/Double click preference */
@ -60,6 +59,10 @@ BEGIN_GNOME_DECLS
/* Sidebar panels */
#define NAUTILUS_PREFERENCES_SIDEBAR_PANELS_NAMESPACE "/nautilus/sidebar-panels"
/* themes */
#define NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS "/nautilus/preferences/eazel_toolbar_icons"
#define NAUTILUS_PREFERENCES_ICON_THEME "/nautilus/preferences/icon_theme"
enum
{
NAUTILUS_CLICK_POLICY_SINGLE,

View file

@ -26,6 +26,8 @@
#include <liboaf/liboaf.h>
#include "nautilus-global-preferences.h"
#include <gtk/gtkbox.h>
#include <nautilus-widgets/nautilus-preferences-group.h>
#include <nautilus-widgets/nautilus-preferences-item.h>
#include <nautilus-widgets/nautilus-preferences-dialog.h>
@ -73,7 +75,6 @@ global_preferences_create_dialog (void)
GtkWidget *sidebar_panels_pane;
GtkWidget *appearance_pane;
/*
* In the soon to come star trek future, the following widgetry
* might be either fetched from a glade file or generated from
@ -172,13 +173,22 @@ global_preferences_create_dialog (void)
"Appearance",
"Appearance Options");
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), "Appearance");
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), "Smoother Graphics");
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (appearance_pane),
0,
NAUTILUS_PREFERENCES_ANTI_ALIASED_CANVAS,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
nautilus_preferences_pane_add_group (NAUTILUS_PREFERENCES_PANE (appearance_pane), "Toolbar Icons");
nautilus_preferences_pane_add_item_to_nth_group (NAUTILUS_PREFERENCES_PANE (appearance_pane),
1,
NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS,
NAUTILUS_PREFERENCE_ITEM_BOOLEAN);
/* all done */
return prefs_dialog;
}
@ -380,13 +390,7 @@ global_preferences_register_for_ui (void)
"Display text in icons even for remote text files",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* Anti-aliased canvas */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_ANTI_ALIASED_CANVAS,
"Use smoother (but slower) graphics",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* User level */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_USER_LEVEL_KEY,
"User Level",
@ -417,7 +421,13 @@ global_preferences_register_for_ui (void)
"Use smoother (but slower) graohics",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* toolbar icons */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS,
"Use Eazel's toolbar icons",
NAUTILUS_PREFERENCE_BOOLEAN,
(gconstpointer) FALSE);
/* miscellaneous */
nautilus_preferences_set_info (NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME,

View file

@ -48,7 +48,6 @@ BEGIN_GNOME_DECLS
/* Preferences not (currently?) displayed in dialog */
#define NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ATTRIBUTE_NAMES "/nautilus/icon_view/text_attribute_names"
#define NAUTILUS_PREFERENCES_ICON_THEME "/nautilus/preferences/icon_theme"
#define NAUTILUS_PREFERENCES_SHOW_REAL_FILE_NAME "/nautilus/preferences/show_real_file_name"
/* Single/Double click preference */
@ -60,6 +59,10 @@ BEGIN_GNOME_DECLS
/* Sidebar panels */
#define NAUTILUS_PREFERENCES_SIDEBAR_PANELS_NAMESPACE "/nautilus/sidebar-panels"
/* themes */
#define NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS "/nautilus/preferences/eazel_toolbar_icons"
#define NAUTILUS_PREFERENCES_ICON_THEME "/nautilus/preferences/icon_theme"
enum
{
NAUTILUS_CLICK_POLICY_SINGLE,

View file

@ -536,7 +536,8 @@ nautilus_window_destroy (NautilusWindow *window)
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_SIDEBAR_PANELS_NAMESPACE,
sidebar_panels_changed_callback,
NULL);
nautilus_window_toolbar_remove_theme_callback();
g_list_free (window->meta_views);
CORBA_free(window->ni);

View file

@ -98,6 +98,8 @@ struct _NautilusWindow {
GtkWidget *up_button;
GtkWidget *reload_button;
GtkWidget *stop_button;
GtkWidget *home_button;
GtkWidget *zoom_control;
/* Pending changes */

View file

@ -536,7 +536,8 @@ nautilus_window_destroy (NautilusWindow *window)
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_SIDEBAR_PANELS_NAMESPACE,
sidebar_panels_changed_callback,
NULL);
nautilus_window_toolbar_remove_theme_callback();
g_list_free (window->meta_views);
CORBA_free(window->ni);

View file

@ -98,6 +98,8 @@ struct _NautilusWindow {
GtkWidget *up_button;
GtkWidget *reload_button;
GtkWidget *stop_button;
GtkWidget *home_button;
GtkWidget *zoom_control;
/* Pending changes */

View file

@ -536,7 +536,8 @@ nautilus_window_destroy (NautilusWindow *window)
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_SIDEBAR_PANELS_NAMESPACE,
sidebar_panels_changed_callback,
NULL);
nautilus_window_toolbar_remove_theme_callback();
g_list_free (window->meta_views);
CORBA_free(window->ni);

View file

@ -98,6 +98,8 @@ struct _NautilusWindow {
GtkWidget *up_button;
GtkWidget *reload_button;
GtkWidget *stop_button;
GtkWidget *home_button;
GtkWidget *zoom_control;
/* Pending changes */

View file

@ -66,6 +66,7 @@ void nautilus_window_go_back (NautilusWindow *window);
void nautilus_window_go_forward (NautilusWindow *window);
void nautilus_window_go_up (NautilusWindow *window);
void nautilus_window_go_home (NautilusWindow *window);
void nautilus_window_toolbar_remove_theme_callback(void);
NautilusUndoManager *nautilus_window_get_undo_manager (NautilusWindow *window);

View file

@ -29,13 +29,13 @@
#include <gnome.h>
#include <libnautilus-extensions/nautilus-bookmark.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-gtk-extensions.h>
/* forward declarations */
static void toolbar_reload_callback (GtkWidget *widget, NautilusWindow *window);
static void toolbar_stop_callback (GtkWidget *widget, NautilusWindow *window);
/* toolbar definitions */
#define TOOLBAR_BACK_BUTTON_INDEX 0
@ -76,20 +76,20 @@ toolbar_home_callback (GtkWidget *widget, NautilusWindow *window)
static GnomeUIInfo toolbar_info[] = {
GNOMEUIINFO_ITEM_STOCK
(N_("Back"), N_("Go to the previously visited directory"),
toolbar_back_callback, GNOME_STOCK_PIXMAP_BACK),
toolbar_back_callback, "nautilus/eazel/Back.png"),
GNOMEUIINFO_ITEM_STOCK
(N_("Forward"), N_("Go to the next directory"),
toolbar_forward_callback, GNOME_STOCK_PIXMAP_FORWARD),
toolbar_forward_callback, "nautilus/eazel/Forward.png"),
GNOMEUIINFO_ITEM_STOCK
(N_("Up"), N_("Go up a level in the directory heirarchy"),
toolbar_up_callback, GNOME_STOCK_PIXMAP_UP),
toolbar_up_callback, "nautilus/eazel/Up.png"),
GNOMEUIINFO_ITEM_STOCK
(N_("Reload"), N_("Reload this view"),
toolbar_reload_callback, GNOME_STOCK_PIXMAP_REFRESH),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_STOCK
(N_("Home"), N_("Go to your home directory"),
toolbar_home_callback, GNOME_STOCK_PIXMAP_HOME),
toolbar_home_callback, "nautilus/eazel/Home.png"),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_STOCK
(N_("Stop"), N_("Interrupt loading"),
@ -184,27 +184,67 @@ back_or_forward_button_clicked_callback (GtkWidget *widget,
}
/* utility to remember newly allocated toolbar buttons for later enabling/disabling */
static void
remember_buttons(NautilusWindow *window, GnomeUIInfo current_toolbar_info[])
{
window->back_button = current_toolbar_info[TOOLBAR_BACK_BUTTON_INDEX].widget;
window->forward_button = current_toolbar_info[TOOLBAR_FORWARD_BUTTON_INDEX].widget;
window->up_button = current_toolbar_info[TOOLBAR_UP_BUTTON_INDEX].widget;
window->reload_button = current_toolbar_info[TOOLBAR_RELOAD_BUTTON_INDEX].widget;
window->stop_button = current_toolbar_info[TOOLBAR_STOP_BUTTON_INDEX].widget;
window->home_button = current_toolbar_info[TOOLBAR_HOME_BUTTON_INDEX].widget;
}
/* set up the toolbar info based on the current theme selection from preferences */
static void
setup_button(GtkWidget* button, const char *icon_name)
{
GList *list;
GtkWidget *widget;
list = gtk_container_children(GTK_CONTAINER(GTK_BIN(button)->child));
widget = GTK_WIDGET(list->data);
g_list_free(list);
gnome_stock_set_icon(GNOME_STOCK(widget), icon_name);
gtk_widget_queue_resize(button);
}
static void
setup_toolbar_images(NautilusWindow *window)
{
gboolean use_eazel_theme;
use_eazel_theme = nautilus_preferences_get_boolean(NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS, FALSE);
setup_button (window->back_button, use_eazel_theme ? "nautilus/eazel/Back.png" : GNOME_STOCK_PIXMAP_BACK);
setup_button (window->forward_button, use_eazel_theme ? "nautilus/eazel/Forward.png" : GNOME_STOCK_PIXMAP_FORWARD);
setup_button (window->up_button, use_eazel_theme ? "nautilus/eazel/Up.png" : GNOME_STOCK_PIXMAP_UP);
setup_button (window->home_button, use_eazel_theme ? "nautilus/eazel/Home.png" : GNOME_STOCK_PIXMAP_HOME);
}
/* allocate a new toolbar */
void
nautilus_window_initialize_toolbars (NautilusWindow *window)
{
GnomeApp *app;
GtkWidget *toolbar;
app = GNOME_APP (window);
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gnome_app_fill_toolbar_with_data (GTK_TOOLBAR (toolbar), toolbar_info, app->accel_group, app);
remember_buttons(window, toolbar_info);
setup_toolbar_images(window);
app = GNOME_APP (window);
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gnome_app_fill_toolbar_with_data (GTK_TOOLBAR (toolbar), toolbar_info, app->accel_group, app);
gnome_app_set_toolbar (app, GTK_TOOLBAR (toolbar));
bonobo_ui_handler_set_toolbar (window->uih, "Main", toolbar);
/* Remember some widgets now so their state can be changed later */
window->back_button = toolbar_info[TOOLBAR_BACK_BUTTON_INDEX].widget;
window->forward_button = toolbar_info[TOOLBAR_FORWARD_BUTTON_INDEX].widget;
window->up_button = toolbar_info[TOOLBAR_UP_BUTTON_INDEX].widget;
window->reload_button = toolbar_info[TOOLBAR_RELOAD_BUTTON_INDEX].widget;
window->stop_button = toolbar_info[TOOLBAR_STOP_BUTTON_INDEX].widget;
gtk_signal_connect (GTK_OBJECT (window->back_button),
"button_press_event",
GTK_SIGNAL_FUNC (back_or_forward_button_clicked_callback),
@ -214,8 +254,21 @@ nautilus_window_initialize_toolbars (NautilusWindow *window)
"button_press_event",
GTK_SIGNAL_FUNC (back_or_forward_button_clicked_callback),
window);
}
/* add callback for preference changes */
nautilus_preferences_add_callback(NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS,
(NautilusPreferencesCallback) setup_toolbar_images,
window);
}
void
nautilus_window_toolbar_remove_theme_callback()
{
nautilus_preferences_remove_callback(NAUTILUS_PREFERENCES_EAZEL_TOOLBAR_ICONS,
(NautilusPreferencesCallback) setup_toolbar_images, NULL);
}
static void
toolbar_reload_callback (GtkWidget *widget, NautilusWindow *window)
{

View file

@ -536,7 +536,8 @@ nautilus_window_destroy (NautilusWindow *window)
nautilus_preferences_remove_callback (NAUTILUS_PREFERENCES_SIDEBAR_PANELS_NAMESPACE,
sidebar_panels_changed_callback,
NULL);
nautilus_window_toolbar_remove_theme_callback();
g_list_free (window->meta_views);
CORBA_free(window->ni);

View file

@ -98,6 +98,8 @@ struct _NautilusWindow {
GtkWidget *up_button;
GtkWidget *reload_button;
GtkWidget *stop_button;
GtkWidget *home_button;
GtkWidget *zoom_control;
/* Pending changes */