Пример #1
0
        public DockFrame()
        {
            Mono.TextEditor.GtkWorkarounds.FixContainerLeak(this);

            dockBarTop    = new DockBar(this, Gtk.PositionType.Top);
            dockBarBottom = new DockBar(this, Gtk.PositionType.Bottom);
            dockBarLeft   = new DockBar(this, Gtk.PositionType.Left);
            dockBarRight  = new DockBar(this, Gtk.PositionType.Right);

            container = new DockContainer(this);
            HBox hbox = new HBox();

            hbox.PackStart(dockBarLeft, false, false, 0);
            hbox.PackStart(container, true, true, 0);
            hbox.PackStart(dockBarRight, false, false, 0);
            mainBox = new VBox();
            mainBox.PackStart(dockBarTop, false, false, 0);
            mainBox.PackStart(hbox, true, true, 0);
            mainBox.PackStart(dockBarBottom, false, false, 0);
            Add(mainBox);
            mainBox.ShowAll();
            mainBox.NoShowAll = true;
            CompactGuiLevel   = 2;
            dockBarTop.UpdateVisibility();
            dockBarBottom.UpdateVisibility();
            dockBarLeft.UpdateVisibility();
            dockBarRight.UpdateVisibility();

            DefaultVisualStyle = new DockVisualStyle();
        }
Пример #2
0
		public void CopyValuesFrom (DockVisualStyle style)
		{
			if (style.PadBackgroundColor != null)
				PadBackgroundColor = style.PadBackgroundColor;
			if (style.PadTitleLabelColor != null)
				PadTitleLabelColor = style.PadTitleLabelColor;
			if (style.TabStyle != null)
				TabStyle = style.TabStyle;
			if (style.TreeBackgroundColor != null)
				TreeBackgroundColor = style.TreeBackgroundColor;
			if (style.ShowPadTitleIcon != null)
				ShowPadTitleIcon = style.ShowPadTitleIcon;
			if (style.UppercaseTitles != null)
				UppercaseTitles = style.UppercaseTitles;
			if (style.ExpandedTabs != null)
				ExpandedTabs = style.ExpandedTabs;
			if (style.InactivePadBackgroundColor != null)
				InactivePadBackgroundColor = style.InactivePadBackgroundColor;
			if (style.PadTitleHeight != null)
				PadTitleHeight = style.PadTitleHeight;
			if (style.SingleColumnMode != null)
				SingleColumnMode = style.SingleColumnMode;
			if (style.SingleRowMode != null)
				SingleRowMode = style.SingleRowMode;
		}
Пример #3
0
        /// <summary>
        /// Gets the style for a dock object, which will inherit values from all region/style definitions
        /// </summary>
        internal DockVisualStyle GetRegionStyleForObject(DockObject obj)
        {
            DockVisualStyle mergedStyle = null;

            if (obj is DockGroupItem)
            {
                DockVisualStyle s;
                if (stylesById.TryGetValue(((DockGroupItem)obj).Id, out s))
                {
                    mergedStyle = DefaultVisualStyle.Clone();
                    mergedStyle.CopyValuesFrom(s);
                }
            }
            foreach (var e in regionStyles)
            {
                if (InRegion(e.Item1, obj))
                {
                    if (mergedStyle == null)
                    {
                        mergedStyle = DefaultVisualStyle.Clone();
                    }
                    mergedStyle.CopyValuesFrom(e.Item2);
                }
            }
            return(mergedStyle ?? DefaultVisualStyle);
        }
Пример #4
0
 /// <summary>
 /// Sets the style for a region of the dock frame
 /// </summary>
 /// <param name='regionPosition'>
 /// A region is a collection with the format: "ItemId1/Position1;ItemId2/Position2..."
 /// ItemId is the id of a dock item. Position is one of the values of the DockPosition enumeration
 /// </param>
 /// <param name='style'>
 /// Style.
 /// </param>
 public void SetRegionStyle(string regionPosition, DockVisualStyle style)
 {
     // Remove any old region style and add it
     regionStyles.RemoveAll(s => s.Item1 == regionPosition);
     if (style != null)
     {
         regionStyles.Add(new Tuple <string, DockVisualStyle> (regionPosition, style));
     }
 }
Пример #5
0
 public void SetDockItemStyle(string itemId, DockVisualStyle style)
 {
     if (style != null)
     {
         stylesById [itemId] = style;
     }
     else
     {
         stylesById.Remove(itemId);
     }
 }
