From fddc621483a54db32ee0daabed6d58dd944f598a Mon Sep 17 00:00:00 2001 From: Raymond Bian Date: Sun, 14 Jul 2024 10:01:11 -0700 Subject: [PATCH] GUI updates to layout to fill missing device info section --- Configurator/Configurator.csproj | 4 +- .../{Device.xaml => DeviceControl.xaml} | 67 ++++++++++--------- .../{Device.xaml.cs => DeviceControl.xaml.cs} | 18 +++-- Configurator/MainWindow.xaml | 2 +- Configurator/MainWindow.xaml.cs | 12 ++-- README.md | 2 +- 6 files changed, 59 insertions(+), 46 deletions(-) rename Configurator/{Device.xaml => DeviceControl.xaml} (75%) rename Configurator/{Device.xaml.cs => DeviceControl.xaml.cs} (84%) diff --git a/Configurator/Configurator.csproj b/Configurator/Configurator.csproj index 850097d..f1b2bcd 100644 --- a/Configurator/Configurator.csproj +++ b/Configurator/Configurator.csproj @@ -15,7 +15,7 @@ true - + @@ -43,7 +43,7 @@ - + MSBuild:Compile diff --git a/Configurator/Device.xaml b/Configurator/DeviceControl.xaml similarity index 75% rename from Configurator/Device.xaml rename to Configurator/DeviceControl.xaml index 7fd1d62..0de1ec1 100644 --- a/Configurator/Device.xaml +++ b/Configurator/DeviceControl.xaml @@ -8,53 +8,56 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - + - - + - + + + - Device Info - Set Configuration - - - - - Set Configuration + + + + + + + + + + + - - - - - - - - - - - - - - Enabled Features - + + + + Enabled Features + @@ -88,7 +91,7 @@ Photo Transfer - Audio Streaming + Audio Interface iTunes USB diff --git a/Configurator/Device.xaml.cs b/Configurator/DeviceControl.xaml.cs similarity index 84% rename from Configurator/Device.xaml.cs rename to Configurator/DeviceControl.xaml.cs index 077936a..327910f 100644 --- a/Configurator/Device.xaml.cs +++ b/Configurator/DeviceControl.xaml.cs @@ -34,7 +34,10 @@ public Device(int deviceIndex, Messenger parentMessenger) foreach (ToggleButton child in ConfigPanel.Children) { - child.Click += ConfigButton_Click; + if (child is ToggleButton configButton) + { + configButton.Click += ConfigButton_Click; + } } foreach (var child in FeatureSelector.Children) { @@ -71,10 +74,13 @@ private void ConfigButton_Click(object sender, RoutedEventArgs e) button.IsChecked = true; return; } - foreach (ToggleButton child in ConfigPanel.Children) + foreach (var child in ConfigPanel.Children) { - if (child.Equals(button)) continue; - child.IsChecked = false; + if (child is ToggleButton configButton) + { + if (configButton.Equals(button)) continue; + configButton.IsChecked = false; + } } int configNum = ConfigPanel.Children.IndexOf(button) + 1; @@ -105,6 +111,10 @@ private void UpdateAvailableFeatures() } } } + private void Button_Click(object sender, RoutedEventArgs e) + { + _ = Windows.System.Launcher.LaunchUriAsync(new Uri("https://github.com/raybbian/iUtils")); + } private Messenger m_messenger; private int m_deviceInd; diff --git a/Configurator/MainWindow.xaml b/Configurator/MainWindow.xaml index b0acdac..4b26bc7 100644 --- a/Configurator/MainWindow.xaml +++ b/Configurator/MainWindow.xaml @@ -37,7 +37,7 @@ - + diff --git a/Configurator/MainWindow.xaml.cs b/Configurator/MainWindow.xaml.cs index acd91de..bed6c1a 100644 --- a/Configurator/MainWindow.xaml.cs +++ b/Configurator/MainWindow.xaml.cs @@ -84,18 +84,18 @@ private void Canvas_Loaded(object sender, RoutedEventArgs e) { DisplayArea displayArea = DisplayArea.GetFromWindowId(m_appWindow.Id, DisplayAreaFallback.Nearest); double scaleAdjustment = Canvas.XamlRoot.RasterizationScale; - int width = (int)Math.Round(576 * scaleAdjustment); - int height = (int)Math.Round(265 * scaleAdjustment); - int bottomPadding = (int)Math.Round(20 * scaleAdjustment); - int xCoord = (displayArea.WorkArea.Width - width) / 2; - int yCoord = (displayArea.WorkArea.Height - height - bottomPadding); + int width = (int)Math.Round(315 * scaleAdjustment); + int height = (int)Math.Round(315 * scaleAdjustment); + int padding = (int)Math.Round(20 * scaleAdjustment); + int xCoord = displayArea.WorkArea.Width - width - padding; + int yCoord = displayArea.WorkArea.Height - height - padding; m_appWindow.MoveAndResize(new Windows.Graphics.RectInt32(xCoord, yCoord, width, height)); } private void CreateNewDeviceTab(int index) { TabViewItem newItem = new TabViewItem(); - newItem.Header = "Apple Device " + index; + newItem.Header = "Device " + (index + 1); Device device = new Device(index, m_messenger); newItem.Content = device; diff --git a/README.md b/README.md index 8adfa78..963eb71 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is a collection of tools to chip away at Apple's walled garden, exposing an ## How Do I Use This? -Please see the alpha [releases](https://github.com/raybbian/iUtils/releases/tag/Alpha). +Please see the alpha [releases](https://github.com/raybbian/iUtils/releases/). ## Drivers