mirror of
https://github.com/colhountech/DarkUI.Net5.git
synced 2025-07-05 00:19:27 +03:00
Tabs now invalidated when dock text changed.
This commit is contained in:
parent
06e5d26801
commit
8a9e763fcf
@ -8,6 +8,12 @@ namespace DarkUI.Docking
|
||||
[ToolboxItem(false)]
|
||||
public class DarkDockContent : UserControl
|
||||
{
|
||||
#region Event Handler Region
|
||||
|
||||
public event EventHandler DockTextChanged;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Field Region
|
||||
|
||||
private string _dockText;
|
||||
@ -28,7 +34,8 @@ namespace DarkUI.Docking
|
||||
|
||||
_dockText = value;
|
||||
|
||||
// todo: trigger tabs to re-calculate in parent group
|
||||
if (DockTextChanged != null)
|
||||
DockTextChanged(this, null);
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
@ -68,6 +68,8 @@ namespace DarkUI.Docking
|
||||
_contents.Add(dockContent);
|
||||
Controls.Add(dockContent);
|
||||
|
||||
dockContent.DockTextChanged += DockContent_DockTextChanged;
|
||||
|
||||
_tabs.Add(dockContent, new DarkDockTab(dockContent));
|
||||
|
||||
if (VisibleContent == null)
|
||||
@ -96,6 +98,8 @@ namespace DarkUI.Docking
|
||||
_contents.Remove(dockContent);
|
||||
Controls.Remove(dockContent);
|
||||
|
||||
dockContent.DockTextChanged -= DockContent_DockTextChanged;
|
||||
|
||||
if (_tabs.ContainsKey(dockContent))
|
||||
_tabs.Remove(dockContent);
|
||||
|
||||
@ -514,6 +518,11 @@ namespace DarkUI.Docking
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
private void DockContent_DockTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Render Region
|
||||
|
@ -213,7 +213,7 @@ namespace Example
|
||||
DockPanel.AddContent(content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private DarkDockContent GetContentBySerializationKey(string key)
|
||||
{
|
||||
foreach (var window in _toolWindows)
|
||||
|
Loading…
x
Reference in New Issue
Block a user