Skip to content

Commit 462e07a

Browse files
committed
feat: Give a good view of pop windows
fix forground error bug of pop windows.
1 parent 1314452 commit 462e07a

12 files changed

+192
-158
lines changed

Ui/View/Editor/DataSourceSelectorView.xaml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:settings="clr-namespace:_1RM.View.Settings"
76
xmlns:styles="clr-namespace:Shawn.Utils.WpfResources.Theme.Styles;assembly=Shawn.Utils.WpfResources"
87
xmlns:editor="clr-namespace:_1RM.View.Editor"
98
xmlns:model="clr-namespace:_1RM.Service.DataSource.Model"
@@ -15,7 +14,9 @@
1514
AllowsTransparency="True"
1615
d:DataContext="{d:DesignInstance editor:DataSourceSelectorViewModel}">
1716
<Window.Resources>
18-
17+
<Style TargetType="TextBlock" BasedOn="{StaticResource TextBlockBase}">
18+
<Setter Property="Foreground" Value="{StaticResource PrimaryTextBrush}"></Setter>
19+
</Style>
1920
</Window.Resources>
2021

2122
<Border Background="{DynamicResource PrimaryMidBrush}"
@@ -25,7 +26,9 @@
2526
<Grid >
2627
<StackPanel Margin="20 0" >
2728

28-
<TextBlock Text="{DynamicResource 'Please select a Data Source'}" Margin="15" FontSize="20" Height="30" HorizontalAlignment="Center" Foreground="{DynamicResource BackgroundTextBrush}"></TextBlock>
29+
<TextBlock Text="{DynamicResource 'Please select a Data Source'}"
30+
Margin="15" FontSize="20" Height="30"
31+
HorizontalAlignment="Center" ></TextBlock>
2932

3033
<ListBox MaxHeight="400" Width="500"
3134
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
@@ -69,10 +72,25 @@
6972
<ColumnDefinition Width="Auto" SharedSizeGroup="SelectSource3"></ColumnDefinition>
7073
</Grid.ColumnDefinitions>
7174
<Path Height="20" Margin="10 0 0 0" UseLayoutRounding="True" Data="M884.736 22.528c-44.032-38.912-97.28-23.552-149.504 23.552-8.192 7.168-15.36 14.336-23.552 22.528-12.288 13.312-24.576 27.648-35.84 43.008-12.288-5.12-25.6-8.192-39.936-8.192H199.68c-57.344 0-104.448 47.104-104.448 104.448v436.224c0 57.344 47.104 104.448 104.448 104.448h307.2c4.096 20.48 6.144 34.816 6.144 34.816s0 4.096 1.024 9.216c-2.048 38.912-1.024 79.872 2.048 116.736 4.096 49.152 11.264 91.136 21.504 113.664l6.144-3.072c-14.336-44.032-20.48-102.4-17.408-168.96 4.096-102.4 27.648-225.28 70.656-354.304 73.728-194.56 175.104-350.208 269.312-423.936-86.016 76.8-200.704 325.632-235.52 417.792-38.912 103.424-65.536 199.68-82.944 292.864 28.672-87.04 120.832-123.904 120.832-123.904s45.056-55.296 98.304-135.168c-31.744 7.168-82.944 19.456-100.352 26.624-25.6 11.264-32.768 14.336-32.768 14.336S716.8 515.072 788.48 491.52c96.256-154.624 203.776-373.76 96.256-468.992zM512 475.136c10.24 20.48 18.432 47.104 23.552 66.56 1.024 5.12 2.048 10.24 3.072 14.336 2.048 9.216 3.072 16.384 3.072 16.384l-4.096-12.288c-1.024-2.048-1.024-4.096-2.048-6.144 0-1.024-1.024-2.048-1.024-3.072-6.144-13.312-22.528-41.984-29.696-55.296-6.144 18.432-11.264 34.816-16.384 50.176 20.48 37.888 32.768 102.4 32.768 102.4s-1.024-4.096-6.144-18.432c-4.096-13.312-27.648-53.248-32.768-62.464-9.216 33.792-13.312 57.344-9.216 63.488 5.12 8.192 9.216 21.504 14.336 35.84H199.68c-11.264 0-21.504-9.216-21.504-21.504V207.872c0-11.264 9.216-21.504 21.504-21.504H624.64c-53.248 91.136-95.232 199.68-112.64 288.768z" Fill="{DynamicResource PrimaryTextBrush}" Stretch="Uniform"/>
72-
<TextBlock Grid.Column="1" FontSize="16" Text="{Binding DataSourceName}" ToolTip="{Binding DataSourceName}" Margin="5 0" Foreground="{DynamicResource BackgroundTextBrush}" VerticalAlignment="Center"></TextBlock>
75+
<TextBlock Grid.Column="1" FontSize="16"
76+
Text="{Binding DataSourceName}"
77+
ToolTip="{Binding DataSourceName}"
78+
Margin="5 0"
79+
VerticalAlignment="Center"></TextBlock>
7380
<StackPanel Grid.Column="2" Orientation="Horizontal">
74-
<TextBlock FontSize="16" Text="(Readonly)" Margin="0 0 5 0" Visibility="{Binding IsWritable, Converter={StaticResource ConverterBool2VisibleInv}}" Foreground="{DynamicResource AccentTextBrush}" Background="{DynamicResource AccentMidBrush}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"></TextBlock>
75-
<TextBlock FontSize="16" Text="{Binding Description}" ToolTip="{Binding Description}" Margin="5 0 10 0" Foreground="{DynamicResource BackgroundTextBrush}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"></TextBlock>
81+
<TextBlock FontSize="16"
82+
Text="(Readonly)"
83+
Margin="0 0 5 0"
84+
Visibility="{Binding IsWritable, Converter={StaticResource ConverterBool2VisibleInv}}"
85+
Foreground="{DynamicResource AccentTextBrush}"
86+
Background="{DynamicResource AccentMidBrush}"
87+
VerticalAlignment="Center"
88+
TextTrimming="CharacterEllipsis"></TextBlock>
89+
<TextBlock FontSize="16" Text="{Binding Description}"
90+
ToolTip="{Binding Description}"
91+
Margin="5 0 10 0"
92+
VerticalAlignment="Center"
93+
TextTrimming="CharacterEllipsis"></TextBlock>
7694
</StackPanel>
7795
</Grid>
7896
<!--<Grid Width="30" Background="{DynamicResource PrimaryMidBrush}" HorizontalAlignment="Right"></Grid>-->