Пример #6
0
 public void CopyValuesFrom(DockVisualStyle style)
 {
     if (style.PadBackgroundColor != null)
     {
         PadBackgroundColor = style.PadBackgroundColor;
     }
     if (style.PadTitleLabelColor != null)
     {
         PadTitleLabelColor = style.PadTitleLabelColor;
     }
     if (style.InactivePadTitleLabelColor != null)
     {
         InactivePadTitleLabelColor = style.InactivePadTitleLabelColor;
     }
     if (style.TabStyle != null)
     {
         TabStyle = style.TabStyle;
     }
     if (style.TreeBackgroundColor != null)
     {
         TreeBackgroundColor = style.TreeBackgroundColor;
     }
     if (style.ShowPadTitleIcon != null)
     {
         ShowPadTitleIcon = style.ShowPadTitleIcon;
     }
     if (style.UppercaseTitles != null)
     {
         UppercaseTitles = style.UppercaseTitles;
     }
     if (style.ExpandedTabs != null)
     {
         ExpandedTabs = style.ExpandedTabs;
     }
     if (style.InactivePadBackgroundColor != null)
     {
         InactivePadBackgroundColor = style.InactivePadBackgroundColor;
     }
     if (style.PadTitleHeight != null)
     {
         PadTitleHeight = style.PadTitleHeight;
     }
     if (style.SingleColumnMode != null)
     {
         SingleColumnMode = style.SingleColumnMode;
     }
     if (style.SingleRowMode != null)
     {
         SingleRowMode = style.SingleRowMode;
     }
 }
Пример #7
0
		public static DockVisualStyle CreateDefaultStyle ()
		{
			DockVisualStyle s = new DockVisualStyle ();
			s.PadBackgroundColor = new Xwt.Drawing.Color (0,0,0);
			s.PadTitleLabelColor = new Xwt.Drawing.Color (0,0,0);
			s.TabStyle = DockTabStyle.Normal;
			s.TreeBackgroundColor = null;
			s.ShowPadTitleIcon = true;
			s.UppercaseTitles = false;
			s.ExpandedTabs = false;
			s.InactivePadBackgroundColor = new Xwt.Drawing.Color (0,0,0);
			s.PadTitleHeight = -1;
			s.SingleRowMode = false;
			s.SingleColumnMode = false;
			return s;
		}
Пример #8
0
        public static DockVisualStyle CreateDefaultStyle()
        {
            DockVisualStyle s = new DockVisualStyle();

            s.PadBackgroundColor         = new Xwt.Drawing.Color(0, 0, 0);
            s.PadTitleLabelColor         = new Xwt.Drawing.Color(0, 0, 0);
            s.TabStyle                   = DockTabStyle.Normal;
            s.TreeBackgroundColor        = null;
            s.ShowPadTitleIcon           = true;
            s.UppercaseTitles            = false;
            s.ExpandedTabs               = false;
            s.InactivePadBackgroundColor = new Xwt.Drawing.Color(0, 0, 0);
            s.PadTitleHeight             = -1;
            s.SingleRowMode              = false;
            s.SingleColumnMode           = false;
            return(s);
        }
Пример #9
0
        /// <summary>
        /// Gets the style assigned to a specific position of the layout
        /// </summary>
        /// <returns>
        /// The region style for position.
        /// </returns>
        /// <param name='parentGroup'>
        /// Group which contains the position
        /// </param>
        /// <param name='childIndex'>
        /// Index of the position inside the group
        /// </param>
        /// <param name='insertingPosition'>
        /// If true, the position will be inserted (meaning that the objects in childIndex will be shifted 1 position)
        /// </param>
        internal DockVisualStyle GetRegionStyleForPosition(DockGroup parentGroup, int childIndex, bool insertingPosition)
        {
            DockVisualStyle mergedStyle = null;

            foreach (var e in regionStyles)
            {
                if (InRegion(e.Item1, parentGroup, childIndex, insertingPosition))
                {
                    if (mergedStyle == null)
                    {
                        mergedStyle = DefaultVisualStyle.Clone();
                    }
                    mergedStyle.CopyValuesFrom(e.Item2);
                }
            }
            return(mergedStyle ?? DefaultVisualStyle);
        }
