From 1e49a41b823f83e6655a64755969abfc79264276 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Mon, 7 Sep 2026 08:41:03 -0500 Subject: [PATCH] update to .NET 10 and fix label colors --- qController.sln | 4 +-- qController/Classes/Buttons/QButton.cs | 14 ++-------- qController/Classes/Cell/QCueListCell.cs | 26 ++++--------------- qController/Classes/Cell/QInstanceCell.cs | 2 ++ qController/Classes/Cell/QSelectedCueCell.cs | 12 ++++++--- qController/Pages/App.xaml | 8 +----- qController/Pages/App.xaml.cs | 16 +++--------- qController/Pages/ControlPage.xaml | 4 +-- qController/Pages/ControlPage.xaml.cs | 2 ++ qController/Pages/MenuPage.xaml.cs | 2 +- qController/Pages/qConnectionPage.xaml | 2 +- .../Platforms/Android/AndroidManifest.xml | 2 +- qController/Platforms/Android/MainActivity.cs | 1 + qController/qController.csproj | 18 +++++++++++-- 14 files changed, 47 insertions(+), 66 deletions(-) diff --git a/qController.sln b/qController.sln index bf4feb1..82263de 100644 --- a/qController.sln +++ b/qController.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.12.35707.178 +# Visual Studio Version 18 +VisualStudioVersion = 18.9.12120.119 stable MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "qController", "qController\qController.csproj", "{63B39EEA-36D4-4B2C-8FFD-FB0E12FD8B14}" EndProject diff --git a/qController/Classes/Buttons/QButton.cs b/qController/Classes/Buttons/QButton.cs index cfc29bf..aabfac5 100644 --- a/qController/Classes/Buttons/QButton.cs +++ b/qController/Classes/Buttons/QButton.cs @@ -19,18 +19,8 @@ namespace qController if (qCommand.osc.Contains("go")) { BackgroundColor = Colors.SeaGreen; - // TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes - switch (Device.RuntimePlatform) - { - case Device.iOS: - FontSize = App.HeightUnit * 4; - FontAttributes = FontAttributes.Bold; - break; - case Device.Android: - FontSize = App.HeightUnit * 4; - FontAttributes = FontAttributes.Bold; - break; - } + FontSize = App.HeightUnit * 4; + FontAttributes = FontAttributes.Bold; } else if (qCommand.osc.Contains("panic")) { diff --git a/qController/Classes/Cell/QCueListCell.cs b/qController/Classes/Cell/QCueListCell.cs index a86d782..c5326a2 100644 --- a/qController/Classes/Cell/QCueListCell.cs +++ b/qController/Classes/Cell/QCueListCell.cs @@ -10,16 +10,7 @@ namespace qController.Cell public ObservableCollection items; public QCueListCell(QCueList qCueList) { - // TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes - switch (Device.RuntimePlatform) - { - case Device.iOS: - Margin = new Thickness(10, 30, 10, 10); - break; - case Device.Android: - Margin = new Thickness(10, 10, 10, 10); - break; - } + Margin = new Thickness(10, 10, 10, 10); Padding = new Thickness(10); items = new ObservableCollection(); @@ -41,22 +32,15 @@ namespace qController.Cell icon.HorizontalTextAlignment = TextAlignment.Center; icon.VerticalTextAlignment = TextAlignment.Center; icon.FontSize = App.HeightUnit * 3; + icon.TextColor = Colors.Black; var label = new Label { VerticalOptions = LayoutOptions.FillAndExpand }; label.SetBinding(Label.TextProperty, "Text"); if (label.Text == "Disconnect") { label.TextColor = Colors.DarkRed; } - // TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes - switch (Device.RuntimePlatform) - { - case Device.iOS: - label.FontSize = App.HeightUnit * 3; - break; - case Device.Android: - label.FontSize = App.HeightUnit * 2.2; - break; - } + label.FontSize = App.HeightUnit * 2.2; + label.TextColor = Colors.Black; grid.Add(icon); grid.Add(label, 1, 0); return new ViewCell { View = grid }; @@ -68,7 +52,7 @@ namespace qController.Cell { BackgroundColor = Colors.Gray, Text = "Close", - TextColor = Colors.White + TextColor = Colors.Black }; layout.Children.Add(closeButton); diff --git a/qController/Classes/Cell/QInstanceCell.cs b/qController/Classes/Cell/QInstanceCell.cs index 624c731..8b89895 100644 --- a/qController/Classes/Cell/QInstanceCell.cs +++ b/qController/Classes/Cell/QInstanceCell.cs @@ -75,11 +75,13 @@ namespace qController.Cell nameLabel.FontAttributes = FontAttributes.Bold; nameLabel.FontSize = App.HeightUnit * 3; nameLabel.Margin = new Thickness(0, 20, 0, 0); + nameLabel.TextColor = Colors.Black; addressLabel.HorizontalTextAlignment = TextAlignment.Center; addressLabel.VerticalTextAlignment = TextAlignment.Start; addressLabel.FontSize = App.HeightUnit * 2.5; addressLabel.Margin = new Thickness(0, 0, 0, 20); + addressLabel.TextColor = Colors.Black; connectLabel.HorizontalOptions = LayoutOptions.StartAndExpand; connectLabel.VerticalOptions = LayoutOptions.CenterAndExpand; diff --git a/qController/Classes/Cell/QSelectedCueCell.cs b/qController/Classes/Cell/QSelectedCueCell.cs index d77dfb1..1f06583 100644 --- a/qController/Classes/Cell/QSelectedCueCell.cs +++ b/qController/Classes/Cell/QSelectedCueCell.cs @@ -89,7 +89,8 @@ namespace qController.Cell number = new Label { Text = "", FontAttributes = FontAttributes.Bold, - FontSize = App.HeightUnit * 5 + FontSize = App.HeightUnit * 5, + TextColor = Colors.Black, }; name = new Label { @@ -97,7 +98,8 @@ namespace qController.Cell FontAttributes = FontAttributes.Bold, HorizontalTextAlignment = TextAlignment.Center, FontSize = App.HeightUnit * 3.5, - Margin = new Thickness(0) + Margin = new Thickness(0), + TextColor = Colors.Black, }; type = new Label { @@ -105,7 +107,8 @@ namespace qController.Cell FontFamily = App.QFont, VerticalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.End, - FontSize = App.HeightUnit * 5 + FontSize = App.HeightUnit * 5, + TextColor = Colors.Black, }; notes = new Label { @@ -113,7 +116,8 @@ namespace qController.Cell HorizontalTextAlignment = TextAlignment.Center, Margin = new Thickness(0,0,0,10), VerticalOptions = LayoutOptions.FillAndExpand, - HorizontalOptions = LayoutOptions.FillAndExpand + HorizontalOptions = LayoutOptions.FillAndExpand, + TextColor = Colors.Black, }; //BACKGROUND COLORS FOR TESTING ONLY diff --git a/qController/Pages/App.xaml b/qController/Pages/App.xaml index 291c744..e493df5 100644 --- a/qController/Pages/App.xaml +++ b/qController/Pages/App.xaml @@ -1,10 +1,4 @@ - - - - - - - + diff --git a/qController/Pages/App.xaml.cs b/qController/Pages/App.xaml.cs index a82be74..8036a82 100644 --- a/qController/Pages/App.xaml.cs +++ b/qController/Pages/App.xaml.cs @@ -39,19 +39,9 @@ namespace qController Height = mainDisplayInfo.Height / mainDisplayInfo.Density; Width = mainDisplayInfo.Width / mainDisplayInfo.Density; HeightUnit = Height / 100.0; - WidthUnit = Width / 100.0; - // TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes - switch (Device.RuntimePlatform) - { - case Device.iOS: - QFont = "qfont"; - break; - case Device.Android: - QFont = "qfont.ttf#qfont"; - break; - - } - + WidthUnit = Width / 100.0; + + QFont = "qfont"; rootPage = new RootPage(); rootPage.Detail = new NavigationPage(new QConnectionPage()); MainPage = rootPage; diff --git a/qController/Pages/ControlPage.xaml b/qController/Pages/ControlPage.xaml index 4e0ff1a..63841b0 100644 --- a/qController/Pages/ControlPage.xaml +++ b/qController/Pages/ControlPage.xaml @@ -13,8 +13,8 @@ -