示例#1
0
        private void ResetRenderStyle()
        {
            BuildRenderers();

            if (colors == null)
            {
                colors = new BezelColors(BackgroundColor);
            }
            else
            {
                colors.RebuildColors(BackgroundColor);
            }

            SetDrawingArea();
        }
示例#2
0
        public BezelGlassResults(IDoController controller, int width, HUDStyle style, BezelColors colors) : base()
        {
            this.controller = controller;
            this.style      = style;
            this.colors     = colors;
            switch (style)
            {
            case HUDStyle.Classic:
                ItemRenderer = new BezelFullResultItemRenderer(this);
                num_results  = 5;
                break;

            case HUDStyle.HUD:
                ItemRenderer = new BezelHalfResultItemRenderer(this);
                num_results  = 8;
                break;
            }

            surface_cache    = new Dictionary <Do.Universe.Item, Surface> ();
            secondary        = new int[0];
            border_width     = 12;
            top_border_width = 20;
            this.width       = width;
            height           = num_results * SurfaceHeight + top_border_width + BottomBorderWidth;
            SetSizeRequest(width, height);

            DoubleBuffered = false;

            this.Shown += delegate {
                Context = context;
                Draw();
            };

            BezelDrawingArea.ThemeChanged += delegate {
                if (background != null)
                {
                    background.Dispose();
                }
                if (highlight_surface != null)
                {
                    highlight_surface.Dispose();
                }
                if (child_inout_surface != null)
                {
                    child_inout_surface.Dispose();
                }
                if (triplebuffer != null)
                {
                    triplebuffer.Dispose();
                }
                if (backbuffer != null)
                {
                    backbuffer.Dispose();
                }

                highlight_surface = backbuffer = child_inout_surface = triplebuffer = background = null;
            };

            Realized += delegate {
                this.GdkWindow.SetBackPixmap(null, false);
            };

            StyleSet += delegate {
                if (IsRealized)
                {
                    GdkWindow.SetBackPixmap(null, false);
                }
            };
        }