Fixed splitter overlays not sizing correctly

This commit is contained in:
Robin 2015-09-20 11:57:27 +01:00
parent 8aa5d67d6e
commit a6b6c376ac
3 changed files with 17 additions and 13 deletions

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
@ -131,10 +132,10 @@ namespace DarkUI
{
group.SendToBack();
if (_groups.IsLast(group))
group.Dock = dockStyle;
else
if (_groups.IsFirst(group))
group.Dock = DockStyle.Fill;
else
group.Dock = dockStyle;
}
}
}
@ -200,7 +201,7 @@ namespace DarkUI
_parentForm.ResizeEnd += ParentForm_ResizeEnd;
}
private void ParentForm_ResizeEnd(object sender, System.EventArgs e)
private void ParentForm_ResizeEnd(object sender, EventArgs e)
{
if (_splitter != null)
_splitter.UpdateBounds();

View File

@ -10,7 +10,11 @@ namespace DarkUI
private Control _parentControl;
private Control _control;
private DarkSplitterType _splitterType;
private int _minimum;
private int _maximum;
private DarkTranslucentForm _overlayForm;
#endregion
@ -30,7 +34,6 @@ namespace DarkUI
_parentControl = parentControl;
_control = control;
_splitterType = splitterType;
_overlayForm = new DarkTranslucentForm(Color.Black);
switch (_splitterType)
{
@ -51,15 +54,15 @@ namespace DarkUI
public void ShowOverlay()
{
UpdateOverlay(new Point(0, 0));
_overlayForm = new DarkTranslucentForm(Color.Black);
_overlayForm.Visible = true;
_overlayForm.Show();
_overlayForm.BringToFront();
UpdateOverlay(new Point(0, 0));
}
public void HideOverlay()
{
_overlayForm.Hide();
_overlayForm.Visible = false;
}
public void UpdateOverlay(Point difference)
@ -82,8 +85,7 @@ namespace DarkUI
break;
}
_overlayForm.Location = bounds.Location;
_overlayForm.Size = bounds.Size;
_overlayForm.Bounds = bounds;
}
public void Move(Point difference)

View File

@ -18,8 +18,9 @@ namespace DarkUI
public DarkTranslucentForm(Color backColor, double opacity = 0.6)
{
StartPosition = FormStartPosition.Manual;
FormBorderStyle = FormBorderStyle.None;
Size = new Size(0, 0);
Size = new Size(1, 1);
ShowInTaskbar = false;
AllowTransparency = true;
Opacity = opacity;