Skip to content

Commit

Permalink
Launcher combobox style fix win7 (SubnauticaNitrox#785)
Browse files Browse the repository at this point in the history
* Server page style depending from windows version

* Commented code
  • Loading branch information
Ghaarg authored and Sunrunner37 committed Apr 9, 2019
1 parent cacf262 commit 061a65e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion NitroxLauncher/ServerPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
<StackPanel Grid.Column="0" VerticalAlignment="Center">
<TextBlock FontFamily="{StaticResource Roboto}" Foreground="White" FontSize="12"><Run Text="GAME VERSION"/></TextBlock>
<Border Height="43" Width="269" Margin="0,4,0,0" BorderBrush="#33FFFFFF" BorderThickness="1" CornerRadius="4">
<ComboBox Background="#9928292C" Foreground="White" FontSize="16" Padding="12,12,0,0" SelectedIndex="0" SelectionChanged="OnSelectionChange" Style="{DynamicResource ComboBoxStyle}" >
<ComboBox x:Name="CBox" Background="#9928292C" Foreground="White" FontSize="16" Padding="12,12,0,0" SelectedIndex="0" SelectionChanged="OnSelectionChange" >
<ComboBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="#9928292C" />
</ComboBox.Resources>
Expand Down
7 changes: 7 additions & 0 deletions NitroxLauncher/ServerPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ public partial class ServerPage : Page
public ServerPage(LauncherLogic logic)
{
InitializeComponent();

// Change style depending on windows version. Win 10 uses other definition of comboboxes then win 7 so win 10 has its own style
if(Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor > 1)
{
CBox.Style = (Style)Resources["ComboBoxStyle"];
CBox.ApplyTemplate();
}
this.logic = logic;
}

Expand Down
2 changes: 1 addition & 1 deletion NitroxUnity
Submodule NitroxUnity updated 1 files
+238 −19 Assets/chatlog.unity

0 comments on commit 061a65e

Please sign in to comment.