Commit ce85b77a authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz

Try to get rid of most of our stock icons.

2005-01-29  Vincent Untz  <vincent@vuntz.net>

	Try to get rid of most of our stock icons.

	* button-widget.[ch]: (button_widget_load_and_scale_stock_icon):
	(button_widget_gtk_theme_changed):
	(button_widget_new_from_stock):
	(button_widget_set_stock_id):
	(button_widget_get_stock_id): killed these functions
	(button_widget_reload_pixbuf): remove code that blocked the "missing"
	icon from being used, remove stock icon code
	(button_widget_finalize): remove stock icon code
	(button_widget_get_property): ditto
	(button_widget_set_property): ditto
	(button_widget_instance_init): ditto
	(button_widget_class_init): ditto
	* drawer.[ch]: (create_drawer_applet): stop using stock icons
	(panel_drawer_set_dnd_enabled): add a comment for drag icon by name
	* menu.c: (setup_internal_applet_drag): stop using stock icons
	(menu_create_action_item): ditto
	* panel-action-button.[ch]: remove stock icons
	(panel_action_get_stock_icon): kill
	(panel_action_button_set_type): remove stock icon code
	(panel_action_button_style_set): ditto
	(panel_action_button_set_dnd_enabled): ditto
	* panel-addto.c: stop using stock icons
	(panel_addto_prepend_internal_applets): remove stock icon code
	(panel_addto_make_pixbuf): safety check that the pixbuf is not NULL
	(panel_addto_append_item): remove stock icon code
	* panel-applet-frame.c: (register_stock_item): move this code to
	panel-stock-icons.c
	(panel_applet_frame_loading_failed): updated
	* panel-force-quit.[ch]: (display_popup_window): stop using stock icon
	* panel-menu-bar.[ch]: (panel_menu_bar_instance_init): ditto
	* panel-menu-button.[ch]: (panel_menu_button_instance_init): remove
	stock icon code
	(panel_menu_button_get_icon): return the icon for the menu button, and
	not the icon of the menu path
	(panel_menu_button_set_icon): updated
	(panel_menu_button_set_dnd_enabled): stop using stock icons
	* panel-run-dialog.[ch]: (set_window_icon_from_stock): kill
	(panel_run_dialog_set_icon): stop using stock icons
	(panel_run_dialog_setup_pixmap): don't set the image here...
	(panel_run_dialog_new): ... but here, and we don't need to set the
	window icon
	* panel-stock-icons.[ch]: (panel_button_icon_get_size): kill
	remove PANEL_STOCK_RUN, PANEL_STOCK_GNOME_LOGO, PANEL_STOCK_MAIN_MENU,
	PANEL_STOCK_DRAWER, add PANEL_STOCK_DONT_DELETE
	(panel_init_stock_icons_and_items): do not register
	panel_button_icon_size since it's useless
