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]
DynamicLayout modSettingsLayout = new DynamicLayout();
addModButton = new ColorButton
{
Text = Text.AddNewMod,
Font = smallButtonFont,
Height = 40,
Width = 275,
TextColor = LauncherColors.Green,
BackgroundColor = LauncherColors.BG,
FrameColor = LauncherColors.Green,
BackgroundColorHover = LauncherColors.BGHover
};
addModButton = new SmallColorButton(Text.AddNewMod);
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.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 = profileButton = new ColorButton
{
Text = Text.CreateShortcut,
Font = smallButtonFont,
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
};
desktopShortcutButton = new SmallColorButton(Text.CreateShortcut);
profileButton = new SmallColorButton(Text.OpenProfileFolder);
saveButton = new SmallColorButton(Text.OpenSaveFolder);
updateModButton = new SmallColorButton(Text.UpdateModButtonText);
deleteModButton = new SmallColorButton(Text.DeleteModButtonText);
profileNotesTextArea = new TextArea
{

Loading…
Cancel
Save