Ui/View/Editor/Forms/AlternativeCredential/AlternativeCredentialEditView.xaml

Lines changed: 61 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -16,79 +16,83 @@
1616
Background="Transparent"
1717
AllowsTransparency="True"
1818
d:DataContext="{d:DesignInstance alternativeCredential:AlternativeCredentialEditViewModel}">
19+
<Window.Resources>
20+
<Style TargetType="TextBlock">
21+
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"></Setter>
22+
<Setter Property="VerticalAlignment" Value="Center"></Setter>
23+
<Setter Property="HorizontalAlignment" Value="Right"></Setter>
24+
<Setter Property="TextAlignment" Value="Right"></Setter>
25+
<Setter Property="TextWrapping" Value="Wrap"></Setter>
26+
<Setter Property="Margin" Value="20 5 10 15"></Setter>
27+
</Style>
28+
<Style TargetType="TextBox" BasedOn="{StaticResource TextBoxAccentStyle}">
29+
<Setter Property="Margin" Value="0 5 0 15"></Setter>
30+
</Style>
31+
<Style TargetType="PasswordBox" BasedOn="{StaticResource PasswordBoxAccentStyle}">
32+
<Setter Property="Margin" Value="0 5 0 15"></Setter>
33+
</Style>
34+
</Window.Resources>
1935

2036
<Border Background="{DynamicResource PrimaryMidBrush}"
2137
BorderBrush="{DynamicResource PrimaryLightBrush}"
22-
BorderThickness="1" CornerRadius="{StaticResource DefaultCornerRadius}" ClipToBounds="True">
38+
BorderThickness="1"
39+
CornerRadius="{StaticResource DefaultCornerRadius}"
40+
ClipToBounds="True">
2341
<Grid IsSharedSizeScope="True">
24-
<Grid>
2542

26-
<StackPanel Margin="0 0 20 0">
27-
<TextBlock Style="{StaticResource EditorGroupTextBlockTitle}" Text="{DynamicResource Connection}"></TextBlock>
28-
29-
<Grid Style="{StaticResource EditorRowGrid}">
30-
<StackPanel Orientation="Horizontal">
31-
<TextBlock Style="{StaticResource EditorRowGridTitle}" Text="{DynamicResource Name}"></TextBlock>
32-
<Grid Style="{StaticResource EditorRowGridInput}">
33-
<TextBox Name="TbName"
34-
Text="{Binding Name,
35-
ValidatesOnExceptions=True,
36-
UpdateSourceTrigger=PropertyChanged}"></TextBox>
37-
<TextBlock FontSize="12" Margin="0" Foreground="Red" Text="{Binding (Validation.Errors)/ErrorContent, ElementName=TbName}" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
38-
</Grid>
39-
</StackPanel>
40-
</Grid>
43+
<StackPanel Margin="20 0">
44+
<TextBlock Text="{DynamicResource Connection}" Margin="15" FontSize="20" Height="30" HorizontalAlignment="Left"></TextBlock>
4145

