Skip to content

Commit

Permalink
Update UI and simplify logic in OSCController and PulsoidModule
Browse files Browse the repository at this point in the history
This commit includes several changes to the UI and logic in various files. In `OSCController.cs`, the logic for setting the `displayText` variable has been simplified. In `PulsoidModule.cs`, a new else block has been added to handle the case when the heart rate is not greater than or equal to `HighTemperatureThreshold`. The version number in `MagicChatbox.csproj` has been updated. In `MainWindow.xaml`, the `CornerRadius` property of a `Border` element has been updated and a new `CheckBox` named `ShowTemperatureText_checkbox` has been added, along with associated UI elements. The previous `CheckBox` named `ShowTemperatureText_checkbox` and its associated UI elements have been removed.
  • Loading branch information
BoiHanny committed Feb 23, 2024
1 parent 94f1e98 commit fae1627
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void AddHeartRate(List<string> Uncomplete)
if (ViewModel.Instance.EnableHeartRateOfflineCheck && ViewModel.Instance.PulsoidDeviceOnline || !ViewModel.Instance.EnableHeartRateOfflineCheck)
{
// Always start with the heart icon if MagicHeartRateIcons or ShowTemperatureText is true
string displayText = ViewModel.Instance.MagicHeartRateIcons || ViewModel.Instance.ShowTemperatureText || ViewModel.Instance.MagicHeartIconPrefix
string displayText = ViewModel.Instance.MagicHeartIconPrefix
? ViewModel.Instance.HeartRateIcon + " "
: string.Empty;

Expand Down
4 changes: 4 additions & 0 deletions vrcosc-magicchatbox/Classes/Modules/PulsoidModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ private async Task HeartRateMonitoringLoopAsync(CancellationToken cancellationTo
ViewModel.Instance.HeartRateIcon = ViewModel.Instance.HeartIcons[ViewModel.Instance.CurrentHeartIconIndex] + ViewModel.Instance.FormattedHighHeartRateText;
}
}
else
{
ViewModel.Instance.HeartRateIcon = ViewModel.Instance.HeartIcons[ViewModel.Instance.CurrentHeartIconIndex];
}



