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

Message box maximum height and scroll bars in place #1234

Merged
merged 1 commit into from
Aug 14, 2024
Merged
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
110 changes: 56 additions & 54 deletions OpenUtau/Views/MessageBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,61 @@
Title="MessageBox" MinWidth="300" MinHeight="150"
WindowStartupLocation="CenterScreen"
ExtendClientAreaToDecorationsHint="False">
<Grid Margin="{Binding $parent.WindowDecorationMargin}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>

<!-- Show simple text -->
<TextBlock Margin="20" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Name="Text" TextWrapping="Wrap" MaxWidth="560"/>
<ScrollViewer MaxHeight="700" VerticalScrollBarVisibility="Auto">
<Grid Margin="{Binding $parent.WindowDecorationMargin}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>

<!-- Show text with URL button -->
<StackPanel Margin="20" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Name="TextPanel" MaxWidth="560">
<StackPanel.Styles>
<Style Selector="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<Style Selector="Button">
<Setter Property="Foreground" Value="Blue" />
<Setter Property="Padding" Value="0" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<ControlTemplate>
<ContentPresenter Content="{TemplateBinding Content}">
<ContentPresenter.Styles>
<Style Selector="TextBlock">
<Setter Property="Foreground" Value="{TemplateBinding Foreground}"/>
<Setter Property="FontSize" Value="{TemplateBinding FontSize}"/>
<Setter Property="TextDecorations" Value="Underline"/>
</Style>
</ContentPresenter.Styles>
</ContentPresenter>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Expander">
<Setter Property="Margin" Value="0, 20, 0, 0" />
<Setter Property="Width" Value="560" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
</StackPanel.Styles>
</StackPanel>

<StackPanel Grid.Row="1" HorizontalAlignment="Center" Orientation="Horizontal" Name="Buttons">
<StackPanel.Styles>
<Style Selector="Button">
<Setter Property="Margin" Value="15,0,15,0"/>
<Setter Property="MinWidth" Value="80"/>
</Style>
<Style Selector="Button TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
</Style>
</StackPanel.Styles>
</StackPanel>
</Grid>
<!-- Show simple text -->
<TextBlock Margin="20" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Name="Text" TextWrapping="Wrap" MaxWidth="560"/>

<!-- Show text with URL button -->
<StackPanel Margin="20" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Name="TextPanel" MaxWidth="560">
<StackPanel.Styles>
<Style Selector="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<Style Selector="Button">
<Setter Property="Foreground" Value="Blue" />
<Setter Property="Padding" Value="0" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<ControlTemplate>
<ContentPresenter Content="{TemplateBinding Content}">
<ContentPresenter.Styles>
<Style Selector="TextBlock">
<Setter Property="Foreground" Value="{TemplateBinding Foreground}"/>
<Setter Property="FontSize" Value="{TemplateBinding FontSize}"/>
<Setter Property="TextDecorations" Value="Underline"/>
</Style>
</ContentPresenter.Styles>
</ContentPresenter>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Expander">
<Setter Property="Margin" Value="0, 20, 0, 0" />
<Setter Property="Width" Value="560" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
</StackPanel.Styles>
</StackPanel>

<StackPanel Grid.Row="1" HorizontalAlignment="Center" Orientation="Horizontal" Name="Buttons">
<StackPanel.Styles>
<Style Selector="Button">
<Setter Property="Margin" Value="15,0,15,0"/>
<Setter Property="MinWidth" Value="80"/>
</Style>
<Style Selector="Button TextBlock">
<Setter Property="TextAlignment" Value="Center"/>
</Style>
</StackPanel.Styles>
</StackPanel>
</Grid>
</ScrollViewer>
</Window>
Loading