Beispiel #1
0
        public SideBarTab(string label, string icon, Gtk.Orientation orientation)
        {
            Events           = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
            this.orientation = orientation;

            if (string.IsNullOrEmpty(icon))
            {
//				if (label == "Debug") icon = "md-execute-debug";
//				if (label == "Default") icon = "md-solution";
            }
            this.label    = label;
            this.icon     = icon;
            VisibleWindow = false;
            UpdateTab();
        }
Beispiel #2
0
        void OnHorizontalToolbar(object sender, System.EventArgs args)
        {
            if (toolbar.InitCompleted == false)
            {
                return;
            }

            const Gtk.Orientation orientation = Gtk.Orientation.Horizontal;

            if ((Gtk.Orientation)Preferences.Get <int> (Preferences.ToolbarOrientationKey) != orientation)
            {
                Preferences.Set <int>  (Preferences.ToolbarOrientationKey, (int)Gtk.Orientation.Horizontal);
                Preferences.Save();
            }
            toolbar.Attach(orientation);
        }
Beispiel #3
0
        protected override bool OnExposeEvent(Gdk.EventExpose args)
        {
            Rectangle rect = Allocation;

            if (Orientation == Orientation.Horizontal)
            {
                rect.Width = GripSize;
                rect.X    += MarginLeft;
            }
            else
            {
                rect.Height = GripSize;
                rect.Y     += MarginLeft;
            }

            Gtk.Orientation or = Orientation == Gtk.Orientation.Horizontal ? Gtk.Orientation.Vertical : Gtk.Orientation.Horizontal;
            Gtk.Style.PaintHandle(this.Style, this.ParentWindow, this.State, Gtk.ShadowType.None, args.Area, this, "grip", rect.X, rect.Y, rect.Width, rect.Height, or);
            return(true);
        }
Beispiel #4
0
		public SideBar (DefaultWorkbench workbench, Gtk.Orientation orientation)
		{
			bars.Add (this);
			this.orientation = orientation;
			if (orientation == Orientation.Vertical) {
				mainBox = this;
				boxTabs = new VBox (false, 0);
			} else {
				mainBox = new HBox ();
				PackStart (mainBox);
				boxTabs = new HBox (false, 0);
			}
			this.workbench = workbench;
			mainBox.PackStart (boxTabs, true, true, 0);
			AddinManager.ExtensionChanged += HandleAddinManagerExtensionChanged;
			ShowAll ();
			IdeApp.Workbench.LayoutChanged += HandleIdeAppWorkbenchLayoutChanged;
			UpdateTabs ();
		}
Beispiel #5
0
 public SideBar(DefaultWorkbench workbench, Gtk.Orientation orientation)
 {
     bars.Add(this);
     this.orientation = orientation;
     if (orientation == Orientation.Vertical)
     {
         mainBox = this;
         boxTabs = new VBox(false, 0);
     }
     else
     {
         mainBox = new HBox();
         PackStart(mainBox);
         boxTabs = new HBox(false, 0);
     }
     this.workbench = workbench;
     mainBox.PackStart(boxTabs, true, true, 0);
     AddinManager.ExtensionChanged += HandleAddinManagerExtensionChanged;
     ShowAll();
     IdeApp.Workbench.LayoutChanged += HandleIdeAppWorkbenchLayoutChanged;
     UpdateTabs();
 }
