|
20 | 20 | <converters:MqttStatusTextConverter x:Key="MqttStatusText" /> |
21 | 21 | <converters:BoolToEyeIconConverter x:Key="BoolToEyeIcon" /> |
22 | 22 | <converters:StringToVisibilityConverter x:Key="StringToVisibility" /> |
23 | | - <converters:StyleToBorderBrushConverter x:Key="StyleToBorderBrush" /> |
24 | | - <converters:StyleToBackgroundConverter x:Key="StyleToBackground" /> |
25 | 23 | <converters:InvertedBoolConverter x:Key="InvertedBool" /> |
26 | | - <converters:IsActiveStyleConverter x:Key="IsActiveStyle" /> |
| 24 | + <converters:ActiveStyleToBorderBrushConverter x:Key="ActiveStyleToBorderBrush" /> |
| 25 | + <converters:ActiveStyleToBackgroundConverter x:Key="ActiveStyleToBackground" /> |
27 | 26 | <converters:StyleDescriptionConverter x:Key="StyleDescription" /> |
28 | 27 | </Window.Resources> |
29 | 28 |
|
|
79 | 78 | <StackPanel Spacing="10"> |
80 | 79 | <TextBlock FontWeight="SemiBold" FontSize="13">MQTT Broker</TextBlock> |
81 | 80 |
|
82 | | - <StackPanel Orientation="Horizontal" Spacing="8"> |
83 | | - <TextBlock Text="Host:" Width="72" VerticalAlignment="Center" /> |
84 | | - <TextBox Text="{Binding MqttBrokerUrl}" |
| 81 | + <Grid ColumnDefinitions="80, *"> |
| 82 | + <TextBlock Text="Host:" VerticalAlignment="Center" /> |
| 83 | + <TextBox Grid.Column="1" Text="{Binding MqttBrokerUrl}" |
85 | 84 | PlaceholderText="e.g. 192.168.1.100" |
86 | | - HorizontalAlignment="Stretch" |
87 | | - MinWidth="200" /> |
88 | | - </StackPanel> |
| 85 | + HorizontalAlignment="Stretch" /> |
| 86 | + </Grid> |
89 | 87 |
|
90 | | - <StackPanel Orientation="Horizontal" Spacing="8"> |
91 | | - <TextBlock Text="Port:" Width="72" VerticalAlignment="Center" /> |
92 | | - <TextBox Text="{Binding MqttBrokerPort}" |
| 88 | + <Grid ColumnDefinitions="80, *, Auto"> |
| 89 | + <TextBlock Text="Port:" VerticalAlignment="Center" /> |
| 90 | + <TextBox Grid.Column="1" Text="{Binding MqttBrokerPort}" |
93 | 91 | PlaceholderText="1883" |
94 | 92 | HorizontalAlignment="Stretch" /> |
95 | | - <CheckBox Content="Use TLS/SSL" |
| 93 | + <CheckBox Grid.Column="2" Content="Use TLS/SSL" |
96 | 94 | IsChecked="{Binding MqttUseTls}" |
97 | 95 | Margin="12,0,0,0" |
98 | 96 | VerticalAlignment="Center" /> |
99 | | - </StackPanel> |
| 97 | + </Grid> |
100 | 98 |
|
101 | | - <StackPanel Orientation="Horizontal" Spacing="8"> |
102 | | - <TextBlock Text="Client ID:" Width="72" VerticalAlignment="Center" /> |
103 | | - <TextBox Text="{Binding MqttClientId}" |
| 99 | + <Grid ColumnDefinitions="80, *"> |
| 100 | + <TextBlock Text="Client ID:" VerticalAlignment="Center" /> |
| 101 | + <TextBox Grid.Column="1" Text="{Binding MqttClientId}" |
104 | 102 | PlaceholderText="leave empty for auto-generated" |
105 | 103 | HorizontalAlignment="Stretch" /> |
106 | | - </StackPanel> |
| 104 | + </Grid> |
107 | 105 | </StackPanel> |
108 | 106 | </Border> |
109 | 107 |
|
|
118 | 116 | <StackPanel Spacing="8" |
119 | 117 | Margin="24,0,0,0" |
120 | 118 | IsVisible="{Binding UseAuthentication, Converter={StaticResource BoolToIsVisible}}"> |
121 | | - <StackPanel Orientation="Horizontal" Spacing="8"> |
122 | | - <TextBlock Text="Username:" Width="72" VerticalAlignment="Center" /> |
123 | | - <TextBox Text="{Binding MqttUsername}" |
| 119 | + <Grid ColumnDefinitions="80, *"> |
| 120 | + <TextBlock Text="Username:" VerticalAlignment="Center" /> |
| 121 | + <TextBox Grid.Column="1" Text="{Binding MqttUsername}" |
124 | 122 | PlaceholderText="MQTT username" |
125 | 123 | HorizontalAlignment="Stretch" /> |
126 | | - </StackPanel> |
| 124 | + </Grid> |
127 | 125 |
|
128 | | - <StackPanel Orientation="Horizontal" Spacing="8"> |
129 | | - <TextBlock Text="Password:" Width="72" VerticalAlignment="Center" /> |
130 | | - <TextBox Text="{Binding MqttPassword}" |
| 126 | + <Grid ColumnDefinitions="80, *, Auto"> |
| 127 | + <TextBlock Text="Password:" VerticalAlignment="Center" /> |
| 128 | + <TextBox Grid.Column="1" Text="{Binding MqttPassword}" |
| 129 | + PasswordChar="*" |
| 130 | + RevealPassword="{Binding ShowPassword}" |
131 | 131 | PlaceholderText="MQTT password" |
132 | 132 | HorizontalAlignment="Stretch" /> |
133 | | - <Button |
| 133 | + <Button Grid.Column="2" |
134 | 134 | Content="{Binding ShowPassword, Converter={StaticResource BoolToEyeIcon}}" |
135 | 135 | Width="56" |
| 136 | + Margin="8,0,0,0" |
136 | 137 | Command="{Binding ToggleShowPasswordCommand}" |
137 | 138 | HorizontalContentAlignment="Center" /> |
138 | | - </StackPanel> |
| 139 | + </Grid> |
139 | 140 | </StackPanel> |
140 | 141 | </StackPanel> |
141 | 142 | </Border> |
|
433 | 434 | <ItemsControl.ItemTemplate> |
434 | 435 | <DataTemplate> |
435 | 436 | <Border Padding="8" CornerRadius="4" Transitions="{}" |
436 | | - BorderThickness="1" |
437 | | - BorderBrush="{Binding Converter={StaticResource IsActiveStyle}, ConverterParameter={Binding $parent[Window].DataContext.ActiveStyle}, Converter={StaticResource StyleToBorderBrush}}" |
438 | | - Background="{Binding Converter={StaticResource IsActiveStyle}, ConverterParameter={Binding $parent[Window].DataContext.ActiveStyle}, Converter={StaticResource StyleToBackground}}"> |
| 437 | + BorderThickness="1"> |
| 438 | + <Border.BorderBrush> |
| 439 | + <MultiBinding Converter="{StaticResource ActiveStyleToBorderBrush}"> |
| 440 | + <Binding /> |
| 441 | + <Binding Path="$parent[Window].DataContext.ActiveStyle" /> |
| 442 | + </MultiBinding> |
| 443 | + </Border.BorderBrush> |
| 444 | + <Border.Background> |
| 445 | + <MultiBinding Converter="{StaticResource ActiveStyleToBackground}"> |
| 446 | + <Binding /> |
| 447 | + <Binding Path="$parent[Window].DataContext.ActiveStyle" /> |
| 448 | + </MultiBinding> |
| 449 | + </Border.Background> |
439 | 450 | <Button Padding="8" Background="Transparent" BorderThickness="0" |
440 | 451 | HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" |
441 | 452 | Transitions="{}" |
442 | 453 | Command="{Binding $parent[Window].DataContext.SelectStyleCommand}" |
443 | 454 | CommandParameter="{Binding}"> |
444 | 455 | <StackPanel> |
445 | 456 | <TextBlock FontWeight="SemiBold" FontSize="13" |
446 | | - Text="{Binding ToString}" /> |
| 457 | + Text="{Binding}" /> |
447 | 458 | <TextBlock FontSize="12" Foreground="Gray" |
448 | 459 | Text="{Binding Converter={StaticResource StyleDescription}}" /> |
449 | 460 | </StackPanel> |
|
594 | 605 | <TextBlock DockPanel.Dock="Right" FontSize="11" Width="36" |
595 | 606 | TextAlignment="Right" VerticalAlignment="Center"> |
596 | 607 | <TextBlock.Text> |
597 | | - <Binding Path="BypassCoefficient" /> |
| 608 | + <Binding Path="BypassCoefficient" StringFormat="{}{0}" /> |
598 | 609 | </TextBlock.Text> |
599 | 610 | </TextBlock> |
600 | 611 | <TextBlock DockPanel.Dock="Left" Text="Bypass Speed (frames):" |
|
0 commit comments