Respect isDraggable by toggling WindowChrome caption drag

This commit is contained in:
Meik
2026-03-05 12:52:33 +01:00
parent 63f1ffc57d
commit 44d1d63349
2 changed files with 15 additions and 4 deletions

View File

@@ -67,6 +67,7 @@ namespace C4IT_CustomerPanel
private DispatcherTimer _adHocTimer;
private DispatcherTimer _regularTimer;
private DispatcherTimer _checkServerConnectionTimer;
private const double HeaderCaptionHeight = 72d;
private bool _initialTimerInvocationDone = false;
private bool _manualRefreshInProgress = false;
private TimeSpan _lastTicketInterval;
@@ -506,10 +507,7 @@ namespace C4IT_CustomerPanel
private void SetAppearance(bool firstStart)
{
if (!ConfigSettings.GetConfig()._isDraggable)
{
ResetLocation();
}
ApplyWindowDraggableState();
System.Collections.ObjectModel.Collection<ResourceDictionary> themes = new System.Collections.ObjectModel.Collection<ResourceDictionary>();
if (ConfigSettings.GetConfig()._iconColor != 0)
@@ -559,6 +557,18 @@ namespace C4IT_CustomerPanel
}
}
private void ApplyWindowDraggableState()
{
bool draggable = ConfigSettings?.GetConfig()?._isDraggable ?? true;
if (!draggable)
ResetLocation();
WindowChrome chrome = WindowChrome.GetWindowChrome(this);
if (chrome != null)
chrome.CaptionHeight = draggable ? HeaderCaptionHeight : 0d;
}
public void ResetLocation()
{
var CM = MethodBase.GetCurrentMethod();