Unify small buttons

pull/35/head
Miepee 4 years ago
parent 9d1920c849
commit a50c35113d

@ -0,0 +1,22 @@
using Eto.Drawing;
namespace AM2RLauncher;
public class SmallColorButton : ColorButton
{
private Font smallButtonFont = new Font(SystemFont.Default, 10);
public SmallColorButton(string text)
{
Font = smallButtonFont;
Text = text;
Height = 40;
Width = 275;
TextColor = LauncherColors.Green;
TextColorDisabled = LauncherColors.Inactive;
BackgroundColor = LauncherColors.BG;
BackgroundColorHover = LauncherColors.BGHover;
FrameColor = LauncherColors.Green;
FrameColorDisabled = LauncherColors.Inactive;
}
}

@ -601,17 +601,7 @@ public partial class MainForm : Form
// [MOD SETTINGS] // [MOD SETTINGS]
DynamicLayout modSettingsLayout = new DynamicLayout(); DynamicLayout modSettingsLayout = new DynamicLayout();
addModButton = new ColorButton addModButton = new SmallColorButton(Text.AddNewMod);
{
Text = Text.AddNewMod,
Font = smallButtonFont,
Height = 40,
Width = 275,
TextColor = LauncherColors.Green,
BackgroundColor = LauncherColors.BG,
FrameColor = LauncherColors.Green,
BackgroundColorHover = LauncherColors.BGHover
};
Label modSpacer = new Label Label modSpacer = new Label
{ {
@ -638,66 +628,11 @@ public partial class MainForm : Form
modSettingsProfileDropDown.DataStore = profileDropDown.DataStore; // It's actually more comfortable if it's outside, because of GTK shenanigans modSettingsProfileDropDown.DataStore = profileDropDown.DataStore; // It's actually more comfortable if it's outside, because of GTK shenanigans
modSettingsProfileDropDown.Bind(m => m.SelectedIndex, profileDropDown, p => p.SelectedIndex); modSettingsProfileDropDown.Bind(m => m.SelectedIndex, profileDropDown, p => p.SelectedIndex);
//TODO: this is copy pasted too often, make custom class for our buttons so we can just call *one* constructor. desktopShortcutButton = new SmallColorButton(Text.CreateShortcut);
desktopShortcutButton = profileButton = new ColorButton profileButton = new SmallColorButton(Text.OpenProfileFolder);
{ saveButton = new SmallColorButton(Text.OpenSaveFolder);
Text = Text.CreateShortcut, updateModButton = new SmallColorButton(Text.UpdateModButtonText);
Font = smallButtonFont, deleteModButton = new SmallColorButton(Text.DeleteModButtonText);
Height = 40,
Width = 275,
TextColor = LauncherColors.Green,
BackgroundColor = LauncherColors.BG,
FrameColor = LauncherColors.Green,
BackgroundColorHover = LauncherColors.BGHover
};
profileButton = new ColorButton
{
Text = Text.OpenProfileFolder,
Font = smallButtonFont,
Height = 40,
Width = 275,
TextColor = LauncherColors.Green,
BackgroundColor = LauncherColors.BG,
FrameColor = LauncherColors.Green,
BackgroundColorHover = LauncherColors.BGHover
};
saveButton = new ColorButton
{
Text = Text.OpenSaveFolder,
Font = smallButtonFont,
Height = 40,
Width = 275,
TextColor = LauncherColors.Green,
BackgroundColor = LauncherColors.BG,
FrameColor = LauncherColors.Green,
BackgroundColorHover = LauncherColors.BGHover
};
updateModButton = new ColorButton
{
Text = Text.UpdateModButtonText,
Font = smallButtonFont,
Height = 40,
Width = 275,
TextColor = LauncherColors.Green,
BackgroundColor = LauncherColors.BG,
FrameColor = LauncherColors.Green,
BackgroundColorHover = LauncherColors.BGHover
};
deleteModButton = new ColorButton
{
Text = Text.DeleteModButtonText,
Font = smallButtonFont,
Height = 40,
Width = 275,
TextColor = LauncherColors.Green,
BackgroundColor = LauncherColors.BG,
FrameColor = LauncherColors.Green,
BackgroundColorHover = LauncherColors.BGHover
};
profileNotesTextArea = new TextArea profileNotesTextArea = new TextArea
{ {

Loading…
Cancel
Save