Beispiel #6
0
        public void Attach(Gtk.Orientation orientation_new)
        {
            Gtk.Box.BoxChild child = null;
            Box box;

            switch (Orientation)
            {
            case Gtk.Orientation.Vertical:
                box = main_hbox;
                break;

            case Gtk.Orientation.Horizontal:
            {
                box = framework_vbox;
                break;
            }

            default:
                throw new InvalidOperationException();
            }

            bool contained = false;

            foreach (var ch in box.AllChildren)
            {
                if (ch == this)
                {
                    contained = true;
                    break;
                }
            }
            if (contained == true)
            {
                box.Remove(this);
            }

            Orientation = (Gtk.Orientation)orientation_new;

            switch (Orientation)
            {
            case Gtk.Orientation.Vertical:
                main_hbox.Add(this);
                main_hbox.ReorderChild(this, 0);
                child = ((Gtk.Box.BoxChild)(main_hbox[this]));
                break;

            case Gtk.Orientation.Horizontal:
                framework_vbox.Add(this);
                framework_vbox.ReorderChild(this, 1);
                child = ((Gtk.Box.BoxChild)(framework_vbox[this]));
                break;

            default:
                throw new InvalidOperationException();
            }

            child.Expand = false;
            child.Fill   = false;
            ShowAll();
            InitCompleted = true;
        }
        void DrawSeparators(Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int currentHandleIndex, bool invalidateOnly, bool drawChildrenSep, List <Gdk.Rectangle> areasList)
        {
            if (type == DockGroupType.Tabbed || VisibleObjects.Count == 0)
            {
                return;
            }

            DockObject last = VisibleObjects [VisibleObjects.Count - 1];

            bool horiz = type == DockGroupType.Horizontal;
            int  x     = Allocation.X;
            int  y     = Allocation.Y;
            int  hw    = horiz ? Frame.HandleSize : Allocation.Width;
            int  hh    = horiz ? Allocation.Height : Frame.HandleSize;

            Gtk.Orientation or = horiz ? Gtk.Orientation.Vertical : Gtk.Orientation.Horizontal;

            for (int n = 0; n < VisibleObjects.Count; n++)
            {
                DockObject ob  = VisibleObjects [n];
                DockGroup  grp = ob as DockGroup;
                if (grp != null && drawChildrenSep)
                {
                    grp.DrawSeparators(exposedArea, currentHandleGrp, currentHandleIndex, invalidateOnly, areasList);
                }
                if (ob != last)
                {
                    if (horiz)
                    {
                        x += ob.Allocation.Width + Frame.HandlePadding;
                    }
                    else
                    {
                        y += ob.Allocation.Height + Frame.HandlePadding;
                    }

                    if (areasList != null)
                    {
                        if (Frame.ShadedSeparators)
                        {
                            areasList.Add(new Gdk.Rectangle(x, y, hw, hh));
                        }
                    }
                    else if (invalidateOnly)
                    {
                        Frame.Container.QueueDrawArea(x, y, hw, hh);
                    }
                    else
                    {
                        if (Frame.ShadedSeparators)
                        {
                            Frame.ShadedContainer.DrawBackground(Frame.Container, new Gdk.Rectangle(x, y, hw, hh));
                        }
                        else
                        {
                            StateType state = (currentHandleGrp == this && currentHandleIndex == n) ? StateType.Prelight : StateType.Normal;
                            if (!DockFrame.IsWindows)
                            {
                                Gtk.Style.PaintHandle(Frame.Style, Frame.Container.GdkWindow, state, ShadowType.None, exposedArea, Frame, "paned", x, y, hw, hh, or);
                            }
                        }
                    }

                    if (horiz)
                    {
                        x += Frame.HandleSize + Frame.HandlePadding;
                    }
                    else
                    {
                        y += Frame.HandleSize + Frame.HandlePadding;
                    }
                }
            }
        }
 public static void SetOrientation(this Atk.Object o, Gtk.Orientation orientation)
 {
 }
Beispiel #9
0
 protected override void OnAdjustSizeRequest(Gtk.Orientation orientation, out int minimum_size, out int natural_size)
 {
     base.OnAdjustSizeRequest(orientation, out minimum_size, out natural_size);
     // Gtk.Fixed only uses minimum size, not natural size. ugh.
     minimum_size = natural_size;
 }
Beispiel #10
0
		public SideBarTab (string label, string icon, Gtk.Orientation orientation)
		{
			Events = Events | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
			this.orientation = orientation;
			
			if (string.IsNullOrEmpty (icon)) {
//				if (label == "Debug") icon = "md-execute-debug";
//				if (label == "Default") icon = "md-solution";
			}
			this.label = label;
			this.icon = icon;
			VisibleWindow = false;
			UpdateTab ();
		}