46+
<Grid>
47+
<Grid.RowDefinitions>
48+
<RowDefinition></RowDefinition>
49+
<RowDefinition></RowDefinition>
50+
<RowDefinition></RowDefinition>
51+
<RowDefinition></RowDefinition>
52+
<RowDefinition></RowDefinition>
53+
<RowDefinition></RowDefinition>
54+
<RowDefinition></RowDefinition>
55+
<RowDefinition></RowDefinition>
56+
<RowDefinition></RowDefinition>
57+
</Grid.RowDefinitions>
58+
<Grid.ColumnDefinitions>
59+
<ColumnDefinition Width="Auto"></ColumnDefinition>
60+
<ColumnDefinition Width="280"></ColumnDefinition>
61+
<ColumnDefinition Width="Auto"></ColumnDefinition>
62+
</Grid.ColumnDefinitions>
4263

43-
<Grid Style="{StaticResource EditorRowGrid}">
44-
<StackPanel Orientation="Horizontal">
45-
<TextBlock Style="{StaticResource EditorRowGridTitle}" Text="{DynamicResource Hostname}"></TextBlock>
46-
<Grid Style="{StaticResource EditorRowGridInput}">
47-
<TextBox Text="{Binding New.Address, UpdateSourceTrigger=PropertyChanged}"
48-
Tag="TXT: leave empty to inherited the default value"
49-
></TextBox>
50-
</Grid>
51-
<TextBlock Style="{StaticResource EditorRowGridTitle}" Width="60" Text="{DynamicResource Port}"></TextBlock>
52-
<Grid Style="{StaticResource EditorRowGridInput}" Width="Auto">
53-
<TextBox Text="{Binding Port, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
54-
MinWidth="50" HorizontalAlignment="Left"
55-
InputMethod.IsInputMethodEnabled="False"
56-
InputScope="Number"></TextBox>
57-
</Grid>
58-
</StackPanel>
64+
<TextBlock Grid.Row="0" Grid.Column="0" Text="{DynamicResource Name}"></TextBlock>
65+
<Grid Grid.Row="0" Grid.Column="1">
66+
<TextBox Name="TbName" Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}"/>
67+
<TextBlock FontSize="12" Margin="0" Foreground="Red" Text="{Binding (Validation.Errors)/ErrorContent, ElementName=TbName}" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
5968
</Grid>
6069

70+
<TextBlock Grid.Row="1" Grid.Column="0" Text="{DynamicResource Hostname}"></TextBlock>
71+
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding New.Address, UpdateSourceTrigger=PropertyChanged}"
72+
Tag="TXT: leave empty to inherited the default value..................................................."/>
6173

6274

75+
<TextBlock Grid.Row="2" Grid.Column="0" Text="{DynamicResource Port}"></TextBlock>
76+
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Port, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
77+
InputMethod.IsInputMethodEnabled="False" InputScope="Number"
78+
Tag="TXT: leave empty to inherited the default value"></TextBox>
6379

64-
<Grid Style="{StaticResource EditorRowGrid}">
65-
<StackPanel Orientation="Horizontal">
66-
<TextBlock Style="{StaticResource EditorRowGridTitle}" Text="{DynamicResource User}"></TextBlock>
67-
<Grid Style="{StaticResource EditorRowGridInput}">
68-
<TextBox Text="{Binding New.UserName, UpdateSourceTrigger=PropertyChanged}"></TextBox>
69-
</Grid>
70-
</StackPanel>
71-
</Grid>
72-
73-
74-
75-
<Grid Style="{StaticResource EditorRowGrid}">
76-
<StackPanel Orientation="Horizontal">
77-
<TextBlock Style="{StaticResource EditorRowGridTitle}" Text="{DynamicResource Password}"></TextBlock>
78-
<Grid Style="{StaticResource EditorRowGridInput}">
79-
<PasswordBox attachProperty:PasswordBoxAttachProperty.Password="{Binding New.Password, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
80-
</Grid>
81-
</StackPanel>
82-
</Grid>
80+
<TextBlock Grid.Row="6" Grid.Column="0" Text="{DynamicResource User}"></TextBlock>
81+
<TextBox Grid.Row="6" Grid.Column="1" Text="{Binding New.UserName, UpdateSourceTrigger=PropertyChanged}"
82+
Tag="TXT: leave empty to inherited the default value"/>
8383