Expand Down
2 changes: 1 addition & 1 deletion vrcosc-magicchatbox/MagicChatbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<Version>0.8.770</Version>
<Version>0.8.772</Version>
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
<RootNamespace>vrcosc_magicchatbox</RootNamespace>
<Nullable>enable</Nullable>
Expand Down
206 changes: 104 additions & 102 deletions vrcosc-magicchatbox/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,8 @@
<Border
Margin="0,0,0,5"
Background="#FF3B3054"
CornerRadius="5,0,0,5">
CornerRadius="5,0,0,5"
Visibility="{Binding MagicHeartIconPrefix, Converter={StaticResource InverseBoolToHiddenConverter}, UpdateSourceTrigger=PropertyChanged}">
<StackPanel Margin="5">
<CheckBox
x:Name="MagicHeartRateIcons_checkbox"
Expand All @@ -1271,6 +1272,107 @@
Background="#FF3B3054"
CornerRadius="5,0,0,5"
Visibility="{Binding MagicHeartIconPrefix, Converter={StaticResource InverseBoolToHiddenConverter}, UpdateSourceTrigger=PropertyChanged}">
<StackPanel Margin="5">
<CheckBox
x:Name="ShowTemperatureText_checkbox"
Margin="0,0,0,0"
FontFamily="Comfortaa Light"
FontSize="18"
Foreground="#FFB9B5C1"
IsChecked="{Binding ShowTemperatureText, Mode=TwoWay}"
Style="{DynamicResource SettingsCheckbox}">
Show temperature status
</CheckBox>
<StackPanel Margin="0,15,0,0" Visibility="{Binding ShowTemperatureText, Converter={StaticResource InverseBoolToHiddenConverter}, UpdateSourceTrigger=PropertyChanged}">
<StackPanel Orientation="Horizontal">
<TextBlock
Padding="0,0,9,0"
VerticalAlignment="Center"
FontFamily="Albert Sans Thin"
FontSize="15"
Foreground="#FF9983AD"
Text="Lower than" />
<TextBox
x:Name="LowTemperatureThreshold"
Width="35"
Height="auto"
Margin="0,0,0,0"
HorizontalAlignment="Left"
VerticalContentAlignment="Center"
Background="#FF7B7195"
BorderThickness="0"
FontSize="15"
Foreground="#FF240E54"
Text="{Binding LowTemperatureThreshold, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextAlignment="Center" />
<TextBlock
Padding="5,0,5,0"
VerticalAlignment="Center"
FontFamily="Albert Sans Thin"
FontSize="15"
Foreground="#FF9983AD"
Text="show" />
<TextBox
x:Name="LowHeartRateText"
Height="auto"
MinWidth="60"
Padding="3,0"
HorizontalAlignment="Left"
VerticalContentAlignment="Center"
Background="#FF7B7195"
BorderThickness="0"
FontSize="15"
Foreground="#FF240E54"
Text="{Binding LowHeartRateText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Margin="0,5,0,5" Orientation="Horizontal">
<TextBlock
Padding="0,0,5,0"
VerticalAlignment="Center"
FontFamily="Albert Sans Thin"
FontSize="15"
Foreground="#FF9983AD"
Text="Higher than" />
<TextBox
x:Name="HighTemperatureThreshold"
Width="35"
Height="auto"
HorizontalAlignment="Left"
VerticalContentAlignment="Center"
Background="#FF7B7195"
BorderThickness="0"
FontSize="15"
Foreground="#FF240E54"
Text="{Binding HighTemperatureThreshold, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextAlignment="Center" />
<TextBlock
Padding="5,0,4,0"
VerticalAlignment="Center"
FontFamily="Albert Sans Thin"
FontSize="15"
Foreground="#FF9983AD"
Text="show" />
<TextBox
x:Name="HighwHeartRateText"
Height="auto"
MinWidth="60"
Margin="0,0,0,0"
Padding="3,0"
HorizontalAlignment="Left"
VerticalContentAlignment="Center"
Background="#FF7B7195"
BorderThickness="0"
FontSize="15"
Foreground="#FF240E54"
Text="{Binding HighHeartRateText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</StackPanel>
</StackPanel>
</Border>
<Border
Margin="0,0,0,5"
Background="#FF3B3054"
CornerRadius="5,0,0,5">
<StackPanel Margin="5">
<CheckBox
x:Name="ShowHeartRateTrendIndicator"
Expand Down Expand Up @@ -1407,107 +1509,7 @@
</StackPanel>
</StackPanel>
</Border>
<Border
Margin="0,0,0,5"
Background="#FF3B3054"
CornerRadius="5,0,0,5">
<StackPanel Margin="5">
<CheckBox
x:Name="ShowTemperatureText_checkbox"
Margin="0,0,0,0"
FontFamily="Comfortaa Light"
FontSize="18"
Foreground="#FFB9B5C1"
IsChecked="{Binding ShowTemperatureText, Mode=TwoWay}"
Style="{DynamicResource SettingsCheckbox}">
Show temperature status
</CheckBox>
<StackPanel Margin="0,15,0,0" Visibility="{Binding ShowTemperatureText, Converter={StaticResource InverseBoolToHiddenConverter}, UpdateSourceTrigger=PropertyChanged}">
<StackPanel Orientation="Horizontal">
<TextBlock
Padding="0,0,9,0"
VerticalAlignment="Center"
FontFamily="Albert Sans Thin"
FontSize="15"
Foreground="#FF9983AD"
Text="Lower than" />
<TextBox
x:Name="LowTemperatureThreshold"
Width="35"
Height="auto"
Margin="0,0,0,0"
HorizontalAlignment="Left"
VerticalContentAlignment="Center"
Background="#FF7B7195"
BorderThickness="0"
FontSize="15"
Foreground="#FF240E54"
Text="{Binding LowTemperatureThreshold, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextAlignment="Center" />
<TextBlock
Padding="5,0,5,0"
VerticalAlignment="Center"
FontFamily="Albert Sans Thin"
FontSize="15"
Foreground="#FF9983AD"
Text="show" />
<TextBox
x:Name="LowHeartRateText"
Height="auto"
MinWidth="60"
Padding="3,0"
HorizontalAlignment="Left"
VerticalContentAlignment="Center"
Background="#FF7B7195"
BorderThickness="0"
FontSize="15"
Foreground="#FF240E54"
Text="{Binding LowHeartRateText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<StackPanel Margin="0,5,0,5" Orientation="Horizontal">
<TextBlock
Padding="0,0,5,0"
VerticalAlignment="Center"
FontFamily="Albert Sans Thin"
FontSize="15"
Foreground="#FF9983AD"
Text="Higher than" />
<TextBox
x:Name="HighTemperatureThreshold"
Width="35"
Height="auto"
HorizontalAlignment="Left"
VerticalContentAlignment="Center"
Background="#FF7B7195"
BorderThickness="0"
FontSize="15"
Foreground="#FF240E54"
Text="{Binding HighTemperatureThreshold, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
TextAlignment="Center" />
<TextBlock
Padding="5,0,4,0"
VerticalAlignment="Center"
FontFamily="Albert Sans Thin"
FontSize="15"
Foreground="#FF9983AD"
Text="show" />
<TextBox
x:Name="HighwHeartRateText"
Height="auto"
MinWidth="60"
Margin="0,0,0,0"
Padding="3,0"
HorizontalAlignment="Left"
VerticalContentAlignment="Center"
Background="#FF7B7195"
BorderThickness="0"
FontSize="15"
Foreground="#FF240E54"
Text="{Binding HighHeartRateText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</StackPanel>
</StackPanel>
</Border>

<Border
Margin="0,0,0,5"
Background="#FF3B3054"
Expand Down

0 comments on commit fae1627

Please sign in to comment.