mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-09 11:51:59 -04:00
Blur the token in GUI when the control is out of focus
This commit is contained in:
parent
3319b4734d
commit
d779ed9bc8
2 changed files with 24 additions and 1 deletions
|
@ -38,6 +38,8 @@ public class DashboardViewModel : PropertyChangedBase
|
|||
|
||||
public string? Token { get; set; }
|
||||
|
||||
public bool IsTokenSet => !string.IsNullOrWhiteSpace(Token);
|
||||
|
||||
private IReadOnlyDictionary<Guild, IReadOnlyList<Channel>>? ChannelsByGuild { get; set; }
|
||||
|
||||
public IReadOnlyList<Guild>? AvailableGuilds => ChannelsByGuild?.Keys.ToArray();
|
||||
|
|
|
@ -85,7 +85,28 @@
|
|||
materialDesign:TextFieldAssist.TextBoxViewMargin="0,0,2,0"
|
||||
BorderThickness="0"
|
||||
FontSize="16"
|
||||
Text="{Binding Token, UpdateSourceTrigger=PropertyChanged}" />
|
||||
Text="{Binding Token, UpdateSourceTrigger=PropertyChanged}">
|
||||
<TextBox.Style>
|
||||
<Style BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type TextBox}">
|
||||
<Style.Triggers>
|
||||
<!-- Blur the token when it's out of focus -->
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType=materialDesign:Card}}" Value="False" />
|
||||
<Condition Binding="{Binding IsFocused, RelativeSource={RelativeSource Self}}" Value="False" />
|
||||
<!-- Don't blur if the token is not set, so the user can see the hint text -->
|
||||
<Condition Binding="{Binding IsTokenSet}" Value="True" />
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<BlurEffect Radius="12" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</MultiDataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBox.Style>
|
||||
</TextBox>
|
||||
|
||||
<!-- Pull data button -->
|
||||
<Button
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue