Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/LiuYunPlayer/TuneLab
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYunPlayer committed May 18, 2024
2 parents 6479e07 + 2bf310c commit 3fd2f72
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
30 changes: 17 additions & 13 deletions TuneLab/GUI/Dialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,29 @@
</Window.Styles>

<DockPanel Margin="0">
<Grid DockPanel.Dock="Top" IsHitTestVisible="False" x:Name="TitleBar" Height="40">
<Grid DockPanel.Dock="Top" x:Name="TitleBar" Height="40">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<Label x:Name="TitleLabel" Content="Message" FontWeight="Bold" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" />

<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal" IsHitTestVisible="False">
<Label x:Name="TitleLabel" Content="Message" FontWeight="Bold" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" />
</StackPanel>
</Grid>

<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="108" />
<RowDefinition Height="56" />
</Grid.RowDefinitions>
<ContentControl x:Name="Content">
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="108" />
<RowDefinition Height="56" />
</Grid.RowDefinitions>

<StackPanel Grid.Row="0" Orientation="Vertical" Margin="12,0" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock x:Name="MessageTextBlock" Text="This is a modal window." Foreground="White" TextWrapping="Wrap" TextAlignment="Center" FontSize="14" Padding="0" Margin="0" />
</StackPanel>
<StackPanel Grid.Row="0" Orientation="Vertical" Margin="12,0" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock x:Name="MessageTextBlock" Text="This is a modal window." Foreground="White" TextWrapping="Wrap" TextAlignment="Center" FontSize="14" Padding="0" Margin="0" />
</StackPanel>

<Grid Grid.Row="1" x:Name="ButtonsPanel" Margin="0, 0, 0, 16"/>
</Grid>
<Grid Grid.Row="1" x:Name="ButtonsPanel" Margin="0, 0, 0, 16"/>
</Grid>
</ContentControl>
</DockPanel>
</Window>
6 changes: 3 additions & 3 deletions TuneLab/GUI/Dialog.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Avalonia.Media;
using ReactiveUI;
using System;
using System.Reflection.Metadata;
using System.Threading.Tasks;
using TuneLab.GUI;
using TuneLab.GUI.Components;
Expand Down Expand Up @@ -34,13 +35,12 @@ public Dialog()
Topmost = true;

this.DataContext = this;
this.Background = Style.INTERFACE.ToBrush();
this.Background = Style.BACK.ToBrush();
Content.Background = Style.INTERFACE.ToBrush();

titleBar = this.FindControl<Grid>("TitleBar") ?? throw new InvalidOperationException("TitleBar not found");
titleLabel = this.FindControl<Label>("TitleLabel") ?? throw new InvalidOperationException("TitleLabel not found");
messageTextBlock = this.FindControl<TextBlock>("MessageTextBlock") ?? throw new InvalidOperationException("MessageTextBlock not found");

titleBar.Background = Style.BACK.ToBrush();
}

public void SetTitle(string title)
Expand Down
2 changes: 1 addition & 1 deletion TuneLab/Views/LyricInput.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<StackPanel Grid.Column="2" x:Name="WindowControl" HorizontalAlignment="Right" VerticalAlignment="Center" />
</Grid>

<ContentControl>
<ContentControl x:Name="Content">
<Grid Width="480" Height="244">
<Grid.RowDefinitions>
<RowDefinition Height="184" />
Expand Down
5 changes: 3 additions & 2 deletions TuneLab/Views/LyricInput.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public LyricInput()
WindowStartupLocation = WindowStartupLocation.CenterScreen;
Topmost = true;

this.Background = Style.INTERFACE.ToBrush();
TitleBar.Background = Style.BACK.ToBrush();
this.Background = Style.BACK.ToBrush();
TitleLabel.Foreground = Style.TEXT_LIGHT.ToBrush();

var closeButton = new Button() { Width = 48, Height = 40 }
Expand All @@ -34,6 +33,8 @@ public LyricInput()

WindowControl.Children.Add(closeButton);

Content.Background = Style.INTERFACE.ToBrush();

mLyricInputBox = new TextInput();
mLyricInputBox.AcceptsReturn = true;
mLyricInputBox.Width = 432;
Expand Down

0 comments on commit 3fd2f72

Please sign in to comment.