Skip to content

Commit

Permalink
Add minimise button
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesCJ60 committed Aug 6, 2023
1 parent cceb116 commit 971ab8c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Universal x86 Tuning Utility Handheld"
"ProductCode" = "8:{2E05869A-4515-4BA1-B3BF-1414876B6E8E}"
"PackageCode" = "8:{F6212E0B-68E4-418F-94B7-35C67073F077}"
"ProductCode" = "8:{7DA4D5FB-8CBB-4307-9C6F-D1F729EF1755}"
"PackageCode" = "8:{32A00189-C34C-457B-AD6F-317595308388}"
"UpgradeCode" = "8:{0D76B903-EDE8-4617-A061-D858BDA0D9B9}"
"AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:0.0.7"
"ProductVersion" = "8:0.0.8"
"Manufacturer" = "8:JamesCJ"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<Company>JamesCJ</Company>
<Copyright>UXTU Team © 2023</Copyright>
<FileVersion>0.0.4</FileVersion>
<AssemblyVersion>0.0.4</AssemblyVersion>
<FileVersion>0.0.5</FileVersion>
<AssemblyVersion>0.0.5</AssemblyVersion>
<Version>$(VersionPrefix)</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ private void Functions(string parameter)
case "close":
Process.GetCurrentProcess().Kill();
return;
case "minimise":
MainWindow.minimise = 1;
return;
case "xg":
new XG_Mobile_Prompt(false).Show();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,29 @@
</Grid>
</ui:CardControl.Header>
</ui:CardControl>
<ui:CardControl
Name="ccMini"
IsEnabled="True"
Icon="ArrowMinimize24" Margin="0,9,0,0" DockPanel.Dock="Top">
<ui:CardControl.Header>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center">
<TextBlock
FontSize="16"
FontWeight="Medium"
Text="Minimise Application" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1">
<Button Width="120" Name="btnMinimise" Command="{Binding ViewModel.FunctionCommands}" CommandParameter="minimise">Minimise</Button>
</StackPanel>

</Grid>
</ui:CardControl.Header>
</ui:CardControl>
<ui:CardControl
Name="ccClose"
IsEnabled="True"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private void UpdateGUI(UserIndex controllerNo)
wasMini = false;
}

CardControl[] cards = { ccSection1, ccSection2, ccSection3, ccSection4, ccSection5, ccSection6, ccSection7, ccSection8, ccSection9, ccSection10, ccSection11, ccSection12, ccClose };
CardControl[] cards = { ccSection1, ccSection2, ccSection3, ccSection4, ccSection5, ccSection6, ccSection7, ccSection8, ccSection9, ccSection10, ccSection11, ccSection12, ccMini, ccClose };
controller = new Controller(controllerNo);
bool connected = controller.IsConnected;

Expand Down Expand Up @@ -227,6 +227,7 @@ private void UpdateGUI(UserIndex controllerNo)
}

if (cards[selected] == ccSection11) new XG_Mobile_Prompt(false).Show();
if (cards[selected] == ccMini) MainWindow.minimise = 1;
if (cards[selected] == ccClose) Process.GetCurrentProcess().Kill();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ private void TitleBar_MinimizeClicked(object sender, RoutedEventArgs e)
bool isControllerOne;
bool isControllerTwo;
bool isActive = false;
public static int minimise = 0;
async void KeyShortCuts_Tick(object sender, EventArgs e)
{
ControllerInput(UserIndex.One);
Expand Down Expand Up @@ -528,6 +529,16 @@ private void ControllerInput(UserIndex controllerNo)

bool connected = controller.IsConnected;

if(minimise == 1)
{
if (Visibility == Visibility.Visible)
{
Visibility = Visibility.Hidden;
}

minimise = 0;
}

if (connected)
{
//get controller state
Expand Down

0 comments on commit 971ab8c

Please sign in to comment.