ux: another way to fix transparent background of popup panel on Linux

This commit is contained in:
leo 2024-06-14 09:44:44 +08:00
parent 76bb93518a
commit 1dffb2ebf5
No known key found for this signature in database
GPG key ID: B528468E49CD0E58
4 changed files with 97 additions and 85 deletions

View file

@ -110,13 +110,12 @@
Cursor="BottomRightCorner"
Tag="{x:Static WindowEdge.SouthEast}"/>
<Grid Margin="{TemplateBinding Padding}" Effect="drop-shadow(0 0 12 #A0000000)">
<Border x:Name="PART_ContentRoot"
Background="{DynamicResource Brush.Window}"
BorderBrush="{DynamicResource Brush.Border0}"
BorderThickness="1"
Margin="{TemplateBinding Padding}"
CornerRadius="8"
Effect="drop-shadow(0 0 12 #A0000000)"
ClipToBounds="True">
<VisualLayerManager>
<ContentPresenter Name="PART_ContentPresenter"
@ -127,6 +126,7 @@
</VisualLayerManager>
</Border>
</Grid>
</Grid>
</ControlTemplate>
</Setter>
</Style>

View file

@ -10,46 +10,71 @@
<StackPanel Orientation="Vertical" Margin="8,0,0,0">
<TextBlock Classes="bold" FontSize="18" Text="{DynamicResource Text.Clone}"/>
<Grid Margin="8,16,0,0" Height="28" ColumnDefinitions="140,*">
<TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.Clone.RemoteURL}"/>
<TextBox Grid.Column="1" CornerRadius="3" Text="{Binding Remote, Mode=TwoWay}" v:AutoFocusBehaviour.IsEnabled="True"/>
</Grid>
<Grid Margin="8,4,0,0" Height="28" ColumnDefinitions="140,*" IsVisible="{Binding UseSSH}">
<TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.SSHKey}"/>
<TextBox Grid.Column="1"
<Grid Margin="8,16,0,0" RowDefinitions="32,Auto,32,32,32" ColumnDefinitions="Auto,*">
<TextBlock Grid.Row="0" Grid.Column="0"
HorizontalAlignment="Right"
Margin="0,0,8,0"
Text="{DynamicResource Text.Clone.RemoteURL}"/>
<TextBox Grid.Row="0" Grid.Column="1"
Height="28"
CornerRadius="3"
Text="{Binding Remote, Mode=TwoWay}"
v:AutoFocusBehaviour.IsEnabled="True"/>
<TextBlock Grid.Row="1" Grid.Column="0"
HorizontalAlignment="Right"
Margin="0,0,8,0"
Text="{DynamicResource Text.SSHKey}"
IsVisible="{Binding UseSSH}"/>
<TextBox Grid.Row="1" Grid.Column="1"
x:Name="TxtSshKey"
Height="28"
CornerRadius="3"
Watermark="{DynamicResource Text.SSHKey.Placeholder}"
Text="{Binding SSHKey, Mode=TwoWay}">
Text="{Binding SSHKey, Mode=TwoWay}"
IsVisible="{Binding UseSSH}">
<TextBox.InnerRightContent>
<Button Classes="icon_button" Width="30" Height="30" Click="SelectSSHKey">
<Button Classes="icon_button" Width="28" Height="28" Click="SelectSSHKey">
<Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Button>
</TextBox.InnerRightContent>
</TextBox>
</Grid>
<Grid Margin="8,4,0,0" Height="28" ColumnDefinitions="140,*">
<TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.Clone.ParentFolder}"/>
<TextBox Grid.Column="1"
<TextBlock Grid.Row="2" Grid.Column="0"
HorizontalAlignment="Right"
Margin="0,0,8,0"
Text="{DynamicResource Text.Clone.ParentFolder}"/>
<TextBox Grid.Row="2" Grid.Column="1"
x:Name="TxtParentFolder"
Height="28"
CornerRadius="3"
Text="{Binding ParentFolder, Mode=TwoWay}">
<TextBox.InnerRightContent>
<Button Classes="icon_button" Width="30" Height="30" Margin="4,0,0,0" Click="SelectParentFolder">
<Button Classes="icon_button" Width="28" Height="28" Margin="4,0,0,0" Click="SelectParentFolder">
<Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Button>
</TextBox.InnerRightContent>
</TextBox>
</Grid>
<Grid Margin="8,4,0,0" Height="28" ColumnDefinitions="140,*">
<TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.Clone.LocalName}"/>
<TextBox Grid.Column="1" CornerRadius="3" Watermark="{DynamicResource Text.Clone.LocalName.Placeholder}" Text="{Binding Local, Mode=TwoWay}"/>
</Grid>
<Grid Margin="8,4,0,0" Height="28" ColumnDefinitions="140,*">
<TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.Clone.AdditionalParam}"/>
<TextBox Grid.Column="1" CornerRadius="3" Watermark="{DynamicResource Text.Clone.AdditionalParam.Placeholder}" Text="{Binding ExtraArgs, Mode=TwoWay}"/>
<TextBlock Grid.Row="3" Grid.Column="0"
HorizontalAlignment="Right"
Margin="0,0,8,0"
Text="{DynamicResource Text.Clone.LocalName}"/>
<TextBox Grid.Row="3" Grid.Column="1"
Height="28"
CornerRadius="3"
Watermark="{DynamicResource Text.Clone.LocalName.Placeholder}"
Text="{Binding Local, Mode=TwoWay}"/>
<TextBlock Grid.Row="4" Grid.Column="0"
HorizontalAlignment="Right"
Margin="0,0,8,0"
Text="{DynamicResource Text.Clone.AdditionalParam}"/>
<TextBox Grid.Row="4" Grid.Column="1"
Height="28"
CornerRadius="3"
Watermark="{DynamicResource Text.Clone.AdditionalParam.Placeholder}"
Text="{Binding ExtraArgs, Mode=TwoWay}"/>
</Grid>
</StackPanel>
</UserControl>

