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