Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/RegionToShare/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<setting name="StartActivated" serializeAs="String">
<value>False</value>
</setting>
<setting name="ShowCloseButton" serializeAs="String">
<value>True</value>
</setting>
</RegionToShare.Properties.Settings>
</userSettings>
</configuration>
4 changes: 4 additions & 0 deletions src/RegionToShare/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
<CheckBox Content="Start activated"
VerticalAlignment="Center"
IsChecked="{Binding StartActivated, Source={x:Static properties:Settings.Default}}" />
<Decorator Style="{StaticResource Padding}"/>
<CheckBox Content="Show close button"
VerticalAlignment="Center"
IsChecked="{Binding ShowCloseButton, Source={x:Static properties:Settings.Default}}" />
</StackPanel>
<TextBlock Text="{Binding Version}" VerticalAlignment="Bottom" HorizontalAlignment="Right" Padding="5,2" />
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
Expand Down
2 changes: 2 additions & 0 deletions src/RegionToShare/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ private void OnMouseLeftButtonDown()

NativeWindowRect += GlassFrameThickness;

ShowInTaskbar = true;
BringToFront();
};

Expand Down Expand Up @@ -351,6 +352,7 @@ public void SendToBack()
{
SetSeparationLayerPos(SWP_NOACTIVATE | SWP_SHOWWINDOW);
SetWindowPos(_windowHandle, _separationLayerHandle, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
ShowInTaskbar = false;
}

private void SetSeparationLayerPos(uint flags)
Expand Down
14 changes: 13 additions & 1 deletion src/RegionToShare/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/RegionToShare/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
<Setting Name="StartActivated" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ShowCloseButton" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>
14 changes: 9 additions & 5 deletions src/RegionToShare/RecordingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:RegionToShare"
xmlns:local="clr-namespace:RegionToShare"
xmlns:properties="clr-namespace:RegionToShare.Properties"
mc:Ignorable="d"
WindowStyle="None" Background="Transparent"
AllowsTransparency="True" Topmost="True"
ShowInTaskbar="False"
Title="Region to Share - Source Region" Height="450" Width="800">
<Grid>
Title="Region to Share" Height="450" Width="800">
<Window.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
</Window.Resources>
<Grid>
<Border BorderThickness="{x:Static local:RecordingWindow.BorderSize}">
<Border.BorderBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="8,8" SpreadMethod="Repeat" MappingMode="Absolute">
Expand All @@ -23,7 +26,8 @@
<Button Width="16" Height="16"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Click="Button_Click">
Click="Button_Click"
Visibility="{Binding Source={x:Static properties:Settings.Default}, Path=ShowCloseButton, Converter={StaticResource BooleanToVisibilityConverter}}">
<Path Width="12" Height="12"
Data="M2,2 L10,10 M2,10 L10,2"
Stroke="Black"
Expand Down