View file

@ -250,33 +250,21 @@
</ContentControl>
<!-- Popup container -->
<Grid Grid.Row="1" Margin="0,36,0,0" IsVisible="{Binding ActivePage.Popup, Converter={x:Static ObjectConverters.IsNotNull}}">
<Grid Grid.Row="1" Margin="0,36,0,0" IsVisible="{Binding ActivePage.Popup, Converter={x:Static ObjectConverters.IsNotNull}}" ClipToBounds="True">
<Border Background="Transparent" PointerPressed="OnPopupCancelByClickMask"/>
<Grid Width="500" HorizontalAlignment="Center" VerticalAlignment="Top">
<ContentControl Content="{Binding ActivePage.Popup}" ClipToBounds="True">
<Border Width="500" HorizontalAlignment="Center" VerticalAlignment="Top" Effect="drop-shadow(0 0 8 #8F000000)" CornerRadius="0,0,4,4" ClipToBounds="True">
<ContentControl Content="{Binding ActivePage.Popup}" Background="{DynamicResource Brush.Popup}">
<ContentControl.DataTemplates>
<DataTemplate DataType="vm:Popup">
<Border Margin="8,0,8,8"
Background="{DynamicResource Brush.Popup}"
BorderBrush="{DynamicResource Brush.Border0}"
CornerRadius="0,0,4,4">
<Border.BorderThickness>
<OnPlatform Default="0" Linux="1,0,1,1"/>
</Border.BorderThickness>
<Border.Effect>
<OnPlatform Default="drop-shadow(0 0 8 #8F000000)" Linux="{x:Null}"/>
</Border.Effect>
<StackPanel Margin="8" Orientation="Vertical">
<StackPanel Orientation="Vertical" Background="{DynamicResource Brush.Popup}">
<!-- Popup Widget -->
<ContentPresenter Margin="0,8"
<ContentPresenter Margin="8,16,8,8"
Content="{Binding View}"
IsHitTestVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}"/>
<!-- Options -->
<StackPanel Margin="0,8,0,0"
<StackPanel Margin="8,4,8,8"
Height="32"
Orientation="Horizontal"
HorizontalAlignment="Right"
@ -294,15 +282,14 @@
</StackPanel>
<!-- Running -->
<v:PopupRunningStatus Margin="8"
<v:PopupRunningStatus Margin="12,8"
Description="{Binding ProgressDescription}"
IsVisible="{Binding InProgress}"/>
</StackPanel>
</Border>
</DataTemplate>
</ContentControl.DataTemplates>
</ContentControl>
</Grid>
</Border>
</Grid>
<!-- Notification container -->

View file

@ -8,7 +8,7 @@
x:Class="SourceGit.Views.PopupRunningStatus"
x:Name="me">
<StackPanel Orientation="Vertical">
<Rectangle Height="1" Margin="-8,0" HorizontalAlignment="Stretch" Fill="{DynamicResource Brush.Border1}" />
<Rectangle Height="1" HorizontalAlignment="Stretch" Fill="{DynamicResource Brush.Border1}" />
<StackPanel Orientation="Horizontal" Margin="0,8">
<ContentPresenter x:Name="icon" Width="12" Height="12"/>