コード例 #1
0
        private bool DrawAppIndicator()
        {
            try {
                indicator = new ApplicationIndicator("banshee",
                                                     (IconThemeUtils.HasIcon("banshee-panel")) ?
                                                     "banshee-panel" :
                                                     Banshee.ServiceStack.Application.IconName,
                                                     Category.ApplicationStatus);

                // Load the menu
                Gtk3.Menu menu = (Gtk3.Menu)interface_action_service.UIManager.GetWidget("/AppIndicatorTrayMenu");
                menu.Show();

                //This cannot be enabled at the moment because of the Gtk3/Gtk2 conflict. Need to find a solution
                //indicator.Menu = menu;

                // Show the tray icon
                indicator.Status = Status.Active;

                if (!QuitOnCloseSchema.Get())
                {
                    RegisterCloseHandler();
                }
            } catch (Exception e) {
                Hyena.Log.Warning("Error while trying to create the Application Indicator.", e.Message, false);
                return(false);
            }

            return(true);
        }
コード例 #2
0
        // This code has been shamelessly ripped off from
        // Tomboy, the wonderful life organizer!

        private void ConfigureIconSize()
        {
            // For some reason, the first time we ask for the allocation,
            // it's a 1x1 pixel.  Prevent against this by returning a
            // reasonable default.  Setting the icon causes OnSizeAllocated
            // to be called again anyhow. (--Boyd)
            int icon_size = panel_size;

            if (icon_size < 16)
            {
                icon_size = 16;
            }

            // Control specifically which icon is used at the smaller sizes
            // so that no scaling occurs. See bug #403500 for more info (--Boyd)
            if (icon_size <= 21)
            {
                icon_size = 16;
            }
            else if (icon_size <= 31)
            {
                icon_size = 22;
            }
            else if (icon_size <= 47)
            {
                icon_size = 32;
            }

            icon.IconName = (IconThemeUtils.HasIcon("banshee-panel")) ?
                            "banshee-panel" : Banshee.ServiceStack.Application.IconName;
            icon.PixelSize = icon_size;
        }
コード例 #3
0
        public GtkNotificationAreaBox(BaseClientWindow window)
        {
            Visible  = false;
            IconName = (IconThemeUtils.HasIcon("banshee-panel")) ?
                       "banshee-panel" : Banshee.ServiceStack.Application.IconName;

            Tooltip              = window.Title;
            window.TitleChanged += delegate { Tooltip = window.Title; };
        }
コード例 #4
0
        public GtkNotificationAreaBox(BaseClientWindow window)
        {
            Visible  = false;
            IconName = (IconThemeUtils.HasIcon("banshee-panel")) ?
                       "banshee-panel" : ServiceStack.Application.IconName;

            HasTooltip = true;
            Activate  += delegate { OnActivated(); };
            PopupMenu += delegate { OnPopupMenuEvent(); };
            _popup     = new TrackInfoPopup();
        }