private void DrawTab_Document(Graphics g, IDockContent content, Rectangle rect) { g.SmoothingMode = SmoothingMode.AntiAlias; Rectangle rectText = rect; rectText.X += DocumentTextExtraWidth / 2; rectText.Width -= DocumentTextExtraWidth; if (DockPane.ActiveContent == content) { DrawUtil.DrawVSTab(g, rect, Color.WhiteSmoke, Color.Black, false);; // g.FillRectangle(MainForm.DarkColor //ActiveBackBrush // , rect); // g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X, rect.Y + rect.Height); // g.DrawLine(OutlineOuterPen, rect.X, rect.Y, rect.X + rect.Width - 1, rect.Y); // g.DrawLine(OutlineInnerPen, // rect.X + rect.Width - 1, rect.Y, // rect.X + rect.Width - 1, rect.Y + rect.Height - 1); if (DockPane.IsActiveDocumentPane) { using (Font boldFont = new Font(this.Font, FontStyle.Bold)) { g.DrawString(content.DockHandler.TabText, boldFont, ActiveTextBrush, rectText, DocumentTextStringFormat); } } else { g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, DocumentTextStringFormat); } } else { // if (Tabs.IndexOf(DockPane.ActiveContent) != Tabs.IndexOf(content) + 1) // { // g.DrawLine(TabSeperatorPen, // rect.X + rect.Width - 1, rect.Y, // rect.X + rect.Width - 1, rect.Y + rect.Height - 1 - DocumentTabGapTop); // // DrawUtil.DrawVSTab(g,rect,Color.Silver,Color.Gray,false); // } DrawUtil.DrawVSTab(g, rect, Color.Gainsboro, Color.Silver, false); g.DrawLine(Pens.Black, rect.Right, rect.Bottom - 1, rect.Left - 10, rect.Bottom - 1); g.DrawString(content.DockHandler.TabText, Font, InactiveTextBrush, rectText, DocumentTextStringFormat); } }
private void DrawTab(Graphics g, AutoHideTabFromBase tab) { Rectangle rectTab = GetTabRectangle(tab); if (rectTab.IsEmpty) { return; } DockState dockState = tab.Content.DockHandler.DockState; IDockContent content = tab.Content; BeginDrawTab(); Pen penTabBorder = PenTabBorder; Brush brushTabText = new SolidBrush(ColorMixer.AutoHideTabTextColor); if (dockState == DockState.DockTopAutoHide || dockState == DockState.DockRightAutoHide) { DrawUtil.DrawVSTab(g, rectTab, Color.WhiteSmoke, Color.DimGray, false); } else { DrawUtil.DrawVSTab(g, rectTab, Color.WhiteSmoke, Color.DimGray, false); } // g.FillRectangle(new LinearGradientBrush(rectTab,ColorMixer.DarkColor,ColorMixer.LightColor,LinearGradientMode.Vertical) // , rectTab); // // g.DrawLine(penTabBorder, rectTab.Left, rectTab.Top, rectTab.Left, rectTab.Bottom); // g.DrawLine(penTabBorder, rectTab.Right, rectTab.Top, rectTab.Right, rectTab.Bottom); // if (dockState == DockState.DockTopAutoHide || dockState == DockState.DockRightAutoHide) // g.DrawLine(penTabBorder, rectTab.Left, rectTab.Bottom, rectTab.Right, rectTab.Bottom); // else // g.DrawLine(penTabBorder, rectTab.Left, rectTab.Top, rectTab.Right, rectTab.Top); // Set no rotate for drawing icon and text Matrix matrixRotate = g.Transform; g.Transform = MatrixIdentity; // Draw the icon Rectangle rectImage = rectTab; rectImage.X += ImageGapLeft; rectImage.Y += ImageGapTop; int imageHeight = rectTab.Height - ImageGapTop - ImageGapBottom; int imageWidth = ImageWidth; if (imageHeight > ImageHeight) { imageWidth = ImageWidth * (imageHeight / ImageHeight); } rectImage.Height = imageHeight; rectImage.Width = imageWidth; rectImage = GetTransformedRectangle(dockState, rectImage); g.DrawIcon(content.DockHandler.Icon, rectImage); // Draw the text if (content == content.DockHandler.Pane.ActiveContent) { Rectangle rectText = rectTab; rectText.X += ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft; rectText.Width -= ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft; rectText = GetTransformedRectangle(dockState, rectText); if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide) { g.DrawString(content.DockHandler.TabText, Font, brushTabText, rectText, StringFormatTabVertical); } else { g.DrawString(content.DockHandler.TabText, Font, brushTabText, rectText, StringFormatTabHorizontal); } } // Set rotate back g.Transform = matrixRotate; EndDrawTab(); }