Skip to content

Commit

Permalink
Merge pull request #5 from Kurokitu/master
Browse files Browse the repository at this point in the history
按钮颜色统一放置
  • Loading branch information
LiuYunPlayer authored May 13, 2024
2 parents 3f96311 + 1df46b0 commit ed48e35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions TuneLab/GUI/Dialog.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public Button AddButton(string text, ButtonType type)
var button = new Button() { MinWidth = 96, Height = 40 };

if (type == ButtonType.Primary)
button.AddContent(new() { Item = new BorderItem() { CornerRadius = 6 }, ColorSet = new() { Color = new(255, 96, 96, 192), HoveredColor = new(255, 127, 127, 255) } });
button.AddContent(new() { Item = new BorderItem() { CornerRadius = 6 }, ColorSet = new() { Color = Style.BUTTON_PRIMARY, HoveredColor = Style.BUTTON_PRIMARY_HOVER } });

if (type == ButtonType.Normal)
button.AddContent(new() { Item = new BorderItem() { CornerRadius = 6 }, ColorSet = new() { Color = new(255, 58, 63, 105), HoveredColor = new(255, 85, 92, 153) } });
button.AddContent(new() { Item = new BorderItem() { CornerRadius = 6 }, ColorSet = new() { Color = Style.BUTTON_NORMAL, HoveredColor = Style.BUTTON_NORMAL_HOVER } });

button.AddContent(new() { Item = new TextItem() { Text = text }, ColorSet = new() { Color = type == ButtonType.Primary ? Colors.White : Style.LIGHT_WHITE } });

Expand Down
4 changes: 4 additions & 0 deletions TuneLab/GUI/Style.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ internal static class Style
public static readonly Color TEXT_LIGHT = new(255, 255, 255, 255);
public static readonly Color WHITE_KEY = new(255, 39, 39, 54);
public static readonly Color BLACK_KEY = new(255, 27, 27, 36);
public static readonly Color BUTTON_PRIMARY = new(255, 96, 96, 192);
public static readonly Color BUTTON_NORMAL = new(255, 58, 63, 105);
public static readonly Color BUTTON_PRIMARY_HOVER = new(255, 127, 127, 255);
public static readonly Color BUTTON_NORMAL_HOVER = new(255, 85, 92, 153);
}
2 changes: 1 addition & 1 deletion TuneLab/Views/LyricInput.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public LyricInput()
OkButtonPanel.Orientation = Orientation.Horizontal;
OkButtonPanel.HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Right;
var OkButton = new Button() { Width = 64, Height = 28 };
OkButton.AddContent(new() { Item = new BorderItem() { CornerRadius = 6 }, ColorSet = new() { Color = new(255, 96, 96, 192), HoveredColor = new(255, 127, 127, 255) } });
OkButton.AddContent(new() { Item = new BorderItem() { CornerRadius = 6 }, ColorSet = new() { Color = Style.BUTTON_PRIMARY, HoveredColor = Style.BUTTON_PRIMARY_HOVER } });
OkButton.AddContent(new() { Item = new TextItem() { Text = "OK" }, ColorSet = new() { Color = Colors.White } });
OkButtonPanel.Children.Add(OkButton);
ActionsPanel.Children.Add(OkButtonPanel);
Expand Down

0 comments on commit ed48e35

Please sign in to comment.