Commit e9ed81ed authored by Jacob Berkman's avatar Jacob Berkman Committed by Jacob Berkman

turn it inside out

2000-05-04  Jacob Berkman  <jacob@helixcode.com>

	* menu.c (load_icons_handler): turn it inside out

	* main.c (main):
	* gnome-panel-properties.c (main):
	* gnome-run.c (show_run_dialog): use the new icon hint stuff

	* menu.c (create_menuitem): set the comment as a tooltip on
	the menu items

	* menu-fentry.[ch]: save the comment too
parent 7621a8f8
2000-05-04 Jacob Berkman <jacob@helixcode.com>
* menu.c (load_icons_handler): turn it inside out
* main.c (main):
* gnome-panel-properties.c (main):
* gnome-run.c (show_run_dialog): use the new icon hint stuff
* menu.c (create_menuitem): set the comment as a tooltip on
the menu items
* menu-fentry.[ch]: save the comment too
Tue May 02 23:17:17 2000 George Lebl <jirka@5z.com>
* foobar-widget.c: use the main tooltips for date tooltip
......
2000-05-04 Jacob Berkman <jacob@helixcode.com>
* menu.c (load_icons_handler): turn it inside out
* main.c (main):
* gnome-panel-properties.c (main):
* gnome-run.c (show_run_dialog): use the new icon hint stuff
* menu.c (create_menuitem): set the comment as a tooltip on
the menu items
* menu-fentry.[ch]: save the comment too
Tue May 02 23:17:17 2000 George Lebl <jirka@5z.com>
* foobar-widget.c: use the main tooltips for date tooltip
......
......@@ -25,6 +25,7 @@
#include <config.h>
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <libgnomeui/gnome-window-icon.h>
#include <gdk/gdkx.h>
#include "capplet-widget.h"
#include "global-keys.h"
......@@ -1340,7 +1341,7 @@ main (int argc, char **argv)
if(gnome_capplet_init("gnome-panel-properties", VERSION, argc,
argv, NULL, 0, NULL) < 0)
return 1;
gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-panel.png");
loadup_vals();
loaded_config = global_config;
......
......@@ -25,6 +25,7 @@
#include <config.h>
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <libgnomeui/gnome-window-icon.h>
#include <gdk/gdkx.h>
#include "capplet-widget.h"
#include "global-keys.h"
......@@ -1340,7 +1341,7 @@ main (int argc, char **argv)
if(gnome_capplet_init("gnome-panel-properties", VERSION, argc,
argv, NULL, 0, NULL) < 0)
return 1;
gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-panel.png");
loadup_vals();
loaded_config = global_config;
......
......@@ -22,6 +22,7 @@
#include <config.h>
#include <gnome.h>
#include <libgnomeui/gnome-window-icon.h>
#include <errno.h>
#include "panel-include.h"
......@@ -196,6 +197,8 @@ show_run_dialog ()
}
dialog = gnome_dialog_new(_("Run Program"), NULL);
gnome_window_icon_set_from_file (GTK_WINDOW (dialog),
GNOME_ICONDIR"/gnome-run.png");
gtk_signal_connect(GTK_OBJECT(dialog), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&dialog);
......
......@@ -13,6 +13,7 @@
#include <sys/wait.h>
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <libgnomeui/gnome-window-icon.h>
#include "panel-include.h"
......@@ -166,6 +167,7 @@ main(int argc, char **argv)
&argc, argv,
GNORBA_INIT_SERVER_FUNC, &ev);
CORBA_exception_free(&ev);
gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-panel.png");
setup_visuals ();
switch (panel_corba_gtk_init (orb)) {
......
......@@ -120,6 +120,7 @@ fr_free(FileRec *fr, int free_fr)
if(!fr) return;
g_free(fr->name);
g_free(fr->fullname);
g_free(fr->comment);
g_free(fr->icon);
g_free(fr->goad_id);
if(fr->parent && free_fr)
......@@ -211,6 +212,7 @@ fr_fill_dir(FileRec *fr, int sublevels)
ffr->icon = dentry->icon;
dentry->icon = NULL;
ffr->fullname = dentry->name;
ffr->comment = g_strdup (dentry->comment);
dentry->name = NULL;
ffr->goad_id =
get_applet_goad_id_from_dentry(dentry);
......@@ -272,6 +274,8 @@ fr_read_dir(DirRec *dr, const char *mdir, struct stat *dstat, int sublevels)
dentry->icon = NULL;
g_free(fr->fullname);
fr->fullname = dentry->name;
g_free(fr->comment);
fr->comment = g_strdup (dentry->comment);
dentry->name = NULL;
gnome_desktop_entry_free(dentry);
} else {
......@@ -279,6 +283,8 @@ fr_read_dir(DirRec *dr, const char *mdir, struct stat *dstat, int sublevels)
fr->icon = NULL;
g_free(fr->fullname);
fr->fullname = NULL;
g_free(fr->comment);
fr->comment = NULL;
}
/*if we statted*/
if(s.st_mtime)
......@@ -361,6 +367,8 @@ fr_check_and_reread(FileRec *fr)
ffr->icon = NULL;
g_free(ffr->fullname);
ffr->fullname = NULL;
g_free(ffr->comment);
ffr->comment = NULL;
ddr->dentrymtime = 0;
any_change = TRUE;
}
......@@ -377,6 +385,8 @@ fr_check_and_reread(FileRec *fr)
dentry->icon = NULL;
g_free(ffr->fullname);
ffr->fullname = dentry->name;
g_free(ffr->comment);
ffr->comment = g_strdup (dentry->comment);
dentry->name = NULL;
gnome_desktop_entry_free(dentry);
} else {
......@@ -384,6 +394,8 @@ fr_check_and_reread(FileRec *fr)
ffr->icon = NULL;
g_free(ffr->fullname);
ffr->fullname = NULL;
g_free(ffr->comment);
ffr->comment = NULL;
}
ddr->dentrymtime = s.st_mtime;
dr->dentrylast_stat = curtime;
......@@ -407,6 +419,8 @@ fr_check_and_reread(FileRec *fr)
dentry->icon = NULL;
g_free(ffr->fullname);
ffr->fullname = dentry->name;
g_free(ffr->comment);
ffr->comment = g_strdup (dentry->comment);
dentry->name = NULL;
gnome_desktop_entry_free(dentry);
} else {
......
......@@ -29,6 +29,7 @@ enum {
struct _FileRec {
int type;
char *name;
char *comment;
char *fullname;
char *icon;
char *goad_id;
......
......@@ -59,6 +59,8 @@ extern char *kde_menudir;
extern char *kde_icondir;
extern char *kde_mini_icondir;
extern GtkTooltips *panel_tooltips;
typedef struct _TearoffMenu TearoffMenu;
struct _TearoffMenu {
GtkWidget *menu;
......@@ -391,64 +393,67 @@ fake_destroyed(GtkWidget *w, FakeIcon *fake)
static gboolean
load_icons_handler(gpointer data)
{
if(icons_to_load) {
GtkWidget *parent;
GtkWidget *pixmap = NULL;
GtkWidget *toplevel;
GdkPixbuf *pb, *pb2;
GdkPixmap *gp;
GdkBitmap *gm;
FakeIcon *fake = icons_to_load->data;
icons_to_load = g_slist_remove(icons_to_load, fake);
parent = fake->fake->parent;
/* don't kill the fake now, we'll kill it with the pixmap */
gtk_signal_disconnect_by_data(GTK_OBJECT(fake->fake), fake);
gtk_widget_destroy(fake->fake);
pb = gdk_pixbuf_new_from_file(fake->file);
if(!pb) {
g_free(fake->file);
g_free(fake);
return TRUE;
}
pb2 = gdk_pixbuf_new(GDK_COLORSPACE_RGB, gdk_pixbuf_get_has_alpha(pb),
8, fake->size, fake->size);
GtkWidget *parent;
GtkWidget *pixmap = NULL;
GtkWidget *toplevel;
GdkPixbuf *pb, *pb2;
GdkPixmap *gp;
GdkBitmap *gm;
scale_down(parent, parent->state, pb2, pb);
gdk_pixbuf_unref(pb);
FakeIcon *fake;
gdk_pixbuf_render_pixmap_and_mask (pb2, &gp, &gm, 128);
if (!icons_to_load) {
load_icons_id = 0;
return FALSE;
}
gdk_pixbuf_unref(pb2);
fake = icons_to_load->data;
icons_to_load = g_slist_remove(icons_to_load, fake);
pixmap = gtk_pixmap_new(gp, gm);
gdk_pixmap_unref(gp);
parent = fake->fake->parent;
/* don't kill the fake now, we'll kill it with the pixmap */
gtk_signal_disconnect_by_data(GTK_OBJECT(fake->fake), fake);
if (gm != NULL) /* Is this right? Some icons dont seem to have alpha. */
gdk_bitmap_unref(gm);
gtk_widget_destroy(fake->fake);
fake->fake = pixmap;
toplevel = gtk_widget_get_toplevel(parent);
gtk_signal_connect_while_alive(GTK_OBJECT(toplevel), "unmap",
GTK_SIGNAL_FUNC(pixmap_unmap),
fake,
GTK_OBJECT(pixmap));
gtk_signal_connect(GTK_OBJECT(pixmap), "destroy",
GTK_SIGNAL_FUNC(fake_destroyed), fake);
pb = gdk_pixbuf_new_from_file(fake->file);
if(!pb) {
g_free(fake->file);
g_free(fake);
return TRUE;
}
pb2 = gdk_pixbuf_new(GDK_COLORSPACE_RGB, gdk_pixbuf_get_has_alpha(pb),
8, fake->size, fake->size);
scale_down(parent, parent->state, pb2, pb);
gdk_pixbuf_unref (pb);
gtk_widget_show(pixmap);
gtk_container_add(GTK_CONTAINER(parent), pixmap);
gdk_pixbuf_render_pixmap_and_mask (pb2, &gp, &gm, 128);
gdk_pixbuf_unref(pb2);
pixmap = gtk_pixmap_new(gp, gm);
gdk_pixmap_unref(gp);
/* if still more we'll come back */
if(icons_to_load)
return TRUE;
}
load_icons_id = 0;
return FALSE;
if (gm != NULL) /* Is this right? Some icons dont seem to have alpha. */
gdk_bitmap_unref(gm);
fake->fake = pixmap;
toplevel = gtk_widget_get_toplevel(parent);
gtk_signal_connect_while_alive(GTK_OBJECT(toplevel), "unmap",
GTK_SIGNAL_FUNC(pixmap_unmap),
fake,
GTK_OBJECT(pixmap));
gtk_signal_connect(GTK_OBJECT(pixmap), "destroy",
GTK_SIGNAL_FUNC(fake_destroyed), fake);
gtk_widget_show(pixmap);
gtk_container_add(GTK_CONTAINER(parent), pixmap);
/* if still more we'll come back */
return TRUE;
}
static void
......@@ -2149,6 +2154,10 @@ create_menuitem(GtkWidget *menu,
(*first_item)++;
*add_separator = FALSE;
}
if(fr->comment)
gtk_tooltips_set_tip (panel_tooltips, menuitem,
fr->comment, NULL);
gtk_menu_append (GTK_MENU (menu), menuitem);
if(!sub) {
......
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