mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-09 09:56:32 +03:00
make timer transparent instead of invisible to avoid disturbing layout
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace KeyKeeper.Views.Converters;
|
||||
|
||||
public class StringPresenceToOpacityConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
return string.IsNullOrEmpty(value as string) ? 0.0 : 1.0;
|
||||
}
|
||||
|
||||
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using Avalonia.Data.Converters;
|
||||
using KeyKeeper.PasswordStore;
|
||||
using KeyKeeper.ViewModels;
|
||||
|
||||
namespace KeyKeeper.Views;
|
||||
namespace KeyKeeper.Views.Converters;
|
||||
|
||||
public class TotpCodeConverter : IMultiValueConverter
|
||||
{
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns:vm="using:KeyKeeper.ViewModels"
|
||||
xmlns:i="using:Avalonia.Interactivity"
|
||||
xmlns:kkp="using:KeyKeeper.Views"
|
||||
xmlns:converters="using:KeyKeeper.Views.Converters"
|
||||
x:Class="KeyKeeper.Views.RepositoryWindow"
|
||||
Closing="RepositoryWindow_Closing"
|
||||
Title="KeyKeeper - Password store"
|
||||
@@ -13,7 +14,8 @@
|
||||
x:DataType="vm:RepositoryWindowViewModel">
|
||||
|
||||
<Window.Resources>
|
||||
<kkp:TotpCodeConverter x:Key="TotpCodeConverter" />
|
||||
<converters:TotpCodeConverter x:Key="TotpCodeConverter" />
|
||||
<converters:StringPresenceToOpacityConverter x:Key="StringPresenceToOpacityConverter" />
|
||||
</Window.Resources>
|
||||
|
||||
<Window.DataTemplates>
|
||||
@@ -36,8 +38,7 @@
|
||||
Padding="8,4"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,12,0,12"
|
||||
IsVisible="{Binding $parent[Window].DataContext.LockTimerDisplay,
|
||||
Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
|
||||
Opacity="{Binding $parent[Window].DataContext.LockTimerDisplay, Converter={StaticResource StringPresenceToOpacityConverter}}">
|
||||
|
||||
<StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user