Пример #10
0
        void UpdateStyle()
        {
            var s = itemStyle != null ? itemStyle : regionStyle;

            if (s != currentVisualStyle)
            {
                currentVisualStyle = s;
                if (titleTab != null)
                {
                    titleTab.VisualStyle = s;
                }
                if (widget != null)
                {
                    widget.VisualStyle = s;
                }
                frame.UpdateStyle(this);
            }
        }
Пример #11
0
        public DockFrame()
        {
            GtkWorkarounds.FixContainerLeak(this);

            Accessible.Name = "DockFrame";

            dockBarTop = new DockBar(this, Gtk.PositionType.Top);
            dockBarTop.Accessible.Name = "DockFrame.TopBar";

            dockBarBottom = new DockBar(this, Gtk.PositionType.Bottom);
            dockBarBottom.Accessible.Name = "DockFrame.BottomBar";

            dockBarLeft = new DockBar(this, Gtk.PositionType.Left);
            dockBarLeft.Accessible.Name = "DockFrame.LeftBar";

            dockBarRight = new DockBar(this, Gtk.PositionType.Right);
            dockBarRight.Accessible.Name = "DockFrame.RightBar";

            container = new DockContainer(this);
            container.Accessible.Name = "DockFrame.Main";

            HBox hbox = new HBox();

            hbox.Accessible.SetShouldIgnore(true);

            hbox.PackStart(dockBarLeft, false, false, 0);
            hbox.PackStart(container, true, true, 0);
            hbox.PackStart(dockBarRight, false, false, 0);
            mainBox = new VBox();
            mainBox.Accessible.SetShouldIgnore(true);

            mainBox.PackStart(dockBarTop, false, false, 0);
            mainBox.PackStart(hbox, true, true, 0);
            mainBox.PackStart(dockBarBottom, false, false, 0);
            Add(mainBox);
            mainBox.ShowAll();
            mainBox.NoShowAll = true;
            CompactGuiLevel   = 2;
            UpdateDockbarsVisibility();

            DefaultVisualStyle = new DockVisualStyle();
        }
Пример #12
0
		/// <summary>
		/// Sets the style for a region of the dock frame
		/// </summary>
		/// <param name='regionPosition'>
		/// A region is a collection with the format: "ItemId1/Position1;ItemId2/Position2..."
		/// ItemId is the id of a dock item. Position is one of the values of the DockPosition enumeration
		/// </param>
		/// <param name='style'>
		/// Style.
		/// </param>
		public void SetRegionStyle (string regionPosition, DockVisualStyle style)
		{
			// Remove any old region style and add it
			regionStyles.RemoveAll (s => s.Item1 == regionPosition);
			if (style != null)
				regionStyles.Add (new Tuple<string,DockVisualStyle> (regionPosition, style));
		}