parent 02ac1ae4
2005-01-29 Vincent Untz <vincent@vuntz.net>
Try to get rid of most of our stock icons.
* button-widget.[ch]: (button_widget_load_and_scale_stock_icon):
(button_widget_gtk_theme_changed):
(button_widget_new_from_stock):
(button_widget_set_stock_id):
(button_widget_get_stock_id): killed these functions
(button_widget_reload_pixbuf): remove code that blocked the "missing"
icon from being used, remove stock icon code
(button_widget_finalize): remove stock icon code
(button_widget_get_property): ditto
(button_widget_set_property): ditto
(button_widget_instance_init): ditto
(button_widget_class_init): ditto
* drawer.[ch]: (create_drawer_applet): stop using stock icons
(panel_drawer_set_dnd_enabled): add a comment for drag icon by name
* menu.c: (setup_internal_applet_drag): stop using stock icons
(menu_create_action_item): ditto
* panel-action-button.[ch]: remove stock icons
(panel_action_get_stock_icon): kill
(panel_action_button_set_type): remove stock icon code
(panel_action_button_style_set): ditto
(panel_action_button_set_dnd_enabled): ditto
* panel-addto.c: stop using stock icons
(panel_addto_prepend_internal_applets): remove stock icon code
(panel_addto_make_pixbuf): safety check that the pixbuf is not NULL
(panel_addto_append_item): remove stock icon code
* panel-applet-frame.c: (register_stock_item): move this code to
panel-stock-icons.c
(panel_applet_frame_loading_failed): updated
* panel-force-quit.[ch]: (display_popup_window): stop using stock icon
* panel-menu-bar.[ch]: (panel_menu_bar_instance_init): ditto
* panel-menu-button.[ch]: (panel_menu_button_instance_init): remove
stock icon code
(panel_menu_button_get_icon): return the icon for the menu button, and
not the icon of the menu path
(panel_menu_button_set_icon): updated
(panel_menu_button_set_dnd_enabled): stop using stock icons
* panel-run-dialog.[ch]: (set_window_icon_from_stock): kill
(panel_run_dialog_set_icon): stop using stock icons
(panel_run_dialog_setup_pixmap): don't set the image here...
(panel_run_dialog_new): ... but here, and we don't need to set the
window icon
* panel-stock-icons.[ch]: (panel_button_icon_get_size): kill
remove PANEL_STOCK_RUN, PANEL_STOCK_GNOME_LOGO, PANEL_STOCK_MAIN_MENU,
PANEL_STOCK_DRAWER, add PANEL_STOCK_DONT_DELETE
(panel_init_stock_icons_and_items): do not register
panel_button_icon_size since it's useless
2005-01-29 Vincent Untz <vincent@vuntz.net>
Move away from GnomeIconTheme. Still some work to do to use
......
......@@ -28,8 +28,7 @@ enum {
PROP_HAS_ARROW,
PROP_DND_HIGHLIGHT,
PROP_ORIENTATION,
PROP_ICON_NAME,
PROP_STOCK_ID
PROP_ICON_NAME
};
#define BUTTON_WIDGET_DISPLACEMENT 2
......@@ -176,39 +175,6 @@ button_widget_unset_pixbufs (ButtonWidget *button)
button->pixbuf_hc = NULL;
}
static GdkPixbuf *
button_widget_load_and_scale_stock_icon (ButtonWidget *button)
{
GdkPixbuf *new;
GdkPixbuf *retval;
double scale;
int width;
int height;
new = gtk_widget_render_icon (GTK_WIDGET (button),
button->stock_id,
(GtkIconSize) -1,
NULL);
width = gdk_pixbuf_get_width (new);
height = gdk_pixbuf_get_height (new);
if (button->orientation & PANEL_HORIZONTAL_MASK)
scale = (double) button->size / height;
else
scale = (double) button->size / width;
width *= scale;
height *= scale;
retval = gdk_pixbuf_scale_simple (new, width, height,
GDK_INTERP_BILINEAR);
g_object_unref (new);
return retval;
}
static void
button_widget_reload_pixbuf (ButtonWidget *button)
{
......@@ -217,9 +183,6 @@ button_widget_reload_pixbuf (ButtonWidget *button)
if (button->size <= 1)
return;
if (!button->filename && !button->stock_id)
return;
if (button->filename != NULL) {
char *error = NULL;
......@@ -238,9 +201,6 @@ button_widget_reload_pixbuf (ButtonWidget *button)
}
}
if (button->pixbuf == NULL && button->stock_id != NULL)
button->pixbuf = button_widget_load_and_scale_stock_icon (button);
if (button->pixbuf == NULL)
button->pixbuf = get_missing (button->icon_theme,
button->size);
......@@ -260,13 +220,6 @@ button_widget_icon_theme_changed (ButtonWidget *button)
button_widget_reload_pixbuf (button);
}
static void
button_widget_gtk_theme_changed (ButtonWidget *button)
{
if (button->stock_id != NULL)
button_widget_reload_pixbuf (button);
}
static void
button_widget_finalize (GObject *object)
{
......@@ -277,9 +230,6 @@ button_widget_finalize (GObject *object)
g_free (button->filename);
button->filename = NULL;
g_free (button->stock_id);
button->stock_id = NULL;
parent_class->finalize (object);
}
......@@ -311,9 +261,6 @@ button_widget_get_property (GObject *object,
case PROP_ICON_NAME:
g_value_set_string (value, button->filename);
break;
case PROP_STOCK_ID:
g_value_set_string (value, button->stock_id);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -348,9 +295,6 @@ button_widget_set_property (GObject *object,
case PROP_ICON_NAME:
button_widget_set_icon_name (button, g_value_get_string (value));
break;
case PROP_STOCK_ID:
button_widget_set_stock_id (button, g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -650,9 +594,6 @@ button_widget_instance_init (ButtonWidget *button)
button->dnd_highlight = FALSE;
button->size = 0;
g_signal_connect (button, "style-set",
G_CALLBACK (button_widget_gtk_theme_changed), button);
}
static void
......@@ -724,15 +665,6 @@ button_widget_class_init (ButtonWidgetClass *klass)
"The desired icon for the ButtonWidget",
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (
gobject_class,
PROP_STOCK_ID,
g_param_spec_string ("stock-id",
"Stock Icon ID",
"The desired stock icon for the ButtonWidget",
NULL,
G_PARAM_READWRITE));
}
GType
......@@ -777,23 +709,6 @@ button_widget_new (const char *filename,
return retval;
}
GtkWidget *
button_widget_new_from_stock (const char *stock_id,
gboolean arrow,
PanelOrientation orientation)
{
GtkWidget *retval;
retval = g_object_new (
BUTTON_TYPE_WIDGET,
"has-arrow", arrow,
"orientation", orientation,
"stock-id", stock_id,
NULL);
return retval;
}
void
button_widget_set_activatable (ButtonWidget *button,
gboolean activatable)
......@@ -846,32 +761,6 @@ button_widget_get_icon_name (ButtonWidget *button)
return button->filename;
}
void
button_widget_set_stock_id (ButtonWidget *button,
const char *stock_id)
{
g_return_if_fail (BUTTON_IS_WIDGET (button));
if (button->stock_id && stock_id && !strcmp (button->stock_id, stock_id))
return;
if (button->stock_id)
g_free (button->stock_id);
button->stock_id = g_strdup (stock_id);
button_widget_reload_pixbuf (button);
g_object_notify (G_OBJECT (button), "stock-id");
}
const char *
button_widget_get_stock_id (ButtonWidget *button)
{
g_return_val_if_fail (BUTTON_IS_WIDGET (button), NULL);
return button->stock_id;
}
void
button_widget_set_orientation (ButtonWidget *button,
PanelOrientation orientation)
......
......@@ -22,10 +22,7 @@ struct _ButtonWidget {
GdkPixbuf *pixbuf;
GdkPixbuf *pixbuf_hc;
/* if filename doesn't lead to a findable icon,
try stock_id */
char *filename;
char *stock_id;
PanelOrientation orientation;
......@@ -45,18 +42,12 @@ GType button_widget_get_type (void) G_GNUC_CONST;
GtkWidget * button_widget_new (const char *pixmap,
gboolean arrow,
PanelOrientation orientation);
GtkWidget * button_widget_new_from_stock (const char *stock_id,
gboolean arrow,
PanelOrientation orientation);
void button_widget_set_activatable (ButtonWidget *button,
gboolean activatable);
gboolean button_widget_get_activatable (ButtonWidget *button);
void button_widget_set_icon_name (ButtonWidget *button,
const char *icon_name);
const char * button_widget_get_icon_name (ButtonWidget *button);
void button_widget_set_stock_id (ButtonWidget *button,
const char *stock_id);
const char * button_widget_get_stock_id (ButtonWidget *button);
void button_widget_set_orientation (ButtonWidget *button,
PanelOrientation orientation);
PanelOrientation button_widget_get_orientation (ButtonWidget *button);
......
......@@ -28,7 +28,6 @@
#include "panel-util.h"
#include "xstuff.h"
#include "panel-globals.h"
#include "panel-stock-icons.h"
#include "panel-lockdown.h"
static void
......@@ -339,13 +338,11 @@ create_drawer_applet (PanelToplevel *toplevel,
drawer->toplevel = toplevel;
if (!use_custom_icon || !custom_icon || !custom_icon [0]) {
drawer->button = button_widget_new_from_stock (PANEL_STOCK_DRAWER,
TRUE, orientation);
drawer->button = button_widget_new (PANEL_DRAWER_ICON, TRUE,
orientation);
} else {
drawer->button = button_widget_new (custom_icon, TRUE, orientation);
/* make sure there is a backup stock id */
button_widget_set_stock_id (BUTTON_WIDGET (drawer->button),
PANEL_STOCK_DRAWER);
drawer->button = button_widget_new (custom_icon, TRUE,
orientation);
}
if (!drawer->button) {
......@@ -762,7 +759,9 @@ panel_drawer_set_dnd_enabled (Drawer *drawer,
GDK_BUTTON1_MASK,
dnd_targets, 1,
GDK_ACTION_MOVE);
gtk_drag_source_set_icon_stock (drawer->button, PANEL_STOCK_DRAWER);
/* FIXME: waiting for bug #116577
gtk_drag_source_set_icon_name (drawer->button, PANEL_DRAWER_ICON); */
GTK_WIDGET_SET_FLAGS (drawer->button, GTK_NO_WINDOW);
} else
......
......@@ -5,6 +5,8 @@
G_BEGIN_DECLS
#define PANEL_DRAWER_ICON "drawer"
#define PANEL_DRAWER_N_LISTENERS 3
typedef struct {
......
......@@ -1147,11 +1147,8 @@ setup_internal_applet_drag (GtkWidget *menuitem,
menu_item_targets, 1,
GDK_ACTION_COPY);
if (panel_action_get_stock_icon (type) != NULL)
gtk_drag_source_set_icon_stock (menuitem,
panel_action_get_stock_icon (type));
/* FIXME: waiting for bug #116577
else
if (panel_action_get_icon_name (type) != NULL)
gtk_drag_source_set_icon_name (GTK_WIDGET (button),
panel_action_get_icon_name (type);
*/
......@@ -1464,7 +1461,7 @@ menu_create_action_item (PanelActionButtonType action_type)
setup_menu_item_with_icon (item,
panel_menu_icon_get_size (),
panel_action_get_icon_name (action_type),
panel_action_get_stock_icon (action_type),
NULL,
panel_action_get_text (action_type),
TRUE);
......
......@@ -36,7 +36,6 @@
#include "panel-config-global.h"
#include "panel-gconf.h"
#include "panel-profile.h"
#include "panel-stock-icons.h"
#include "panel-typebuiltins.h"
#include "panel-force-quit.h"
#include "panel-util.h"
......@@ -288,7 +287,6 @@ panel_action_connect_server (GtkWidget *widget)
typedef struct {
PanelActionButtonType type;
char *stock_icon;
char *icon_name;
char *text;
char *tooltip;
......@@ -306,12 +304,11 @@ typedef struct {
static PanelAction actions [] = {
{
PANEL_ACTION_NONE,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL
},
{
PANEL_ACTION_LOCK,
NULL,
"gnome-lockscreen",
N_("Lock Screen"),
N_("Protect your computer from unauthorized use"),
......@@ -324,7 +321,6 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_LOGOUT,
NULL,
"gnome-logout",
N_("Log Out"),
N_("Log out of this session to log in as a different user or to shut down the computer"),
......@@ -335,8 +331,7 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_RUN,
PANEL_STOCK_RUN,
NULL,
PANEL_RUN_ICON,
N_("Run Application..."),
N_("Run an Application by entering a command"),
"gospanel-555",
......@@ -346,7 +341,6 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_SEARCH,
NULL,
"gnome-searchtool",
N_("Search for Files..."),
N_("Find files, folders, and documents on your computer"),
......@@ -356,7 +350,6 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_SCREENSHOT,
NULL,
"applets-screenshooter",
N_("Take Screenshot..."),
N_("Take a screenshot of your desktop"),
......@@ -366,8 +359,7 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_FORCE_QUIT,
PANEL_STOCK_FORCE_QUIT,
NULL,
PANEL_FORCE_QUIT_ICON,
N_("Force Quit"),
N_("Force a misbehaving application to quit"),
"gospanel-563",
......@@ -377,7 +369,6 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_CONNECT_SERVER,
NULL,
"gnome-globe", //FIXME icon
N_("Connect to Server..."),
N_("Connect to a remote server"), //FIXME
......@@ -408,14 +399,6 @@ panel_action_get_invoke (PanelActionButtonType type)
return G_CALLBACK (actions[type].invoke);
}
G_CONST_RETURN char*
panel_action_get_stock_icon (PanelActionButtonType type)
{
g_return_val_if_fail (type > PANEL_ACTION_NONE && type < PANEL_ACTION_LAST, NULL);
return actions[type].stock_icon;
}
G_CONST_RETURN char*
panel_action_get_icon_name (PanelActionButtonType type)
{
......@@ -667,8 +650,6 @@ panel_action_button_set_type (PanelActionButton *button,
if (actions [type].icon_name != NULL)
button_widget_set_icon_name (BUTTON_WIDGET (button), actions [type].icon_name);
else
button_widget_set_stock_id (BUTTON_WIDGET (button), actions [type].stock_icon);
gtk_tooltips_set_tip (panel_tooltips, GTK_WIDGET (button),
_(actions [type].tooltip), NULL);
......@@ -721,8 +702,6 @@ panel_action_button_style_set (PanelActionButton *button)
{
if (actions [button->priv->type].icon_name != NULL)
button_widget_set_icon_name (BUTTON_WIDGET (button), actions [button->priv->type].icon_name);
else
button_widget_set_stock_id (BUTTON_WIDGET (button), actions [button->priv->type].stock_icon);
}
static void
......@@ -938,11 +917,8 @@ panel_action_button_set_dnd_enabled (PanelActionButton *button,
gtk_drag_source_set (GTK_WIDGET (button), GDK_BUTTON1_MASK,
dnd_targets, 1,
GDK_ACTION_COPY | GDK_ACTION_MOVE);
if (actions [button->priv->type].stock_icon != NULL)
gtk_drag_source_set_icon_stock (GTK_WIDGET (button),
actions [button->priv->type].stock_icon);
/* FIXME: waiting for bug #116577
else
if (actions [button->priv->type].icon_name != NULL)
gtk_drag_source_set_icon_name (GTK_WIDGET (button),
actions [button->priv->type].icon_name);
*/
......
......@@ -89,7 +89,6 @@ gboolean panel_action_button_load_from_drag (PanelToplevel *topleve
gboolean panel_action_get_is_disabled (PanelActionButtonType type);
GCallback panel_action_get_invoke (PanelActionButtonType type);
G_CONST_RETURN char *panel_action_get_stock_icon (PanelActionButtonType type);
G_CONST_RETURN char *panel_action_get_icon_name (PanelActionButtonType type);
G_CONST_RETURN char *panel_action_get_text (PanelActionButtonType type);
G_CONST_RETURN char *panel_action_get_tooltip (PanelActionButtonType type);
......
......@@ -33,7 +33,6 @@
#include "panel.h"
#include "drawer.h"
#include "panel-applet-frame.h"
#include "panel-stock-icons.h"
#include "panel-action-button.h"
#include "panel-menu-bar.h"
#include "panel-toplevel.h"
......@@ -84,7 +83,6 @@ typedef struct {
char *name;
char *description;
char *icon;
const char *stock_icon;
PanelActionButtonType action_type;
char *launcher_path;
char *menu_path;
......@@ -103,7 +101,6 @@ static PanelAddtoItemInfo special_addto_items [] = {
N_("Custom Application Launcher"),
N_("Create a new launcher"),
"launcher-program",
NULL,
PANEL_ACTION_NONE,
NULL,
NULL,
......@@ -114,7 +111,6 @@ static PanelAddtoItemInfo special_addto_items [] = {
N_("Application Launcher..."),
N_("Launch a program that is already in the GNOME menu"),
"launcher-program",
NULL,
PANEL_ACTION_NONE,
NULL,
NULL,
......@@ -128,8 +124,7 @@ static PanelAddtoItemInfo internal_addto_items [] = {
{ PANEL_ADDTO_MENU,
N_("Main Menu"),
N_("The main GNOME menu"),
NULL,
PANEL_STOCK_MAIN_MENU,
PANEL_MAIN_MENU_ICON,
PANEL_ACTION_NONE,
NULL,
NULL,
......@@ -139,8 +134,7 @@ static PanelAddtoItemInfo internal_addto_items [] = {
{ PANEL_ADDTO_MENUBAR,
N_("Menu Bar"),
N_("A custom menu bar"),
NULL,
PANEL_STOCK_GNOME_LOGO,
PANEL_GNOME_LOGO_ICON,
PANEL_ACTION_NONE,
NULL,
NULL,
......@@ -150,8 +144,7 @@ static PanelAddtoItemInfo internal_addto_items [] = {
{ PANEL_ADDTO_DRAWER,
N_("Drawer"),
N_("A pop out drawer to store other items in"),
"drawer",
NULL,
PANEL_DRAWER_ICON,
PANEL_ACTION_NONE,
NULL,
NULL,
......@@ -221,7 +214,6 @@ panel_addto_prepend_internal_applets (GSList *list)
info->name = (char *) panel_action_get_text (i);
info->description = (char *) panel_action_get_tooltip (i);
info->icon = (char *) panel_action_get_icon_name (i);
info->stock_icon = (char *) panel_action_get_stock_icon (i);
info->iid = (char *) panel_action_get_drag_id (i);
info->static_data = TRUE;
......@@ -264,6 +256,9 @@ panel_addto_make_pixbuf (const char *filename,
pb = panel_load_icon (gtk_icon_theme_get_default (), filename,
desired_height, NULL);
if (!pb)
return NULL;
width = gdk_pixbuf_get_width (pb);
height = gdk_pixbuf_get_height (pb);
......@@ -444,14 +439,11 @@ panel_addto_append_item (PanelAddtoDialog *dialog,
COLUMN_SEARCH, NULL,
-1);
} else {
pixbuf = NULL;
if (applet->icon != NULL) {
pixbuf = panel_addto_make_pixbuf (applet->icon,
GTK_ICON_SIZE_DIALOG);
} else {
pixbuf = gtk_widget_render_icon (GTK_WIDGET (dialog->panel_widget),
applet->stock_icon,
GTK_ICON_SIZE_DIALOG,
NULL);
}
gtk_list_store_append (model, &iter);
......
......@@ -39,6 +39,7 @@
#include "panel-marshal.h"
#include "panel-background.h"
#include "panel-lockdown.h"
#include "panel-stock-icons.h"
#define PANEL_APPLET_FRAME_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_APPLET_FRAME, PanelAppletFramePrivate))
......@@ -46,8 +47,6 @@
#define HANDLE_SIZE 10
#define PANEL_STOCK_DONT_DELETE "panel-dont-delete"
#define PROPERTY_ORIENT "panel-applet-orient"
#define PROPERTY_SIZE "panel-applet-size"
#define PROPERTY_BACKGROUND "panel-applet-background"
......@@ -963,33 +962,6 @@ panel_applet_frame_cnx_broken (ORBitConnection *cnx,
g_free (dialog_txt);
}
static inline void
register_stock_item (void)
{
static gboolean registered = FALSE;
if (!registered) {
GtkIconFactory *factory;
GtkIconSet *cancel_icons;
static GtkStockItem dont_delete_item [] = {
{ PANEL_STOCK_DONT_DELETE, N_("D_on't Delete"), 0, 0, GETTEXT_PACKAGE },
};
cancel_icons = gtk_icon_factory_lookup_default (GTK_STOCK_CANCEL);
factory = gtk_icon_factory_new ();
gtk_icon_factory_add (factory, PANEL_STOCK_DONT_DELETE, cancel_icons);
gtk_icon_factory_add_default (factory);
gtk_stock_add_static (dont_delete_item, 1);
registered = TRUE;
}
}
enum {
LOADING_FAILED_RESPONSE_DONT_DELETE,
LOADING_FAILED_RESPONSE_DELETE
......@@ -1019,7 +991,6 @@ panel_applet_frame_loading_failed (PanelAppletFrame *frame,
gboolean locked_down;
locked_down = panel_lockdown_get_locked_down ();
register_stock_item ();
problem_txt = g_strdup_printf (_("The panel encountered a problem "
"while loading \"%s\"."),
......
......@@ -66,7 +66,8 @@ display_popup_window (GdkScreen *screen)
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
image = gtk_image_new_from_stock (PANEL_STOCK_FORCE_QUIT, GTK_ICON_SIZE_DIALOG);
image = gtk_image_new_from_icon_name (PANEL_FORCE_QUIT_ICON,
GTK_ICON_SIZE_DIALOG);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), image, TRUE, TRUE, 4);
gtk_widget_show (image);
......
......@@ -29,6 +29,8 @@
G_BEGIN_DECLS
#define PANEL_FORCE_QUIT_ICON "panel-force-quit"
void panel_force_quit (GdkScreen *screen);
G_END_DECLS
......
......@@ -764,8 +764,8 @@ panel_menu_bar_instance_init (PanelMenuBar *menubar,
&menubar->priv->desktop_menu);
menubar->priv->applications_item = gtk_image_menu_item_new_with_label (_("Applications"));
image = gtk_image_new_from_stock (PANEL_STOCK_GNOME_LOGO,
panel_menu_bar_icon_get_size ());
image = gtk_image_new_from_icon_name (PANEL_GNOME_LOGO_ICON,
panel_menu_bar_icon_get_size ());
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menubar->priv->applications_item),
image);
......
/*
* panel-menu-bar.h: panel Applications/Actions menu bar
* panel-menu-bar.h: panel Applications/Places/Desktop menu bar
*
* Copyright (C) 2003 Sun Microsystems, Inc.
*
......@@ -30,6 +30,8 @@
G_BEGIN_DECLS
#define PANEL_GNOME_LOGO_ICON "gnome-logo-icon-transparent"
#define PANEL_TYPE_MENU_BAR (panel_menu_bar_get_type ())
#define PANEL_MENU_BAR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PANEL_TYPE_MENU_BAR, PanelMenuBar))
#define PANEL_MENU_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PANEL_TYPE_MENU_BAR, PanelMenuBarClass))
......
......@@ -31,7 +31,6 @@
#include "applet.h"
#include "panel-widget.h"
#include "panel-stock-icons.h"
#include "panel-util.h"
#include "panel-profile.h"
#include "panel-globals.h"
......@@ -91,8 +90,6 @@ panel_menu_button_instance_init (PanelMenuButton *button,
button->priv->use_menu_path = FALSE;
button->priv->use_custom_icon = FALSE;
button_widget_set_stock_id (BUTTON_WIDGET (button), PANEL_STOCK_MAIN_MENU);
}
static void
......@@ -615,18 +612,24 @@ panel_menu_button_get_icon (PanelMenuButton *button)
MenuTreeDirectory *directory;
char *retval;
if (!button->priv->use_menu_path || !button->priv->menu_path)
return NULL;
retval = NULL;
if (!panel_menu_button_create_menu (button))
return NULL;
if (button->priv->use_custom_icon &&
button->priv->custom_icon)
retval = g_strdup (button->priv->custom_icon);
directory = g_object_get_data (G_OBJECT (button->priv->menu),
"panel-menu-tree-directory");
if (!directory)
return NULL;
if (!retval &&
button->priv->use_menu_path &&
button->priv->menu_path &&
panel_menu_button_create_menu (button)) {
directory = g_object_get_data (G_OBJECT (button->priv->menu),
"panel-menu-tree-directory");
if (directory)
retval = g_strdup (menu_tree_directory_get_icon (directory));
}
retval = g_strdup (menu_tree_directory_get_icon (directory));
if (!retval)
retval = g_strdup (PANEL_MAIN_MENU_ICON);
return retval;
}
......@@ -634,14 +637,9 @@ panel_menu_button_get_icon (PanelMenuButton *button)
static void
panel_menu_button_set_icon (PanelMenuButton *button)
{
char *icon_path = NULL;
if (button->priv->use_custom_icon)
icon_path = g_strdup (button->priv->custom_icon);
if (!icon_path)
icon_path = panel_menu_button_get_icon (button);
char *icon_path;
icon_path = panel_menu_button_get_icon (button);
button_widget_set_icon_name (BUTTON_WIDGET (button), icon_path);
g_free (icon_path);
......@@ -898,8 +896,11 @@ panel_menu_button_set_dnd_enabled (PanelMenuButton *button,
gtk_drag_source_set (GTK_WIDGET (button), GDK_BUTTON1_MASK,
dnd_targets, 1,
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gtk_drag_source_set_icon_stock (GTK_WIDGET (button),
PANEL_STOCK_MAIN_MENU);
/* FIXME: waiting for bug #116577
icon = panel_menu_button_get_icon (button);
gtk_drag_source_set_icon_name (GTK_WIDGET (button), icon);
g_free (icon);
*/