Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化样式 #41

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions TuneLab/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<Application.Styles>
<FluentTheme />
<StyleInclude Source="avares://TuneLab/Assets/GlobalStyle.axaml"/>
</Application.Styles>
<Application.Resources>
<FontFamily x:Key="NotoMono">avares://TuneLab/Assets/Fonts#NotoMono</FontFamily>
Expand Down
21 changes: 21 additions & 0 deletions TuneLab/Assets/GlobalStyle.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style Selector="MenuItem > MenuItem">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="#272736"/>
</Style>

<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="#6060C0"/>
</Style>

<Style Selector="ComboBox:dropdownopen /template/ Border#PopupBorder">
<Setter Property="Background" Value="#1B1B24" />
<Setter Property="BorderBrush" Value="#1B1B24" />
<Setter Property="TextBlock.Foreground" Value="White" />
</Style>

<Style Selector="ComboBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="#6060C0"/>
</Style>
</Styles>
8 changes: 1 addition & 7 deletions TuneLab/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@
ExtendClientAreaTitleBarHeightHint="40"
ExtendClientAreaToDecorationsHint="True"
SizeChanged="Window_SizeChanged">

<Window.Styles>
<Style Selector="MenuItem > MenuItem">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="#272736"/>
</Style>
</Window.Styles>

<Window.Resources>
<SolidColorBrush x:Key="MenuFlyoutPresenterBackground">#272736</SolidColorBrush>
</Window.Resources>
Expand Down
3 changes: 1 addition & 2 deletions TuneLab/Views/TrackSelector.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
</StackPanel>

<StackPanel Grid.Row="1" Orientation="Vertical" Margin="24, 16, 24, 16" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="TrackSelectBox">
<ListBox x:Name="mTrackList" Width="432" Height="168" FontSize="14">
</ListBox>
<ListBox x:Name="mTrackList" Width="432" Height="168" FontSize="14" CornerRadius="4" />
</StackPanel>

<Grid Grid.Row="2" x:Name="ActionsPanel" Margin="24, 16, 24, 16">
Expand Down
3 changes: 2 additions & 1 deletion TuneLab/Views/TrackSelector.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using TuneLab.GUI;
using TuneLab.Utils;
using Button = TuneLab.GUI.Components.Button;
using CheckBox = TuneLab.GUI.Components.CheckBox;

namespace TuneLab.Views;
internal partial class TrackSelector : Window
Expand Down Expand Up @@ -42,7 +43,7 @@ public TrackSelector()
KeepTempoPanel.Orientation = Orientation.Horizontal;
KeepTempoPanel.Height = 24;
KeepTempoPanel.Children.Add(mKeepTempoCheckBox);
KeepTempoPanel.Children.Add(new Label() { Content = "Keep Tempo", FontSize = 12, Foreground = Style.TEXT_LIGHT.ToBrush(), Margin = new(0, 1) });
KeepTempoPanel.Children.Add(new Label() { Content = "Keep Tempo", FontSize = 12, Foreground = Style.TEXT_LIGHT.ToBrush(), Margin = new(14, 1) });
ActionsPanel.Children.Add(KeepTempoPanel);
Grid.SetColumn(KeepTempoPanel, 0);

Expand Down
Loading