Group header actions and restore refresh/close button behavior
This commit is contained in:
@@ -294,6 +294,18 @@
|
|||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style TargetType="Button"
|
||||||
|
x:Key="HeaderGroupButtonStyle"
|
||||||
|
BasedOn="{StaticResource HeaderIconButtonStyle}">
|
||||||
|
<Setter Property="BorderThickness"
|
||||||
|
Value="0" />
|
||||||
|
<Setter Property="Background"
|
||||||
|
Value="Transparent" />
|
||||||
|
<Setter Property="Width"
|
||||||
|
Value="32" />
|
||||||
|
<Setter Property="Height"
|
||||||
|
Value="32" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
<DrawingImage x:Key="OverlayOffline">
|
<DrawingImage x:Key="OverlayOffline">
|
||||||
<DrawingImage.Drawing>
|
<DrawingImage.Drawing>
|
||||||
@@ -341,14 +353,31 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="14,14,0,0"
|
Margin="14,14,0,0"
|
||||||
x:Name="Logo" />
|
x:Name="Logo" />
|
||||||
<Button x:Name="Close_Text"
|
<Border HorizontalAlignment="Right"
|
||||||
Style="{StaticResource HeaderIconButtonStyle}"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Margin="0,12,12,0"
|
Margin="0,12,12,0"
|
||||||
Panel.ZIndex="500"
|
Panel.ZIndex="500"
|
||||||
|
CornerRadius="10"
|
||||||
|
BorderThickness="1"
|
||||||
|
BorderBrush="{DynamicResource panelBorderColor}"
|
||||||
|
Background="{DynamicResource headerControlBackgroundColor}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Button x:Name="RefreshIcon"
|
||||||
|
Style="{StaticResource HeaderGroupButtonStyle}"
|
||||||
|
ToolTip="Refresh"
|
||||||
|
Click="OnRefreshButtonClick">
|
||||||
|
<Image Source="{DynamicResource nav_appbar_refresh}"
|
||||||
|
Tag="ICO"
|
||||||
|
Width="16"
|
||||||
|
Height="16" />
|
||||||
|
</Button>
|
||||||
|
<Border Width="1"
|
||||||
|
Margin="0,6"
|
||||||
|
Background="{DynamicResource panelBorderColor}" />
|
||||||
|
<Button x:Name="Close_Text"
|
||||||
|
Style="{StaticResource HeaderGroupButtonStyle}"
|
||||||
ToolTip="{x:Static resx:Resources.close}"
|
ToolTip="{x:Static resx:Resources.close}"
|
||||||
PreviewMouseDown="OnMinimizeClicked">
|
Click="OnMinimizeButtonClick">
|
||||||
<TextBlock Text="X"
|
<TextBlock Text="X"
|
||||||
FontSize="15"
|
FontSize="15"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
@@ -356,19 +385,8 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Center" />
|
HorizontalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button x:Name="RefreshIcon"
|
</StackPanel>
|
||||||
Style="{StaticResource HeaderIconButtonStyle}"
|
</Border>
|
||||||
HorizontalAlignment="Right"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Margin="0,12,88,0"
|
|
||||||
Panel.ZIndex="500"
|
|
||||||
ToolTip="Refresh"
|
|
||||||
PreviewMouseDown="OnRefreshClicked">
|
|
||||||
<Image Source="{DynamicResource nav_appbar_refresh}"
|
|
||||||
Tag="ICO"
|
|
||||||
Width="16"
|
|
||||||
Height="16" />
|
|
||||||
</Button>
|
|
||||||
<!--<TextBlock MouseDown="OnCloseClicked" HorizontalAlignment="Right" FontSize="20" FontWeight="Bold" Margin="0,-5,5,0" Cursor="Hand" Panel.ZIndex="500" >X</TextBlock>-->
|
<!--<TextBlock MouseDown="OnCloseClicked" HorizontalAlignment="Right" FontSize="20" FontWeight="Bold" Margin="0,-5,5,0" Cursor="Hand" Panel.ZIndex="500" >X</TextBlock>-->
|
||||||
<Image Source="{DynamicResource nav_appbar_network_server_disconnect}"
|
<Image Source="{DynamicResource nav_appbar_network_server_disconnect}"
|
||||||
Tag="ICO"
|
Tag="ICO"
|
||||||
|
|||||||
@@ -1478,6 +1478,16 @@ namespace C4IT_CustomerPanel
|
|||||||
HideMainForm();
|
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)
|
private void OnNotifierMenuClicked(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!(sender is ToolStripMenuItem menuItem))
|
if (!(sender is ToolStripMenuItem menuItem))
|
||||||
@@ -1606,6 +1616,9 @@ namespace C4IT_CustomerPanel
|
|||||||
|
|
||||||
private void GridTop_MouseDown(object sender, MouseButtonEventArgs e)
|
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)
|
if (e.ChangedButton == MouseButton.Left && ConfigSettings.GetConfig()._isDraggable)
|
||||||
this.DragMove();
|
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)
|
private void App_KeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt) && Keyboard.IsKeyDown(Key.R) && ConfigSettings.GetConfig()._isDraggable)
|
if (((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt) && Keyboard.IsKeyDown(Key.R) && ConfigSettings.GetConfig()._isDraggable)
|
||||||
|
|||||||
Reference in New Issue
Block a user