public override void Initialize()
 {
     base.Initialize();
     toolbar = new HeaderBox();
     toolbar.GradientBackground = true;
     toolbar.SetMargins(0, 1, 0, 0);
     MainBox.PackStart(toolbar, false, false, 0);
     ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0;
 }
        public override void Initialize()
        {
            base.Initialize();

            var image = Xwt.Drawing.Image.FromResource(typeof(MacPlatformService).Assembly, "maintoolbarbg.png");

            Window.Realized += delegate {
                NSWindow w = GtkQuartz.GetWindow(Window);
                w.IsOpaque        = false;
                w.BackgroundColor = NSColor.FromPatternImage(image.ToBitmap().ToNSImage());
                w.StyleMask      |= NSWindowStyle.TexturedBackground;
            };

            toolbar                = new CustomToolbar();
            toolbar.Background     = (Gdk.Pixbuf)Xwt.Toolkit.Load(Xwt.ToolkitType.Gtk).GetNativeImage(image);
            toolbar.TitleBarHeight = MacPlatformService.GetTitleBarHeight();
            MainBox.PackStart(toolbar, false, false, 0);
            ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0;
        }
Exemple #3
0
        public override void Initialize()
        {
            base.Initialize();

            var resource = "maintoolbarbg.png";

            Window.Realized += delegate {
                NSWindow w = GtkQuartz.GetWindow(Window);
                w.IsOpaque = false;
                NSImage img = MacPlatformService.LoadImage(resource);
                w.BackgroundColor = NSColor.FromPatternImage(img);
                w.StyleMask      |= NSWindowStyle.TexturedBackground;
            };

            toolbar                = new CustomToolbar();
            toolbar.Background     = MonoDevelop.Components.CairoExtensions.LoadImage(typeof(MacPlatformService).Assembly, resource);
            toolbar.TitleBarHeight = MacPlatformService.GetTitleBarHeight();
            MainBox.PackStart(toolbar, false, false, 0);
            ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0;
        }