Skip to content

Commit

Permalink
Merge pull request #1234 from maiko3tattun/240808_MessageBoxHeight
Browse files Browse the repository at this point in the history
Message box maximum height and scroll bars in place
  • Loading branch information
stakira authored Aug 14, 2024
2 parents cd88f37 + e5df134 commit 6d36d9c
Showing 1 changed file with 56 additions and 54 deletions.
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>

0 comments on commit 6d36d9c

Please sign in to comment.