Skip to content

Commit

Permalink
visual improvement to make moving the mode overly easier
Browse files Browse the repository at this point in the history
  • Loading branch information
joekolodz committed Mar 29, 2024
1 parent eb3b19e commit 35b54ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/CustomSierraJsonConverter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using SierraHOTAS.Models;
using SierraJSON;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;

namespace SierraHOTAS
Expand Down Expand Up @@ -140,6 +138,7 @@ private static void SerializeButton(HOTASButton button)
// if (prop.Name == nameof(button.RepeatCount) && (int)prop.GetValue(button) == 0) continue;
if (prop.Name == nameof(button.IsShift) && (bool)prop.GetValue(button) == false) continue;
if (prop.Name == nameof(button.IsOneShot) && (bool)prop.GetValue(button) == false) continue;
if (prop.Name == nameof(button.ActionId) && !button.ActionCatalogItem.Actions.Any()) continue;

Serializer.WriteKeyValue(prop.Name, value);
}
Expand Down
10 changes: 6 additions & 4 deletions src/Views/ModeOverlayWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@
mc:Ignorable="d"
Title=""
Height="25"
Width="98">
Width="200">

<Grid x:Name="grid" Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="98" />
<ColumnDefinition Width="15" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<TextBlock Grid.Row="0" Grid.Column="0" Text="Active Mode:" VerticalAlignment="Center" Style="{StaticResource ModeOverlayTextBlock}" HorizontalAlignment="Left"/>
<TextBlock Grid.Row="0" Grid.Column="1" x:Name="txtMessage" VerticalAlignment="Center" Style="{StaticResource ModeOverlayTextBlock}" HorizontalAlignment="Left"/>
<Rectangle Grid.Row="0" Grid.Column="0" Width="14" Height="14" Fill="{StaticResource AxisForwardBrush}" Stroke="{StaticResource HoverBorderBrush}" StrokeThickness="1" Cursor="Hand" />
<TextBlock Grid.Row="0" Grid.Column="1" Margin="2,0,0,0" Text="Active Mode:" VerticalAlignment="Center" Style="{StaticResource ModeOverlayTextBlock}" HorizontalAlignment="Left" Cursor="Hand"/>
<TextBlock Grid.Row="0" Grid.Column="2" x:Name="txtMessage" VerticalAlignment="Center" Style="{StaticResource ModeOverlayTextBlock}" HorizontalAlignment="Left" Cursor="Hand"/>

</Grid>
</Window>
4 changes: 2 additions & 2 deletions src/Views/ModeOverlayWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private void SetModeName(int mode)
{
_appDispatcher.Invoke(() =>
{
Width = 98;
Width = 115;
txtMessage.Text = _modeDictionary[mode].ModeName;
SetWidthFromContent();
});
Expand All @@ -154,7 +154,7 @@ private void SetWidthFromContent()
Brushes.Gold,
1.25);

Width = (int)formattedText.Width + 98;
Width = (int)formattedText.Width + 115;
}
}
}

0 comments on commit 35b54ca

Please sign in to comment.