Skip to content

Commit 19c8ff5

Browse files
committed
Made new controls for checkbox with actual checkboxes
1 parent 220501a commit 19c8ff5

27 files changed

+101
-22
lines changed
-22 KB
Binary file not shown.

SyncPlayWPF/SyncPlayWPF/Common/Methods.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,13 @@ public static Rect GetAbsolutePlacement(FrameworkElement container, FrameworkEle
107107
}
108108

109109
public static string ConvertByteSize(int bytecount) {
110-
if (bytecount > 1073741824) { // Bigger than a giga byte
110+
// Bigger than a giga byte
111+
if (bytecount > 1073741824f) return (bytecount / (1024f * 1024f * 1024f)).ToString() + " GB";
111112

112-
113-
114-
return (bytecount / (1024 * 1024 * 1024)).ToString() + " GB";
115-
}
116-
117-
if (bytecount > 1048576) { // Bigger than a megabyte
118-
return (bytecount / (1024 * 1024)).ToString() + " MB";
119-
}
113+
// Bigger than a megabyte
114+
if (bytecount > 1048576f) return (bytecount / (1024f * 1024f)).ToString() + " MB";
120115

121116
return (bytecount / 1024).ToString() + " KB";
122-
123-
124-
125117
}
126118

127119
}

SyncPlayWPF/SyncPlayWPF/Pages/SettingsPage.xaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@
9696
<Label Margin="0,0,0,0" Content="OSD Settings" Foreground="{StaticResource DarkMode_TextColorE}" FontWeight="DemiBold"/>
9797
<StackPanel>
9898
<CheckBox x:Name="EnableOSDMessages" Margin="20,0,0,0" Content="Enable OSD Messages" IsChecked="True" Style="{StaticResource GenericCheckboxLowFidelity}"/>
99-
<CheckBox x:Name="OSD_ShowEventsInYourRooms" Margin="60,0,0,0" Content="Show events in your room" IsChecked="True" Style="{StaticResource GenericCheckboxLowFidelity}"/>
100-
<CheckBox x:Name="OSD_ShowEventsFromManagedRooms" Margin="60,0,0,0" Content="Show event from non-operators in managed rooms" Style="{StaticResource GenericCheckboxLowFidelity}"/>
101-
<CheckBox x:Name="OSD_ShowEventsInOtherRooms" Margin="60,0,0,0" Content="Show events in other rooms" Style="{StaticResource GenericCheckboxLowFidelity}"/>
102-
<CheckBox x:Name="OSD_ShowSlowingNotifications" Margin="60,0,0,0" Content="Show slowing down / reverting notifications" IsChecked="True" Style="{StaticResource GenericCheckboxLowFidelity}"/>
103-
<CheckBox x:Name="OSD_ShowWarnings" Margin="60,0,0,0" Content="Show warnings" IsChecked="True" Style="{StaticResource GenericCheckboxLowFidelity}"/>
99+
<CheckBox x:Name="OSD_ShowEventsInYourRooms" Margin="60,0,0,0" Content="Show events in your room" IsChecked="True" Style="{StaticResource GenericCheckboxWithCheckLowFidelity}"/>
100+
<CheckBox x:Name="OSD_ShowEventsFromManagedRooms" Margin="60,0,0,0" Content="Show event from non-operators in managed rooms" Style="{StaticResource GenericCheckboxWithCheckLowFidelity}"/>
101+
<CheckBox x:Name="OSD_ShowEventsInOtherRooms" Margin="60,0,0,0" Content="Show events in other rooms" Style="{StaticResource GenericCheckboxWithCheckLowFidelity}"/>
102+
<CheckBox x:Name="OSD_ShowSlowingNotifications" Margin="60,0,0,0" Content="Show slowing down / reverting notifications" IsChecked="True" Style="{StaticResource GenericCheckboxWithCheckLowFidelity}"/>
103+
<CheckBox x:Name="OSD_ShowWarnings" Margin="60,0,0,0" Content="Show warnings" IsChecked="True" Style="{StaticResource GenericCheckboxWithCheckLowFidelity}"/>
104104
</StackPanel>
105105
</StackPanel>
106106
</WrapPanel>

SyncPlayWPF/SyncPlayWPF/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("2021.249.8.0")]
55-
[assembly: AssemblyFileVersion("2021.249.8.0")]
54+
[assembly: AssemblyVersion("2021.249.10.0")]
55+
[assembly: AssemblyFileVersion("2021.249.10.0")]

