From b4a74487d416e8464ac2b82749bb281ca0558f1c Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Wed, 12 Oct 2005 19:30:36 +0000 Subject: [PATCH] Tray changes --- c_gui/CasaTray.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/c_gui/CasaTray.cs b/c_gui/CasaTray.cs index d605f251..d8f69d88 100644 --- a/c_gui/CasaTray.cs +++ b/c_gui/CasaTray.cs @@ -21,6 +21,11 @@ namespace Novell.CASA.GUI public static System.Drawing.Icon m_iconNormal; public static System.Drawing.Icon m_iconLocked; #endif +#if LINUX + EventBox eb; + private Gtk.Image m_imageLocked = new Image("gtk-dialog-authentication", IconSize.Menu); + private Gtk.Image m_imageUnlocked = new Image(Stock.MissingImage, IconSize.Menu); +#endif private static CasaMain mCasaMain = null; @@ -81,12 +86,11 @@ namespace Novell.CASA.GUI #endif #if LINUX /* in order to receive signals, we need a eventbox, because Gtk.Image doesn't receive signals */ - EventBox eb = new EventBox(); - eb.Add(new Image(Stock.MissingImage, IconSize.Menu)); // using stock icon + eb = new EventBox(); + eb.Add(m_iconNormal); // using stock icon // hooking event - eb.ButtonPressEvent += new ButtonPressEventHandler (this.OnImageClick); - - + eb.ButtonPressEvent += new ButtonPressEventHandler (this.OnImageClick); + Egg.TrayIcon icon = new Egg.TrayIcon("Test"); icon.Add(eb); // showing the trayicon @@ -263,6 +267,13 @@ namespace Novell.CASA.GUI else notifyIcon.Icon = m_iconNormal; #endif +#if LINUX + if (StoreIsLocked) + eb.Reparent(m_imageLocked); + else + eb.Reparent(m_imageUnlocked); +#endif + } } } \ No newline at end of file