Skip to content

Commit

Permalink
1.5 Added support for multiple settings profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
VlaanH committed Aug 27, 2021
1 parent 4e02ee9 commit f4ceccd
Show file tree
Hide file tree
Showing 5 changed files with 375 additions and 34 deletions.
52 changes: 52 additions & 0 deletions AntStatsAvalonia/Profile/ProfilesAvaloniaObjList.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using Avalonia.Controls;

namespace AntStats.Avalonia.Profile
{

public class ProfileAvalonObj
{
public Button minus = new Button();

public Button prof = new Button();

public DockPanel dockPanel = new DockPanel();
}

public static class ProfilesAvaloniaObjList
{
public static List<ProfileAvalonObj> ListProfilesuAvalonObjStats = new List<ProfileAvalonObj>();

public static List<ProfileAvalonObj> ListProfilesuAvalonObjSettings = new List<ProfileAvalonObj>();
}




public static class ProfileManagement
{

public static string GlobalSelectedProfile = default;

public static void SelectProfile(List<ProfileAvalonObj>profileList,string profileName )
{

for (int i = 0; i < profileList.Count; i++)
if ((string) profileList[i].prof.Content==profileName)
{
for (int j = 0; j < profileList.Count; j++)
{
profileList[j].prof.IsEnabled = true;
}

profileList[i].prof.IsEnabled = false;
}

GlobalSelectedProfile = profileName;

}

}

}
40 changes: 33 additions & 7 deletions AntStatsAvalonia/Settings.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@



<Grid Margin="10" >

<StackPanel>
<Grid Margin="6" >
<Grid.ColumnDefinitions >
<ColumnDefinition/>
<ColumnDefinition Width="5"/>
<ColumnDefinition MaxWidth="100"/>
</Grid.ColumnDefinitions>


<StackPanel Grid.Column="0">

<Label Content="Settings" BorderBrush="turquoise" BorderThickness="0,0,0,1" HorizontalContentAlignment="Center" FontSize="30" />
<TextBox Name="TextBoxProfile" Watermark="Profile name" Text="Settings"
BorderBrush="turquoise" BorderThickness="0,0,0,1"
HorizontalContentAlignment="Center" FontSize="30"
MaxLength="7"
/>

<Grid Margin="0,25,0,0">

Expand Down Expand Up @@ -216,15 +226,31 @@
></Button>






</Grid >





<GridSplitter Margin="10,0,0,0" Grid.Column="1" ResizeBehavior="PreviousAndNext" BorderBrush="#808080" BorderThickness="3"/>

<StackPanel Grid.Column="2" >
<Label Content="Profiles" HorizontalContentAlignment="Center" ></Label>

<StackPanel Margin="2" Name="Profiles">

</StackPanel>
<Button Content="+" FontSize="15" VerticalAlignment="Stretch"
VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
HorizontalAlignment="Stretch" Background="black"
Name="UpdatingTheListOfExistingProfiles"
Click="ButtonAddProfile_OnClick"
></Button>


</StackPanel>



</Grid>
Expand Down
Loading

0 comments on commit f4ceccd

Please sign in to comment.