mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-14 20:36:31 +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.PasswordStore;
|
||||||
using KeyKeeper.ViewModels;
|
using KeyKeeper.ViewModels;
|
||||||
|
|
||||||
namespace KeyKeeper.Views;
|
namespace KeyKeeper.Views.Converters;
|
||||||
|
|
||||||
public class TotpCodeConverter : IMultiValueConverter
|
public class TotpCodeConverter : IMultiValueConverter
|
||||||
{
|
{
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
xmlns:vm="using:KeyKeeper.ViewModels"
|
xmlns:vm="using:KeyKeeper.ViewModels"
|
||||||
xmlns:i="using:Avalonia.Interactivity"
|
xmlns:i="using:Avalonia.Interactivity"
|
||||||
xmlns:kkp="using:KeyKeeper.Views"
|
xmlns:kkp="using:KeyKeeper.Views"
|
||||||
|
xmlns:converters="using:KeyKeeper.Views.Converters"
|
||||||
x:Class="KeyKeeper.Views.RepositoryWindow"
|
x:Class="KeyKeeper.Views.RepositoryWindow"
|
||||||
Closing="RepositoryWindow_Closing"
|
Closing="RepositoryWindow_Closing"
|
||||||
Title="KeyKeeper - Password store"
|
Title="KeyKeeper - Password store"
|
||||||
@@ -13,7 +14,8 @@
|
|||||||
x:DataType="vm:RepositoryWindowViewModel">
|
x:DataType="vm:RepositoryWindowViewModel">
|
||||||
|
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<kkp:TotpCodeConverter x:Key="TotpCodeConverter" />
|
<converters:TotpCodeConverter x:Key="TotpCodeConverter" />
|
||||||
|
<converters:StringPresenceToOpacityConverter x:Key="StringPresenceToOpacityConverter" />
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<Window.DataTemplates>
|
<Window.DataTemplates>
|
||||||
@@ -36,8 +38,7 @@
|
|||||||
Padding="8,4"
|
Padding="8,4"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="0,12,0,12"
|
Margin="0,12,0,12"
|
||||||
IsVisible="{Binding $parent[Window].DataContext.LockTimerDisplay,
|
Opacity="{Binding $parent[Window].DataContext.LockTimerDisplay, Converter={StaticResource StringPresenceToOpacityConverter}}">
|
||||||
Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
|
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center">
|
<StackPanel Orientation="Horizontal" Spacing="6" VerticalAlignment="Center">
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user