Пример #13
0
        void CreateComponents()
        {
            fullViewVBox = new VBox (false, 0);
            rootWidget = fullViewVBox;

            InstallMenuBar ();
            Realize ();
            toolbar = DesktopService.CreateMainToolbar (this);
            DesktopService.SetMainWindowDecorations (this);
            var toolbarBox = new HBox ();
            fullViewVBox.PackStart (toolbarBox, false, false, 0);
            toolbarFrame = new CommandFrame (IdeApp.CommandService);

            fullViewVBox.PackStart (toolbarFrame, true, true, 0);

            // Create the docking widget and add it to the window.
            dock = new DockFrame ();

            dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness) + 1;
            IdeApp.Preferences.WorkbenchCompactnessChanged += delegate {
                dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness) + 1;
            };

            /* Side bar is experimental. Disabled for now
            HBox hbox = new HBox ();
            VBox sideBox = new VBox ();
            sideBox.PackStart (new SideBar (workbench, Orientation.Vertical), false, false, 0);
            hbox.PackStart (sideBox, false, false, 0);
            hbox.ShowAll ();
            sideBox.NoShowAll = true;
            hbox.PackStart (dock, true, true, 0);
            DockBar bar = dock.ExtractDockBar (PositionType.Left);
            bar.AlwaysVisible = true;
            sideBox.PackStart (bar, true, true, 0);
            toolbarFrame.AddContent (hbox);
            */

            toolbarFrame.AddContent (dock);

            // Create the notebook for the various documents.
            tabControl = new SdiDragNotebook (this);

            DockNotebook.ActiveNotebookChanged += delegate {
                OnActiveWindowChanged (null, null);
            };

            Add (fullViewVBox);
            fullViewVBox.ShowAll ();
            bottomBar = new MonoDevelopStatusBar ();
            fullViewVBox.PackEnd (bottomBar, false, true, 0);
            bottomBar.ShowAll ();
            toolbarBox.PackStart (this.toolbar, true, true, 0);

            // In order to get the correct bar height we need to calculate the tab size using the
            // correct style (the style of the window). At this point the widget is not yet a child
            // of the window, so its style is not yet the correct one.
            tabControl.InitSize ();
            var barHeight = tabControl.BarHeight;

            // The main document area
            documentDockItem = dock.AddItem ("Documents");
            documentDockItem.Behavior = DockItemBehavior.Locked;
            documentDockItem.Expand = true;
            documentDockItem.DrawFrame = false;
            documentDockItem.Label = GettextCatalog.GetString ("Documents");
            documentDockItem.Content = new DockNotebookContainer (tabControl, true);

            DockVisualStyle style = new DockVisualStyle ();
            style.PadTitleLabelColor = Styles.PadLabelColor;
            style.PadBackgroundColor = Styles.PadBackground;
            style.InactivePadBackgroundColor = Styles.InactivePadBackground;
            style.PadTitleHeight = barHeight;
            dock.DefaultVisualStyle = style;

            style = new DockVisualStyle ();
            style.PadTitleLabelColor = Styles.PadLabelColor;
            style.PadTitleHeight = barHeight;
            style.ShowPadTitleIcon = false;
            style.UppercaseTitles = false;
            style.ExpandedTabs = true;
            style.PadBackgroundColor = Styles.BrowserPadBackground;
            style.InactivePadBackgroundColor = Styles.InactiveBrowserPadBackground;
            style.TreeBackgroundColor = Styles.BrowserPadBackground;
            dock.SetDockItemStyle ("ProjectPad", style);
            dock.SetDockItemStyle ("ClassPad", style);

            //			dock.SetRegionStyle ("Documents/Left", style);
            //dock.SetRegionStyle ("Documents/Right", style);

            //			style = new DockVisualStyle ();
            //			style.SingleColumnMode = true;
            //			dock.SetRegionStyle ("Documents/Left;Documents/Right", style);
            //			dock.SetDockItemStyle ("Documents", style);

            // Add some hiden items to be used as position reference
            DockItem dit = dock.AddItem ("__left");
            dit.DefaultLocation = "Documents/Left";
            dit.Behavior = DockItemBehavior.Locked;
            dit.DefaultVisible = false;

            dit = dock.AddItem ("__right");
            dit.DefaultLocation = "Documents/Right";
            dit.Behavior = DockItemBehavior.Locked;
            dit.DefaultVisible = false;

            dit = dock.AddItem ("__top");
            dit.DefaultLocation = "Documents/Top";
            dit.Behavior = DockItemBehavior.Locked;
            dit.DefaultVisible = false;

            dit = dock.AddItem ("__bottom");
            dit.DefaultLocation = "Documents/Bottom";
            dit.Behavior = DockItemBehavior.Locked;
            dit.DefaultVisible = false;

            if (MonoDevelop.Core.Platform.IsMac)
                bottomBar.HasResizeGrip = true;
            else {
                if (GdkWindow != null && GdkWindow.State == Gdk.WindowState.Maximized)
                    bottomBar.HasResizeGrip = false;
                SizeAllocated += delegate {
                    if (GdkWindow != null)
                        bottomBar.HasResizeGrip = GdkWindow.State != Gdk.WindowState.Maximized;
                };
            }

            // create DockItems for all the pads
            ExtensionNodeList padCodons = AddinManager.GetExtensionNodes (viewContentPath);
            foreach (ExtensionNode node in padCodons)
                ShowPadNode (node);

            try {
                if (System.IO.File.Exists (configFile)) {
                    dock.LoadLayouts (configFile);
                    foreach (string layout in dock.Layouts) {
                        if (!layouts.Contains (layout) && !layout.EndsWith (fullViewModeTag))
                            layouts.Add (layout);
                    }
                }
            } catch (Exception ex) {
                LoggingService.LogError (ex.ToString ());
            }
        }
Пример #14
0
		internal DockItem (DockFrame frame, string id)
		{
			this.frame = frame;
			this.id = id;
			currentVisualStyle = regionStyle = frame.GetRegionStyleForItem (this);
		}
