Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
SDClowen committed Nov 6, 2024
1 parent 05c3070 commit ebe537e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions SDUI/Controls/UIWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Security.Policy;
using System.Windows.Forms;

namespace SDUI.Controls;
Expand Down Expand Up @@ -380,7 +379,7 @@ public HatchStyle Hatch
private Point animationSource;
private List<RectangleF> pageRect;
private const int TAB_HEADER_PADDING = 9;
private const int TAB_INDICATOR_HEIGHT = 2;
private const int TAB_INDICATOR_HEIGHT = 3;

private long _stickyBorderTime = 5000000;
[Description("Set or get the maximum time to stay at the edge of the display(ms)")]
Expand Down Expand Up @@ -971,6 +970,9 @@ protected override void OnPaint(PaintEventArgs e)
return;

//Animate page indicator
if (previousSelectedPageIndex == pageRect.Count)
previousSelectedPageIndex = -1;

var previousSelectedPageIndexIfHasOne = previousSelectedPageIndex == -1 ? _windowPageControl.SelectedIndex : previousSelectedPageIndex;
var previousActivePageRect = pageRect[previousSelectedPageIndexIfHasOne];
var activePageRect = pageRect[_windowPageControl.SelectedIndex];
Expand All @@ -983,7 +985,8 @@ protected override void OnPaint(PaintEventArgs e)
graphics.SetHighQuality();

//graphics.DrawRectangle(hoverColor, activePageRect.X, 0, width, _titleHeightDPI);
//graphics.FillRectangle(hoverColor, x, 0, width, TAB_INDICATOR_HEIGHT);
//graphics.FillRectangle(hoverColor, x, 0, width, _titleHeightDPI);
//graphics.FillRectangle(Color.DodgerBlue, x, _titleHeightDPI - TAB_INDICATOR_HEIGHT, width, TAB_INDICATOR_HEIGHT);

var measure = graphics.MeasureString(_windowPageControl.Controls[_windowPageControl.SelectedIndex].Text, Font);

Expand All @@ -992,7 +995,7 @@ protected override void OnPaint(PaintEventArgs e)

using var hoverBrush = new SolidBrush(hoverColor);

graphics.FillPath(hoverBrush, new RectangleF(x + 2, measure.Height / 2 - 4, width - 4, measure.Height + 6).Radius(8));
graphics.FillPath(hoverBrush, new RectangleF(x + 2, (_titleHeightDPI / 2) - (measure.Height * DPI / 2), width - 4, measure.Height * DPI).Radius(8));


//Draw tab headers
Expand Down

0 comments on commit ebe537e

Please sign in to comment.