Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
add buttons to backup and load configs (no logic yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxijabase committed Feb 14, 2022
1 parent 37d0a8f commit f2fba58
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private int ConsumeSMMethodmap()
Parameters = parameters.ToArray(),
FullName = TrimFullname(source.Substring(mStartIndex, mEndIndex - mStartIndex + 1)),
Length = mEndIndex - mStartIndex + 1,
CommentString = Condenser.TrimComments(functionCommentString),
CommentString = TrimComments(functionCommentString),
MethodmapName = methodMapName,
File = FileName
});
Expand Down
1 change: 1 addition & 0 deletions Spcode.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
<Compile Include="UI\Windows\ConfigWindow.xaml.cs">
<DependentUpon>ConfigWindow.xaml</DependentUpon>
</Compile>
<Compile Include="UI\Windows\ConfigWindow\ConfigWindowConfigsManager.cs" />
<Compile Include="UI\Windows\RenameWindow.xaml.cs">
<DependentUpon>RenameWindow.xaml</DependentUpon>
</Compile>
Expand Down
8 changes: 5 additions & 3 deletions UI/Components/ColorChangeControl/ColorChangeControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private void SliderValue_Changed(object sender, RoutedEventArgs e)
if (!RaiseEventAllowed) { return; }
var c = Color.FromArgb(0xFF, (byte)(int)RSlider.Value, (byte)(int)GSlider.Value, (byte)(int)BSlider.Value);
UpdateColor(c, true, false);
var raiseEvent = new RoutedEventArgs(ColorChangeControl.ColorChangedEvent);
var raiseEvent = new RoutedEventArgs(ColorChangedEvent);
RaiseEvent(raiseEvent);
}

Expand All @@ -57,7 +57,7 @@ private void UpdateColor(Color c, bool UpdateTextBox = true, bool UpdateSlider =
GSlider.Value = c.G;
BSlider.Value = c.B;
}
var raiseEvent = new RoutedEventArgs(ColorChangeControl.ColorChangedEvent);
var raiseEvent = new RoutedEventArgs(ColorChangedEvent);
RaiseEvent(raiseEvent);
RaiseEventAllowed = true;
}
Expand All @@ -72,7 +72,9 @@ private void BrushRect_TextChanged(object sender, TextChangedEventArgs e)
parseString = parseString.Substring(2);
}
if (int.TryParse(parseString, System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture, out var result))
{ cVal = result; }
{
cVal = result;
}
UpdateColor(Color.FromArgb(0xFF, (byte)((cVal >> 16) & 0xFF), (byte)((cVal >> 8) & 0xFF), (byte)(cVal & 0xFF)), false, true);
}
}
Expand Down
12 changes: 10 additions & 2 deletions UI/Windows/ConfigWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@
IsMaxRestoreButtonEnabled="False"
WindowStartupLocation="CenterOwner"
GlowBrush="{DynamicResource AccentColorBrush}"
Title="Configurations"
ShowTitleBar="False"
Title="Configurations"
TitleCaps="False"
ShowTitleBar="true"
Closing="MetroWindow_Closing">

<controls:MetroWindow.RightWindowCommands>
<controls:WindowCommands>
<Button Name="BackupConfigsButton" Content="Backup configs" Click="BackupConfigsButton_Click"/>
<Button Name="LoadConfigsButton" Content="Load configs" Click="LoadConfigsButton_Click"/>
</controls:WindowCommands>
</controls:MetroWindow.RightWindowCommands>

<controls:MetroWindow.Resources>
<ResourceDictionary>

Expand Down
22 changes: 22 additions & 0 deletions UI/Windows/ConfigWindow/ConfigWindowConfigsManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace SPCode.UI.Windows
{
public partial class ConfigWindow
{
private void BackupConfigsButton_Click(object sender, RoutedEventArgs e)
{

}

private void LoadConfigsButton_Click(object sender, RoutedEventArgs e)
{

}
}
}

0 comments on commit f2fba58

Please sign in to comment.