Panel patch adding missing icons
- From: mawarkus t-online de (Matthias Warkus)
- To: gnome-list gnome org
- Cc: jirka 5z com
- Subject: Panel patch adding missing icons
- Date: Sun, 8 Aug 1999 14:19:04 +0200
Finally, I make use of the often-mentioned "We accept patches." option
and submit you a patch to gnome-core/panel/menu.c which fills
following positions in the panel context menu with icons:
- Add main menu (gnome-logo-icon-transparent.png)
- Add drawer (panel-drawer.png)
- Add log out button (gnome-term-night.png)
- Add lock screen button (gnome-lockscreen.png)
- Add launcher (launcher-program.png)
- Create new panel (GNOME_STOCK_PIXMAP_NEW)
- Remove this panel (GNOME_STOCK_PIXMAP_REMOVE)
This is CCed to the panel maintainer. I do not dare add it to CVS
myself.
==START DIFF==
--- menu.c.old Sun Aug 8 13:06:20 1999
+++ menu.c Sun Aug 8 14:12:32 1999
@@ -2430,7 +2430,10 @@
make_panel_submenu(panel_menu,TRUE);
menuitem = gtk_menu_item_new ();
- setup_menuitem (menuitem, NULL, _("Remove this panel"));
+ setup_menuitem (menuitem,
+ gnome_stock_pixmap_widget(panel_menu,
+ GNOME_STOCK_PIXMAP_REMOVE),
+ _("Remove this panel"));
gtk_menu_append (GTK_MENU (panel_menu), menuitem);
gtk_signal_connect_object (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
@@ -2583,6 +2586,12 @@
{
GtkWidget *menuitem;
GtkWidget *m;
+ char *pixmap_filename;
+ GnomePixmap *gnome_logo_pm;
+ GnomePixmap *gnome_drawer_pm;
+ GnomePixmap *gnome_logout_pm;
+ GnomePixmap *gnome_lock_pm;
+ GnomePixmap *gnome_launcher_pm;
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add applet"));
@@ -2593,35 +2602,75 @@
GTK_SIGNAL_FUNC(submenu_to_display),
menuitem);
- menuitem = gtk_menu_item_new ();
- setup_menuitem (menuitem, 0, _("Add main menu"));
+ /* Menu entries with external pixmaps:
+ 1. Get file name with gnome_pixmap_file
+ 2. Warn if lookup failed
+ 3. Get pixmap from file with gnome_pixmap_new_from_file_at_size
+ 4. Warn if load failed
+ 5. Use pixmap. Yahoo.
+
+ Gurus, please tell me if any of these steps are superfluous, thanks.
+ mawa */
+
+ pixmap_filename = gnome_pixmap_file("gnome-logo-icon-transparent.png");
+ if (NULL == pixmap_filename)
+ g_warning(_("Could not find pixmap `gnome-logo-icon-transparent.png'"));
+ gnome_logo_pm =
+ GNOME_PIXMAP(gnome_pixmap_new_from_file_at_size(pixmap_filename, 24, 24));
+ if (NULL == gnome_logo_pm)
+ g_warning(_("Could not load pixmap %s"), pixmap_filename);
+ menuitem = gtk_menu_item_new ();
+ setup_menuitem (menuitem,
+ GTK_WIDGET(gnome_logo_pm),
+ _("Add main menu"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
GTK_SIGNAL_FUNC(add_menu_to_panel),
NULL);
setup_internal_applet_drag(menuitem, "MENU:MAIN");
+ pixmap_filename = gnome_pixmap_file("panel-drawer.png");
+ if (NULL == pixmap_filename)
+ g_warning(_("Could not find pixmap `panel-drawer.png'"));
+ gnome_drawer_pm = GNOME_PIXMAP(gnome_pixmap_new_from_file_at_size(pixmap_filename, 24, 24));
+ if (NULL == gnome_drawer_pm)
+ g_warning(_("Could not load pixmap %s"), pixmap_filename);
menuitem = gtk_menu_item_new ();
- setup_menuitem (menuitem, 0, _("Add drawer"));
+ setup_menuitem (menuitem,
+ GTK_WIDGET(gnome_drawer_pm),
+ _("Add drawer"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) add_drawer_to_panel,
NULL);
setup_internal_applet_drag(menuitem, "DRAWER:NEW");
-
- menuitem = gtk_menu_item_new ();
- setup_menuitem (menuitem, 0, _("Add log out button"));
+ pixmap_filename = gnome_pixmap_file("gnome-term-night.png");
+ if (NULL == pixmap_filename)
+ g_warning(_("Could not find pixmap `gnome-term-night.png'"));
+ gnome_logout_pm = GNOME_PIXMAP(gnome_pixmap_new_from_file_at_size(pixmap_filename, 24, 24));
+ if (NULL == gnome_logout_pm)
+ g_warning(_("Could not load pixmap %s"), pixmap_filename);
+ menuitem = gtk_menu_item_new ();
+ setup_menuitem (menuitem,
+ GTK_WIDGET(gnome_logout_pm),
+ _("Add log out button"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
GTK_SIGNAL_FUNC(add_logout_to_panel),
NULL);
setup_internal_applet_drag(menuitem, "LOGOUT:NEW");
-
-
+ pixmap_filename = gnome_pixmap_file("gnome-lockscreen.png");
+ if (NULL == pixmap_filename)
+ g_warning(_("Could not find pixmap `gnome-lockscreen.png'"));
+ gnome_lock_pm = GNOME_PIXMAP(gnome_pixmap_new_from_file_at_size(pixmap_filename, 24, 24));
+ if (NULL == gnome_lock_pm)
+ g_warning(_("Could not load pixmap %s"), pixmap_filename);
menuitem = gtk_menu_item_new ();
- setup_menuitem (menuitem, 0, _("Add lock button"));
+ setup_menuitem (menuitem,
+ GTK_WIDGET(gnome_lock_pm),
+ _("Add lock button"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
GTK_SIGNAL_FUNC(add_lock_to_panel),
@@ -2636,8 +2685,16 @@
GTK_SIGNAL_FUNC(ask_about_swallowing_cb),NULL);
setup_internal_applet_drag(menuitem, "SWALLOW:ASK");
- menuitem = gtk_menu_item_new ();
- setup_menuitem (menuitem, 0, _("Add new launcher"));
+ pixmap_filename = gnome_pixmap_file("launcher-program.png");
+ if (NULL == pixmap_filename)
+ g_warning(_("Could not find pixmap `launcherprogram.png'"));
+ gnome_launcher_pm = GNOME_PIXMAP(gnome_pixmap_new_from_file_at_size(pixmap_filename, 24, 24));
+ if (NULL == gnome_launcher_pm)
+ g_warning(_("Could not load pixmap %s"), pixmap_filename);
+ menuitem = gtk_menu_item_new ();
+ setup_menuitem (menuitem,
+ GTK_WIDGET(gnome_launcher_pm),
+ _("Add new launcher"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
GTK_SIGNAL_FUNC(ask_about_launcher_cb),NULL);
@@ -2684,7 +2741,10 @@
add_menu_separator(menu);
menuitem = gtk_menu_item_new ();
- setup_menuitem (menuitem, 0, _("Create new panel"));
+ setup_menuitem (menuitem,
+ gnome_stock_pixmap_widget(menu,
+ GNOME_STOCK_PIXMAP_NEW),
+ _("Create new panel"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem),
create_add_panel_submenu());
==END DIFF==
It'd be nice if someone could add me to the appropriate credits file
if this patch should be accepted.
mawa
--
Q: What do you call a boomerang that doesn't work?
A: A stick.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]