SyncPlayWPF/SyncPlayWPF/Themes/Generic.xaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,93 @@
894894
</Style>
895895

896896
<!-- Checkboxes -->
897+
<Style TargetType="CheckBox" x:Key="GenericCheckboxWithCheckLowFidelity">
898+
<Setter Property="Template">
899+
<Setter.Value>
900+
<ControlTemplate TargetType="{x:Type CheckBox}">
901+
<Border Width="auto" Background="Transparent" HorizontalAlignment="Left" Name="ContainerBorder" Margin="3">
902+
<Grid Margin="0,1,0,1">
903+
<Grid.ColumnDefinitions>
904+
<ColumnDefinition Width="auto"/>
905+
<ColumnDefinition Width="*"/>
906+
</Grid.ColumnDefinitions>
907+
<Grid Grid.Column="0">
908+
909+
910+
<Border
911+
x:Name="ToggleContainer"
912+
Margin="0,0,10,0"
913+
VerticalAlignment="Center"
914+
HorizontalAlignment="Center"
915+
Height="26"
916+
Width="26"
917+
CornerRadius="4"
918+
BorderThickness="2"
919+
920+
BorderBrush="{StaticResource DarkMode_AccentColorE}">
921+
922+
923+
</Border>
924+
<Path Fill="{StaticResource DarkMode_ScaleGradient}"
925+
x:Name="CheckIcon"
926+
VerticalAlignment="Center"
927+
HorizontalAlignment="Left"
928+
929+
Margin="3,0,0,3"
930+
Data="m1.5,9.81739l1.12597,-1.29064l5.51853,3.66633l9.51508,-9.94252l0.96542,1.07474l-9.98959,14.80027l-7.13542,-8.30818z"/>
931+
932+
</Grid>
933+
<Border Grid.Column="1" Margin="0,0,0,0" Padding="0,0,0,0">
934+
<TextBlock
935+
VerticalAlignment="Center"
936+
Text="{TemplateBinding Content}"
937+
FontSize="12"
938+
Foreground="{StaticResource DarkMode_AccentColorE}"
939+
FontWeight="DemiBold">
940+
</TextBlock>
941+
</Border>
942+
</Grid>
943+
</Border>
944+
<ControlTemplate.Triggers>
945+
946+
947+
<Trigger Property="IsChecked" Value="True">
948+
<Setter Property="Visibility" TargetName="CheckIcon" Value="Visible"/>
949+
</Trigger>
950+
951+
<Trigger Property="IsChecked" Value="False">
952+
<Setter Property="Visibility" TargetName="CheckIcon" Value="Hidden"/>
953+
</Trigger>
954+
955+
<Trigger Property="IsMouseOver" Value="true">
956+
<Setter Property="Fill" Value="{StaticResource DarkMode_ScaleHoverGradient}" TargetName="CheckIcon"/>
957+
</Trigger>
958+
959+
<!--<MultiTrigger>
960+
<MultiTrigger.Conditions>
961+
<Condition Property="IsMouseOver" Value="true"/>
962+
<Condition Property="IsChecked" Value="true"/>
963+
</MultiTrigger.Conditions>
964+
<MultiTrigger.Setters>
965+
<Setter Property="Background" Value="{StaticResource DarkMode_ScaleDisabledGradient}" TargetName="ToggleContainer"/>
966+
</MultiTrigger.Setters>
967+
</MultiTrigger>
968+
969+
<MultiTrigger>
970+
<MultiTrigger.Conditions>
971+
<Condition Property="IsMouseOver" Value="true"/>
972+
<Condition Property="IsChecked" Value="false"/>
973+
</MultiTrigger.Conditions>
974+
<MultiTrigger.Setters>
975+
<Setter Property="Background" Value="{StaticResource DarkMode_ScaleHoverGradient}" TargetName="ToggleContainer"/>
976+
</MultiTrigger.Setters>
977+
</MultiTrigger>-->
978+
979+
</ControlTemplate.Triggers>
980+
</ControlTemplate>
981+
</Setter.Value>
982+
</Setter>
983+
</Style>
897984
<Style TargetType="CheckBox" x:Key="GenericCheckboxLowFidelity">
898985
<Setter Property="Template">
899986
<Setter.Value>
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
1 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)