mirror of
https://github.com/ckaczor/FloatingStatusWindow.git
synced 2026-01-31 01:25:38 -05:00
Add appearance button to window caption
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using Common.Native;
|
using FloatingStatusWindowLibrary.Properties;
|
||||||
using FloatingStatusWindowLibrary.Properties;
|
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|||||||
@@ -1,21 +1,52 @@
|
|||||||
<windows:SnappingWindow x:Class="FloatingStatusWindowLibrary.MainWindow"
|
<windows:SnappingWindow x:Class="FloatingStatusWindowLibrary.MainWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:htmlLabelControl="clr-namespace:Common.Wpf.HtmlLabelControl;assembly=Common.Wpf"
|
xmlns:htmlLabelControl="clr-namespace:Common.Wpf.HtmlLabelControl;assembly=Common.Wpf"
|
||||||
xmlns:windows="clr-namespace:Common.Wpf.Windows;assembly=Common.Wpf"
|
xmlns:windows="clr-namespace:Common.Wpf.Windows;assembly=Common.Wpf"
|
||||||
windows:ControlBox.HasMaximizeButton="False" windows:ControlBox.HasMinimizeButton="False" windows:ControlBox.HasSystemMenu="False"
|
windows:ControlBox.HasMaximizeButton="False"
|
||||||
Title="FloatingStatusWindow" Height="250" Width="400" WindowStyle="None" AllowsTransparency="True" ResizeMode="CanResize" Background="Transparent" ShowInTaskbar="False"
|
windows:ControlBox.HasMinimizeButton="False"
|
||||||
x:ClassModifier="internal">
|
windows:ControlBox.HasSystemMenu="False"
|
||||||
|
Title="FloatingStatusWindow"
|
||||||
|
Height="250"
|
||||||
|
Width="400"
|
||||||
|
WindowStyle="None"
|
||||||
|
AllowsTransparency="True"
|
||||||
|
ResizeMode="CanResize"
|
||||||
|
Background="Transparent"
|
||||||
|
ShowInTaskbar="False"
|
||||||
|
x:ClassModifier="internal">
|
||||||
|
|
||||||
<Border Name="BorderFull" BorderThickness="4,0,4,4" Background="Transparent" Margin="0">
|
<Border Name="BorderFull"
|
||||||
|
BorderThickness="4,0,4,4"
|
||||||
|
Background="Transparent"
|
||||||
|
Margin="0">
|
||||||
<Grid Background="Transparent">
|
<Grid Background="Transparent">
|
||||||
<Border Name="HeaderBorder" Height="24" VerticalAlignment="Top">
|
<Border Name="HeaderBorder"
|
||||||
|
Height="24"
|
||||||
|
VerticalAlignment="Top">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Label HorizontalAlignment="Stretch" Name="HeaderLabel" Margin="0,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Padding="0">
|
<Label HorizontalAlignment="Stretch"
|
||||||
|
Name="HeaderLabel"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"
|
||||||
|
Padding="0">
|
||||||
</Label>
|
</Label>
|
||||||
|
<Button Height="18"
|
||||||
|
Width="18"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Margin="0,0,5,0"
|
||||||
|
Click="HandleChangeAppearanceClick"
|
||||||
|
WindowChrome.IsHitTestVisibleInChrome="True"
|
||||||
|
Content=""
|
||||||
|
FontFamily="Segoe UI Symbol"
|
||||||
|
FontSize="12"
|
||||||
|
Padding="0"></Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
<htmlLabelControl:HtmlLabel Name="HtmlLabel" Foreground="White" Margin="0,20,0,0" />
|
<htmlLabelControl:HtmlLabel Name="HtmlLabel"
|
||||||
|
Foreground="White"
|
||||||
|
Margin="0,20,0,0" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</windows:SnappingWindow>
|
</windows:SnappingWindow>
|
||||||
|
|||||||
@@ -122,5 +122,11 @@ namespace FloatingStatusWindowLibrary
|
|||||||
return WindowManager.GetWindowList(windowHandle);
|
return WindowManager.GetWindowList(windowHandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HandleChangeAppearanceClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var appearanceWindow = new AppearanceWindow(WindowSettings);
|
||||||
|
appearanceWindow.ShowDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user