fix(desktop): 菜单贴紧标题栏,去掉顶部空隙
- 外层 Grid 不再加 18 边距:行 0 = Menu(Padding 10,3,0,3,紧贴标题栏), 行 1 = 内容区(Margin 18,10,18,18),标题/查询卡改到内容区 Grid 的 row 0/1 - 原来的 Margin="-6,0,0,8" + Grid 18 边距会让菜单离标题栏多出 18px
This commit is contained in:
parent
21dfc7f651
commit
e7ff6ed784
@ -8,15 +8,15 @@
|
||||
Background="{StaticResource BgBrush}"
|
||||
FontFamily="Microsoft YaHei UI, Segoe UI"
|
||||
FontSize="13">
|
||||
<Grid Margin="18">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 菜单贴着标题栏(不留边距),菜单下才是带边距的内容区 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 菜单 -->
|
||||
<Menu Grid.Row="0" Margin="-6,0,0,8" Background="Transparent" BorderThickness="0">
|
||||
<Menu Grid.Row="0" Padding="10,3,0,3" Background="Transparent" BorderThickness="0">
|
||||
<MenuItem Header="工具(_T)">
|
||||
<MenuItem Header="测试查询" Click="FocusQuery_Click" />
|
||||
<Separator />
|
||||
@ -39,42 +39,49 @@
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
|
||||
<!-- ① 标题 + 运行状态 + 当前登录用户 -->
|
||||
<DockPanel Grid.Row="1" Margin="0,0,0,14">
|
||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<TextBlock x:Name="UserText" Text="未登录" Foreground="{StaticResource MutedBrush}"
|
||||
VerticalAlignment="Center" Margin="0,0,10,0" />
|
||||
<Button Content="退出登录" Padding="10,4" Click="Logout_Click" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Ellipse x:Name="StatusDot" Width="10" Height="10" Margin="0,0,8,0"
|
||||
VerticalAlignment="Center" Fill="{StaticResource BadBrush}" />
|
||||
<TextBlock Text="本机服务" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center" />
|
||||
<TextBlock x:Name="StatusText" Text="未启动" Margin="10,0,0,2"
|
||||
Foreground="{StaticResource MutedBrush}" VerticalAlignment="Bottom" />
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
<Grid Grid.Row="1" Margin="18,10,18,18">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- ② 查询测试(占满剩余高度;日志只写文件,界面上不再展示) -->
|
||||
<Border Grid.Row="2" Background="White" BorderBrush="{StaticResource LineBrush}"
|
||||
BorderThickness="1" CornerRadius="8" Padding="12,10">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<DockPanel Grid.Row="0" Margin="0,0,0,10">
|
||||
<Button DockPanel.Dock="Right" Content="查询" Padding="16,5" Margin="8,0,0,0" Click="Query_Click" />
|
||||
<TextBlock Text="测试查询" Foreground="{StaticResource MutedBrush}" VerticalAlignment="Center" Margin="0,0,10,0" />
|
||||
<TextBox x:Name="QueryBox" Padding="6,3" VerticalContentAlignment="Center"
|
||||
ToolTip="输入运单号后回车" KeyDown="QueryBox_KeyDown" />
|
||||
</DockPanel>
|
||||
<TextBox Grid.Row="1" x:Name="ResultBox" IsReadOnly="True"
|
||||
AcceptsReturn="True" AcceptsTab="True" TextWrapping="NoWrap"
|
||||
VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
|
||||
FontFamily="Consolas, Microsoft YaHei UI" FontSize="12" Padding="8"
|
||||
Background="#F9FAFB" BorderBrush="{StaticResource LineBrush}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<!-- ① 标题 + 运行状态 + 当前登录用户 -->
|
||||
<DockPanel Grid.Row="0" Margin="0,0,0,14">
|
||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<TextBlock x:Name="UserText" Text="未登录" Foreground="{StaticResource MutedBrush}"
|
||||
VerticalAlignment="Center" Margin="0,0,10,0" />
|
||||
<Button Content="退出登录" Padding="10,4" Click="Logout_Click" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Ellipse x:Name="StatusDot" Width="10" Height="10" Margin="0,0,8,0"
|
||||
VerticalAlignment="Center" Fill="{StaticResource BadBrush}" />
|
||||
<TextBlock Text="本机服务" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center" />
|
||||
<TextBlock x:Name="StatusText" Text="未启动" Margin="10,0,0,2"
|
||||
Foreground="{StaticResource MutedBrush}" VerticalAlignment="Bottom" />
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
|
||||
<!-- ② 查询测试(占满剩余高度;日志只写文件,界面上不再展示) -->
|
||||
<Border Grid.Row="1" Background="White" BorderBrush="{StaticResource LineBrush}"
|
||||
BorderThickness="1" CornerRadius="8" Padding="12,10">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<DockPanel Grid.Row="0" Margin="0,0,0,10">
|
||||
<Button DockPanel.Dock="Right" Content="查询" Padding="16,5" Margin="8,0,0,0" Click="Query_Click" />
|
||||
<TextBlock Text="测试查询" Foreground="{StaticResource MutedBrush}" VerticalAlignment="Center" Margin="0,0,10,0" />
|
||||
<TextBox x:Name="QueryBox" Padding="6,3" VerticalContentAlignment="Center"
|
||||
ToolTip="输入运单号后回车" KeyDown="QueryBox_KeyDown" />
|
||||
</DockPanel>
|
||||
<TextBox Grid.Row="1" x:Name="ResultBox" IsReadOnly="True"
|
||||
AcceptsReturn="True" AcceptsTab="True" TextWrapping="NoWrap"
|
||||
VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
|
||||
FontFamily="Consolas, Microsoft YaHei UI" FontSize="12" Padding="8"
|
||||
Background="#F9FAFB" BorderBrush="{StaticResource LineBrush}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user