Re: Transparent panel icons



Eskil Heyn Olsen <deity@dbc.dk> writes:

> Duh, I've got a pixmap on my panel, and I sort of expected the pixmap to
> show through. But yeah, on themes and std. background it works fine.
> mmmm...

Ok, I've been looking around and stole a bit of code from the printer
applet.  It works for panel background colors.  However, it won't work
well for pixmaps (just try the printer applet to see how).  So, I've
emailed gnome-devel-list for advice.

However, I discovered that I broke minor things like clicking the
applet, so here's a patch to fix it.

-- 
Alan Shutko <ats@acm.org> - In a variety of flavors!
Is a wedding successful if it comes off without a hitch?

cvs server: Diffing applet
Index: applet/ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-pilot/applet/ChangeLog,v
retrieving revision 1.5
diff -c -r1.5 ChangeLog
*** applet/ChangeLog	1999/11/04 15:01:20	1.5
--- applet/ChangeLog	1999/11/04 18:52:52
***************
*** 1,3 ****
--- 1,8 ----
+ 1999-11-04  Alan Shutko  <ats@acm.org>
+ 
+ 	* pilot.c (create_pilot_widget): Put pixmap in an event_box, to
+ 	handle the click event.
+ 
  1999-11-03  Alan Shutko  <ats@acm.org>
  
  	* pilot.c (create_pilot_widget): Added space to tooltip.
Index: applet/pilot.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/applet/pilot.c,v
retrieving revision 1.30
diff -c -r1.30 pilot.c
*** applet/pilot.c	1999/11/04 15:01:20	1.30
--- applet/pilot.c	1999/11/04 18:52:52
***************
*** 579,585 ****
  static GtkWidget *
  create_pilot_widget(GtkWidget *window)
  {
-   GtkWidget *frame;
    GtkWidget *event_box;
    GtkStyle *style;
    int i;
--- 579,584 ----
***************
*** 600,618 ****
    for (i = 0; i < sizeof(pixmaps)/sizeof(pixmaps[0]); i++)
        pixmaps[i] = gnome_unconditional_pixmap_file(pixmaps[i]);
    
    pixmap = gnome_pixmap_new_from_file(pixmaps[curstate]);
  
!   gtk_widget_set_events(pixmap, gtk_widget_get_events(pixmap) |
  			GDK_BUTTON_PRESS_MASK);
!   gtk_signal_connect(GTK_OBJECT(pixmap), "button-press-event",
  		     GTK_SIGNAL_FUNC(pilot_clicked_cb), NULL);
  
  
    gtk_widget_show(pixmap);  
! 
!   frame = gtk_frame_new(NULL);
!   gtk_frame_set_shadow_type(GTK_FRAME(frame),GTK_SHADOW_NONE);
!   gtk_container_add(GTK_CONTAINER(frame),pixmap);
  
    timeout_handler_id = gtk_timeout_add(1000,timeout,pixmap);
    
--- 599,617 ----
    for (i = 0; i < sizeof(pixmaps)/sizeof(pixmaps[0]); i++)
        pixmaps[i] = gnome_unconditional_pixmap_file(pixmaps[i]);
    
+   event_box = gtk_event_box_new();
+   
    pixmap = gnome_pixmap_new_from_file(pixmaps[curstate]);
  
!   
!   gtk_widget_set_events(event_box, gtk_widget_get_events(applet) |
  			GDK_BUTTON_PRESS_MASK);
!   gtk_signal_connect(GTK_OBJECT(event_box), "button-press-event",
  		     GTK_SIGNAL_FUNC(pilot_clicked_cb), NULL);
  
  
    gtk_widget_show(pixmap);  
!   gtk_container_add(GTK_CONTAINER(event_box), pixmap);
  
    timeout_handler_id = gtk_timeout_add(1000,timeout,pixmap);
    
***************
*** 654,660 ****
  		     NULL);
  
  
!   return frame;
  }
  
  static GtkWidget * applet_start_new_applet(const gchar *goad_id, const char **params, int nparams) {
--- 653,659 ----
  		     NULL);
  
  
!   return event_box;
  }
  
  static GtkWidget * applet_start_new_applet(const gchar *goad_id, const char **params, int nparams) {
cvs server: Diffing capplet
cvs server: Diffing conduits
cvs server: Diffing conduits/address
cvs server: Diffing conduits/backup
cvs server: Diffing conduits/calendar
cvs server: Diffing conduits/email
cvs server: Diffing conduits/file
cvs server: Diffing conduits/memo
cvs server: Diffing conduits/memo_file
cvs server: Diffing drafts
cvs server: Diffing drafts/idl
cvs server: Diffing drafts/mvachhar
cvs server: Diffing gpilot-fileman
cvs server: Diffing gpilotd
cvs server: Diffing idl
cvs server: Diffing macros
cvs server: Diffing po
cvs server: Diffing utils



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]