mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2025-07-25 12:41:34 +03:00
Fixed splitter overlays not sizing correctly
This commit is contained in:
parent
8aa5d67d6e
commit
a6b6c376ac
@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@ -131,10 +132,10 @@ namespace DarkUI
|
|||||||
{
|
{
|
||||||
group.SendToBack();
|
group.SendToBack();
|
||||||
|
|
||||||
if (_groups.IsLast(group))
|
if (_groups.IsFirst(group))
|
||||||
group.Dock = dockStyle;
|
|
||||||
else
|
|
||||||
group.Dock = DockStyle.Fill;
|
group.Dock = DockStyle.Fill;
|
||||||
|
else
|
||||||
|
group.Dock = dockStyle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -200,7 +201,7 @@ namespace DarkUI
|
|||||||
_parentForm.ResizeEnd += ParentForm_ResizeEnd;
|
_parentForm.ResizeEnd += ParentForm_ResizeEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ParentForm_ResizeEnd(object sender, System.EventArgs e)
|
private void ParentForm_ResizeEnd(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_splitter != null)
|
if (_splitter != null)
|
||||||
_splitter.UpdateBounds();
|
_splitter.UpdateBounds();
|
||||||
|
@ -10,7 +10,11 @@ namespace DarkUI
|
|||||||
|
|
||||||
private Control _parentControl;
|
private Control _parentControl;
|
||||||
private Control _control;
|
private Control _control;
|
||||||
|
|
||||||
private DarkSplitterType _splitterType;
|
private DarkSplitterType _splitterType;
|
||||||
|
|
||||||
|
private int _minimum;
|
||||||
|
private int _maximum;
|
||||||
private DarkTranslucentForm _overlayForm;
|
private DarkTranslucentForm _overlayForm;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -30,7 +34,6 @@ namespace DarkUI
|
|||||||
_parentControl = parentControl;
|
_parentControl = parentControl;
|
||||||
_control = control;
|
_control = control;
|
||||||
_splitterType = splitterType;
|
_splitterType = splitterType;
|
||||||
_overlayForm = new DarkTranslucentForm(Color.Black);
|
|
||||||
|
|
||||||
switch (_splitterType)
|
switch (_splitterType)
|
||||||
{
|
{
|
||||||
@ -51,15 +54,15 @@ namespace DarkUI
|
|||||||
|
|
||||||
public void ShowOverlay()
|
public void ShowOverlay()
|
||||||
{
|
{
|
||||||
UpdateOverlay(new Point(0, 0));
|
_overlayForm = new DarkTranslucentForm(Color.Black);
|
||||||
|
_overlayForm.Visible = true;
|
||||||
|
|
||||||
_overlayForm.Show();
|
UpdateOverlay(new Point(0, 0));
|
||||||
_overlayForm.BringToFront();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HideOverlay()
|
public void HideOverlay()
|
||||||
{
|
{
|
||||||
_overlayForm.Hide();
|
_overlayForm.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateOverlay(Point difference)
|
public void UpdateOverlay(Point difference)
|
||||||
@ -82,8 +85,7 @@ namespace DarkUI
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_overlayForm.Location = bounds.Location;
|
_overlayForm.Bounds = bounds;
|
||||||
_overlayForm.Size = bounds.Size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Move(Point difference)
|
public void Move(Point difference)
|
||||||
|
@ -18,8 +18,9 @@ namespace DarkUI
|
|||||||
|
|
||||||
public DarkTranslucentForm(Color backColor, double opacity = 0.6)
|
public DarkTranslucentForm(Color backColor, double opacity = 0.6)
|
||||||
{
|
{
|
||||||
|
StartPosition = FormStartPosition.Manual;
|
||||||
FormBorderStyle = FormBorderStyle.None;
|
FormBorderStyle = FormBorderStyle.None;
|
||||||
Size = new Size(0, 0);
|
Size = new Size(1, 1);
|
||||||
ShowInTaskbar = false;
|
ShowInTaskbar = false;
|
||||||
AllowTransparency = true;
|
AllowTransparency = true;
|
||||||
Opacity = opacity;
|
Opacity = opacity;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user