Пример #15
0
		void UpdateStyle ()
		{
			var s = itemStyle != null ? itemStyle : regionStyle;
			if (s != currentVisualStyle) {
				currentVisualStyle = s;
				if (titleTab != null)
					titleTab.VisualStyle = s;
				if (widget != null)
					widget.VisualStyle = s;
				frame.UpdateStyle (this);
			}
		}
Пример #16
0
		internal void SetRegionStyle (DockVisualStyle style)
		{
			regionStyle = style;
			UpdateStyle ();
		}
Пример #17
0
		public void SetDockItemStyle (string itemId, DockVisualStyle style)
		{
			if (style != null)
				stylesById [itemId] = style;
			else
				stylesById.Remove (itemId);
		}
Пример #18
0
 internal void SetStyle(DockVisualStyle style)
 {
     topFrame.BackgroundColor = style.PadBackgroundColor.Value.ToGdkColor();
 }
Пример #19
0
		void LoadDockStyles ()
		{
			var barHeight = tabControl.BarHeight;

			DockVisualStyle style = new DockVisualStyle ();
			style.PadTitleLabelColor = Styles.PadLabelColor;
			style.InactivePadTitleLabelColor = Styles.InactivePadLabelColor;
			style.PadBackgroundColor = Styles.PadBackground;
			style.TreeBackgroundColor = Styles.BaseBackgroundColor;
			style.InactivePadBackgroundColor = Styles.InactivePadBackground;
			style.PadTitleHeight = barHeight;
			dock.DefaultVisualStyle = style;

			style = new DockVisualStyle ();
			style.PadTitleLabelColor = Styles.PadLabelColor;
			style.InactivePadTitleLabelColor = Styles.InactivePadLabelColor;
			style.PadTitleHeight = barHeight;
			// style.ShowPadTitleIcon = false; // VV: Now we want to have icons on all pads
			style.UppercaseTitles = false;
			style.ExpandedTabs = true;
			style.PadBackgroundColor = Styles.BrowserPadBackground;
			style.InactivePadBackgroundColor = Styles.InactiveBrowserPadBackground;
			style.TreeBackgroundColor = Styles.BrowserPadBackground;
			dock.SetDockItemStyle ("ProjectPad", style);
			dock.SetDockItemStyle ("ClassPad", style);



			//			dock.SetRegionStyle ("Documents/Left", style);
			//dock.SetRegionStyle ("Documents/Right", style);

			//			style = new DockVisualStyle ();
			//			style.SingleColumnMode = true;
			//			dock.SetRegionStyle ("Documents/Left;Documents/Right", style);
			//			dock.SetDockItemStyle ("Documents", style);

			dock.UpdateStyles ();
		}
Пример #20
0
 internal void SetRegionStyle(DockVisualStyle style)
 {
     regionStyle = style;
     UpdateStyle();
 }
Пример #21
0
 internal DockItem(DockFrame frame, string id)
 {
     this.frame         = frame;
     this.id            = id;
     currentVisualStyle = regionStyle = frame.GetRegionStyleForItem(this);
 }
Пример #22
0
		public DockFrame ()
		{
			GtkWorkarounds.FixContainerLeak (this);

			dockBarTop = new DockBar (this, Gtk.PositionType.Top);
			dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom);
			dockBarLeft = new DockBar (this, Gtk.PositionType.Left);
			dockBarRight = new DockBar (this, Gtk.PositionType.Right);
			
			container = new DockContainer (this);
			HBox hbox = new HBox ();
			hbox.PackStart (dockBarLeft, false, false, 0);
			hbox.PackStart (container, true, true, 0);
			hbox.PackStart (dockBarRight, false, false, 0);
			mainBox = new VBox ();
			mainBox.PackStart (dockBarTop, false, false, 0);
			mainBox.PackStart (hbox, true, true, 0);
			mainBox.PackStart (dockBarBottom, false, false, 0);
			Add (mainBox);
			mainBox.ShowAll ();
			mainBox.NoShowAll = true;
			CompactGuiLevel = 2;
			UpdateDockbarsVisibility ();

			DefaultVisualStyle = new DockVisualStyle ();
		}
Пример #23
0
		internal void SetStyle (DockVisualStyle style)
		{
			topFrame.BackgroundColor = style.PadBackgroundColor.Value.ToGdkColor ();
		}