Group header actions and restore refresh/close button behavior

This commit is contained in:
Meik
2026-03-05 11:10:35 +01:00
parent c29ca72b2b
commit 5a1a54e9ff
2 changed files with 69 additions and 25 deletions

View File

@@ -1478,6 +1478,16 @@ namespace C4IT_CustomerPanel
HideMainForm();
}
private void OnRefreshButtonClick(object sender, RoutedEventArgs e)
{
OnRefreshClicked(sender, null);
}
private void OnMinimizeButtonClick(object sender, RoutedEventArgs e)
{
OnMinimizeClicked(sender, null);
}
private void OnNotifierMenuClicked(object sender, EventArgs e)
{
if (!(sender is ToolStripMenuItem menuItem))
@@ -1606,6 +1616,9 @@ namespace C4IT_CustomerPanel
private void GridTop_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.OriginalSource is DependencyObject source && FindVisualParent<Button>(source) != null)
return;
if (e.ChangedButton == MouseButton.Left && ConfigSettings.GetConfig()._isDraggable)
this.DragMove();
}
@@ -1633,6 +1646,19 @@ namespace C4IT_CustomerPanel
}
}
private static T FindVisualParent<T>(DependencyObject source) where T : DependencyObject
{
while (source != null)
{
if (source is T target)
return target;
source = VisualTreeHelper.GetParent(source);
}
return null;
}
private void App_KeyDown(object sender, KeyEventArgs e)
{
if (((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt) && Keyboard.IsKeyDown(Key.R) && ConfigSettings.GetConfig()._isDraggable)