update to .NET 10 and fix label colors

This commit is contained in:
2026-09-07 08:41:03 -05:00
parent 31580d2d68
commit 1e49a41b82
14 changed files with 47 additions and 66 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 18
VisualStudioVersion = 17.12.35707.178 VisualStudioVersion = 18.9.12120.119 stable
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "qController", "qController\qController.csproj", "{63B39EEA-36D4-4B2C-8FFD-FB0E12FD8B14}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "qController", "qController\qController.csproj", "{63B39EEA-36D4-4B2C-8FFD-FB0E12FD8B14}"
EndProject EndProject
+2 -12
View File
@@ -19,18 +19,8 @@ namespace qController
if (qCommand.osc.Contains("go")) if (qCommand.osc.Contains("go"))
{ {
BackgroundColor = Colors.SeaGreen; 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 FontSize = App.HeightUnit * 4;
switch (Device.RuntimePlatform) FontAttributes = FontAttributes.Bold;
{
case Device.iOS:
FontSize = App.HeightUnit * 4;
FontAttributes = FontAttributes.Bold;
break;
case Device.Android:
FontSize = App.HeightUnit * 4;
FontAttributes = FontAttributes.Bold;
break;
}
} }
else if (qCommand.osc.Contains("panic")) else if (qCommand.osc.Contains("panic"))
{ {
+5 -21
View File
@@ -10,16 +10,7 @@ namespace qController.Cell
public ObservableCollection<OSCListItem> items; public ObservableCollection<OSCListItem> items;
public QCueListCell(QCueList qCueList) 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 Margin = new Thickness(10, 10, 10, 10);
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;
}
Padding = new Thickness(10); Padding = new Thickness(10);
items = new ObservableCollection<OSCListItem>(); items = new ObservableCollection<OSCListItem>();
@@ -41,22 +32,15 @@ namespace qController.Cell
icon.HorizontalTextAlignment = TextAlignment.Center; icon.HorizontalTextAlignment = TextAlignment.Center;
icon.VerticalTextAlignment = TextAlignment.Center; icon.VerticalTextAlignment = TextAlignment.Center;
icon.FontSize = App.HeightUnit * 3; icon.FontSize = App.HeightUnit * 3;
icon.TextColor = Colors.Black;
var label = new Label { VerticalOptions = LayoutOptions.FillAndExpand }; var label = new Label { VerticalOptions = LayoutOptions.FillAndExpand };
label.SetBinding(Label.TextProperty, "Text"); label.SetBinding(Label.TextProperty, "Text");
if (label.Text == "Disconnect") if (label.Text == "Disconnect")
{ {
label.TextColor = Colors.DarkRed; 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 label.FontSize = App.HeightUnit * 2.2;
switch (Device.RuntimePlatform) label.TextColor = Colors.Black;
{
case Device.iOS:
label.FontSize = App.HeightUnit * 3;
break;
case Device.Android:
label.FontSize = App.HeightUnit * 2.2;
break;
}
grid.Add(icon); grid.Add(icon);
grid.Add(label, 1, 0); grid.Add(label, 1, 0);
return new ViewCell { View = grid }; return new ViewCell { View = grid };
@@ -68,7 +52,7 @@ namespace qController.Cell
{ {
BackgroundColor = Colors.Gray, BackgroundColor = Colors.Gray,
Text = "Close", Text = "Close",
TextColor = Colors.White TextColor = Colors.Black
}; };
layout.Children.Add(closeButton); layout.Children.Add(closeButton);
@@ -75,11 +75,13 @@ namespace qController.Cell
nameLabel.FontAttributes = FontAttributes.Bold; nameLabel.FontAttributes = FontAttributes.Bold;
nameLabel.FontSize = App.HeightUnit * 3; nameLabel.FontSize = App.HeightUnit * 3;
nameLabel.Margin = new Thickness(0, 20, 0, 0); nameLabel.Margin = new Thickness(0, 20, 0, 0);
nameLabel.TextColor = Colors.Black;
addressLabel.HorizontalTextAlignment = TextAlignment.Center; addressLabel.HorizontalTextAlignment = TextAlignment.Center;
addressLabel.VerticalTextAlignment = TextAlignment.Start; addressLabel.VerticalTextAlignment = TextAlignment.Start;
addressLabel.FontSize = App.HeightUnit * 2.5; addressLabel.FontSize = App.HeightUnit * 2.5;
addressLabel.Margin = new Thickness(0, 0, 0, 20); addressLabel.Margin = new Thickness(0, 0, 0, 20);
addressLabel.TextColor = Colors.Black;
connectLabel.HorizontalOptions = LayoutOptions.StartAndExpand; connectLabel.HorizontalOptions = LayoutOptions.StartAndExpand;
connectLabel.VerticalOptions = LayoutOptions.CenterAndExpand; connectLabel.VerticalOptions = LayoutOptions.CenterAndExpand;
+8 -4
View File
@@ -89,7 +89,8 @@ namespace qController.Cell
number = new Label { number = new Label {
Text = "", Text = "",
FontAttributes = FontAttributes.Bold, FontAttributes = FontAttributes.Bold,
FontSize = App.HeightUnit * 5 FontSize = App.HeightUnit * 5,
TextColor = Colors.Black,
}; };
name = new Label { name = new Label {
@@ -97,7 +98,8 @@ namespace qController.Cell
FontAttributes = FontAttributes.Bold, FontAttributes = FontAttributes.Bold,
HorizontalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center,
FontSize = App.HeightUnit * 3.5, FontSize = App.HeightUnit * 3.5,
Margin = new Thickness(0) Margin = new Thickness(0),
TextColor = Colors.Black,
}; };
type = new Label { type = new Label {
@@ -105,7 +107,8 @@ namespace qController.Cell
FontFamily = App.QFont, FontFamily = App.QFont,
VerticalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center,
HorizontalTextAlignment = TextAlignment.End, HorizontalTextAlignment = TextAlignment.End,
FontSize = App.HeightUnit * 5 FontSize = App.HeightUnit * 5,
TextColor = Colors.Black,
}; };
notes = new Label { notes = new Label {
@@ -113,7 +116,8 @@ namespace qController.Cell
HorizontalTextAlignment = TextAlignment.Center, HorizontalTextAlignment = TextAlignment.Center,
Margin = new Thickness(0,0,0,10), Margin = new Thickness(0,0,0,10),
VerticalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand HorizontalOptions = LayoutOptions.FillAndExpand,
TextColor = Colors.Black,
}; };
//BACKGROUND COLORS FOR TESTING ONLY //BACKGROUND COLORS FOR TESTING ONLY
+1 -7
View File
@@ -1,10 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.App"> <Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.App">
<Application.Resources>
<!-- Application resource dictionary -->
<OnPlatform x:Key="qfont" x:TypeArguments="x:String">
<On Platform="Android" Value="qfont.ttf#qfont" />
<On Platform="iOS" Value="qfont" />
</OnPlatform>
</Application.Resources>
</Application> </Application>
+3 -13
View File
@@ -39,19 +39,9 @@ namespace qController
Height = mainDisplayInfo.Height / mainDisplayInfo.Density; Height = mainDisplayInfo.Height / mainDisplayInfo.Density;
Width = mainDisplayInfo.Width / mainDisplayInfo.Density; Width = mainDisplayInfo.Width / mainDisplayInfo.Density;
HeightUnit = Height / 100.0; HeightUnit = Height / 100.0;
WidthUnit = Width / 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) QFont = "qfont";
{
case Device.iOS:
QFont = "qfont";
break;
case Device.Android:
QFont = "qfont.ttf#qfont";
break;
}
rootPage = new RootPage(); rootPage = new RootPage();
rootPage.Detail = new NavigationPage(new QConnectionPage()); rootPage.Detail = new NavigationPage(new QConnectionPage());
MainPage = rootPage; MainPage = rootPage;
+2 -2
View File
@@ -13,8 +13,8 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="4*" /> <ColumnDefinition Width="4*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label x:Name="menuButton" FontFamily = "{StaticResource qfont}" HorizontalOptions = "Start" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0" FontSize="25" Text="&#xF0C9;"/> <Label x:Name="menuButton" FontFamily = "qfont" HorizontalOptions = "Start" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0" FontSize="25" Text="&#xF0C9;" TextColor="Black"/>
<Label x:Name="instanceName" HorizontalTextAlignment="End" HorizontalOptions = "FillAndExpand" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="1"/> <Label x:Name="instanceName" HorizontalTextAlignment="End" HorizontalOptions = "FillAndExpand" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="1" TextColor="Black"/>
</Grid> </Grid>
<AbsoluteLayout x:Name="sLayout" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"></AbsoluteLayout> <AbsoluteLayout x:Name="sLayout" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"></AbsoluteLayout>
</StackLayout> </StackLayout>
+2
View File
@@ -24,6 +24,8 @@ namespace qController
{ {
InitializeComponent(); InitializeComponent();
SafeAreaEdges = SafeAreaEdges.All;
qController = new QController(address, 53000); qController = new QController(address, 53000);
qController.qClient.qParser.WorkspaceInfoReceived += WorkspaceInfoReceived; qController.qClient.qParser.WorkspaceInfoReceived += WorkspaceInfoReceived;
qController.qClient.qParser.WorkspaceUpdated += WorkspaceUpdated; qController.qClient.qParser.WorkspaceUpdated += WorkspaceUpdated;
+1 -1
View File
@@ -11,9 +11,9 @@ namespace qController
public ObservableCollection<MenuPageItem> items { get; } = new ObservableCollection<MenuPageItem>(); public ObservableCollection<MenuPageItem> items { get; } = new ObservableCollection<MenuPageItem>();
public MenuPage() public MenuPage()
{ {
On<iOS>().SetUseSafeArea(true);
Title = "Menu"; Title = "Menu";
InitializeComponent(); InitializeComponent();
SafeAreaEdges = SafeAreaEdges.All;
ChangeToHome(); ChangeToHome();
+1 -1
View File
@@ -10,7 +10,7 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label x:Name="menuButton" FontFamily = "{StaticResource qfont}" HorizontalOptions = "Start" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0" FontSize="25" Text="&#xF0C9;"/> <Label x:Name="menuButton" FontFamily = "qfont" HorizontalOptions = "Start" VerticalOptions="End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0" FontSize="25" Text="&#xF0C9;" TextColor="Black"/>
</Grid> </Grid>
<ListView x:Name="listView" HasUnevenRows="true" BackgroundColor="#4A4A4A" SeparatorVisibility="None"></ListView> <ListView x:Name="listView" HasUnevenRows="true" BackgroundColor="#4A4A4A" SeparatorVisibility="None"></ListView>
</StackLayout> </StackLayout>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="40" android:versionName="1.7.2" package="com.jwetzell.qlabcontroller" android:installLocation="auto"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="41" android:versionName="1.8.0" package="com.jwetzell.qlabcontroller" android:installLocation="auto">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:supportsRtl="true" android:label="qControl"></application> <application android:allowBackup="true" android:icon="@mipmap/appicon" android:supportsRtl="true" android:label="qControl"></application>
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
@@ -14,6 +14,7 @@ namespace qController
{ {
base.OnCreate(savedInstanceState); base.OnCreate(savedInstanceState);
Acr.UserDialogs.UserDialogs.Init(this); Acr.UserDialogs.UserDialogs.Init(this);
RequestedOrientation = ScreenOrientation.Portrait;
} }
} }
+16 -2
View File
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net9.0-android35.0</TargetFrameworks> <TargetFrameworks>net10.0-android36.0</TargetFrameworks>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>qController</RootNamespace> <RootNamespace>qController</RootNamespace>
<UseMaui>true</UseMaui> <UseMaui>true</UseMaui>
@@ -28,9 +28,23 @@
<AndroidEnableMultiDex>False</AndroidEnableMultiDex> <AndroidEnableMultiDex>False</AndroidEnableMultiDex>
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk> <EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-android35.0|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-android36.0|AnyCPU'">
<AndroidPackageFormat>apk</AndroidPackageFormat> <AndroidPackageFormat>apk</AndroidPackageFormat>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net10.0-android36.0|AnyCPU'">
<Optimize>False</Optimize>
<AndroidKeyStore>False</AndroidKeyStore>
<RunAOTCompilation>True</RunAOTCompilation>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net10.0-android36.0|AnyCPU'">
<AndroidPackageFormat>apk</AndroidPackageFormat>
<AndroidUseAapt2>False</AndroidUseAapt2>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidKeyStore>False</AndroidKeyStore>
<PublishTrimmed>True</PublishTrimmed>
<RunAOTCompilation>True</RunAOTCompilation>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<!-- App Icon --> <!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" ForegroundScale="0.65" /> <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" ForegroundScale="0.65" />