84+
<TextBlock Grid.Row="7" Grid.Column="0" Text="{DynamicResource Password}"></TextBlock>
85+
<PasswordBox Grid.Row="7" Grid.Column="1"
86+
Tag="TXT: leave empty to inherited the default value................."
87+
attachProperty:PasswordBoxAttachProperty.Password="{Binding New.Password, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
88+
</Grid>
8489

8590

86-
<StackPanel Margin="0 0 0 20" Orientation="Horizontal" HorizontalAlignment="Center">
87-
<Button Command="{Binding CmdSave}" Content="{DynamicResource Save}" Width="100" Margin="10 0"></Button>
88-
<Button Command="{Binding CmdCancel}" Content="{DynamicResource Cancel}" Width="100" Margin="10 0"></Button>
89-
</StackPanel>
91+
<StackPanel Margin="0 0 0 20" Orientation="Horizontal" HorizontalAlignment="Center">
92+
<Button Command="{Binding CmdSave}" Content="{DynamicResource Save}" Width="100" Margin="10 0"></Button>
93+
<Button Command="{Binding CmdCancel}" Content="{DynamicResource Cancel}" Width="100" Margin="10 0"></Button>
9094
</StackPanel>
91-
</Grid>
95+
</StackPanel>
9296
</Grid>
9397
</Border>
9498
</styles:WindowChromeBase>

Ui/View/Editor/Forms/RdpForm.xaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
<StackPanel Orientation="Horizontal">
6262
<TextBlock Style="{StaticResource EditorRowGridTitle}" Text="{DynamicResource Password}"></TextBlock>
6363
<Grid Style="{StaticResource EditorRowGridInput}">
64-
<PasswordBox attachProperty:PasswordBoxAttachProperty.Password="{Binding Password, UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"/>
64+
<PasswordBox Tag="asdaaaaasdaaasdaaaaasdaaasdaaaaasdaaasdaaaaasdaaasdaaaaasdaaasdaaaaasdaaasdaaaaasdaaasdaaaaasdaaasdaaaaasdaaasdaaaaasdaa"
65+
attachProperty:PasswordBoxAttachProperty.Password="{Binding Password, UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"/>
6566
</Grid>
6667
</StackPanel>
6768
</Grid>
@@ -89,10 +90,6 @@
8990
</Grid.Resources>
9091

9192
<StackPanel>
92-
<Button Command="{Binding Path=DataContext.CmdEditCredential, RelativeSource={RelativeSource AncestorType={x:Type editor:ServerEditorPageView}}}"
93-
HorizontalAlignment="Right"
94-
Margin="0 0 5 0"
95-
>Add</Button>
9693
<DataGrid AutoGenerateColumns="False"
9794
HorizontalAlignment="Stretch"
9895
HorizontalContentAlignment="Stretch"
@@ -135,6 +132,17 @@
135132
</DataGrid.Columns>
136133
</DataGrid>
137134

135+
<Button Command="{Binding Path=DataContext.CmdEditCredential, RelativeSource={RelativeSource AncestorType={x:Type editor:ServerEditorPageView}}}"
136+
Style="{StaticResource ButtonBarTransparentStyle}"
137+
Margin="0 0 5 0"
138+
>
139+
<Grid Height="15" Width="15">
140+
<Path Data="M 41.888 18.304 L 41.888 23.584 L 23.584 23.584 L 23.584 41.888 L 18.304 41.888 L 18.304 23.584 L 0 23.584 L 0 18.304 L 18.304 18.304 L 18.304 0 L 23.584 0 L 23.584 18.304 Z"
141+
Stroke="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
142+
Fill="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
143+
StrokeThickness="2" Stretch="Uniform" />
144+
</Grid>
145+
</Button>
138146
</StackPanel>
139147

140148
</Grid>

Ui/View/Editor/PasswordPopupDialogView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</WindowChrome.WindowChrome>
2323
<Window.Resources>
2424
<Style TargetType="TextBlock">
25-
<Setter Property="Foreground" Value="{DynamicResource BackgroundTextBrush}"></Setter>
25+
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"></Setter>
2626
<Setter Property="MinWidth" Value="50"></Setter>
2727
<Setter Property="VerticalAlignment" Value="Center"></Setter>
2828
<Setter Property="HorizontalAlignment" Value="Right"></Setter>

0 commit comments

Comments
 (0)