Esempio n. 1
0
        public BezelDrawingArea(IDoController controller, IRenderTheme theme, bool preview) : base()
        {
            this.controller = controller;
            TextUtility     = new TextRenderer(this);

            DoubleBuffered = false;
            this.preview   = preview;
            this.theme     = theme;

            if (theme.Name == "Nouveau")             //this is a temporary hack
            {
                style = HUDStyle.HUD;
            }
            else
            {
                style = HUDStyle.Classic;                 //gets us the classic results list
            }
            ResetRenderStyle();
            SetDrawingArea();

            BezelDrawingArea.ThemeChanged += OnThemeChanged;
            Realized += delegate {
                GdkWindow.SetBackPixmap(null, false);
            };

            StyleSet += delegate {
                if (IsRealized)
                {
                    GdkWindow.SetBackPixmap(null, false);
                }
            };
        }
Esempio n. 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);
                }
            };
        }
Esempio n. 3
0
 public void Initialize(IDoController controller)
 {
     this.controller = controller;
     Build();
 }