mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
WIP layout enhancments
MainPage list view now has left indicator (more modern)
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Styles/TextBoxWithButtonStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/HamburgerButtonStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/ListViewLeftIndicatorStyle.xaml" />
|
||||
<ResourceDictionary Source="Styles/NoBorderButtonStyle.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
@@ -54,7 +54,7 @@ namespace ModernKeePass
|
||||
#if DEBUG
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
DebugSettings.EnableFrameRateCounter = true;
|
||||
//DebugSettings.EnableFrameRateCounter = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -249,6 +249,16 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Styles\ListViewLeftIndicatorStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Styles\NoBorderButtonStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Page>
|
||||
<Page Include="Styles\TextBoxWithButtonStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
@@ -30,11 +30,11 @@
|
||||
</TransitionCollection>
|
||||
</Grid.ChildrenTransitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="70"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition x:Name="PrimaryColumn" Width="350" />
|
||||
<ColumnDefinition x:Name="PrimaryColumn" Width="250" />
|
||||
<ColumnDefinition x:Name="SecondaryColumn" Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
@@ -44,14 +44,18 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="BackButton" Margin="39,20,0,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=PageRoot}"
|
||||
Style="{StaticResource NavigationBackButtonNormalStyle}"
|
||||
<Button x:Name="BackButton"
|
||||
Command="{Binding NavigationHelper.GoBackCommand, ElementName=PageRoot}"
|
||||
Visibility="Collapsed"
|
||||
VerticalAlignment="Top"
|
||||
Height="40"
|
||||
VerticalAlignment="Center"
|
||||
AutomationProperties.Name="Back"
|
||||
AutomationProperties.AutomationId="BackButton"
|
||||
AutomationProperties.ItemType="Navigation Button"/>
|
||||
<TextBlock x:Name="TitleTextBox" Text="{Binding Name}" Grid.Column="1" FontSize="24" Margin="20" />
|
||||
AutomationProperties.ItemType="Navigation Button"
|
||||
Style="{StaticResource NoBorderButtonStyle}">
|
||||
<SymbolIcon Symbol="Back" />
|
||||
</Button>
|
||||
<TextBlock x:Name="TitleTextBox" Text="{Binding Name}" Grid.Column="1" FontSize="24" HorizontalAlignment="Center" />
|
||||
</Grid>
|
||||
<controls:ListViewWithDisable
|
||||
Grid.Column="0"
|
||||
@@ -61,21 +65,16 @@
|
||||
Background="{ThemeResource AppBarBackgroundThemeBrush}"
|
||||
ItemsSource="{Binding Source={StaticResource MenuItemsSource}}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
IsSynchronizedWithCurrentItem="False">
|
||||
IsSynchronizedWithCurrentItem="False"
|
||||
ItemContainerStyle="{StaticResource ListViewLeftIndicatorItemExpanded}">
|
||||
<controls:ListViewWithDisable.ItemTemplate>
|
||||
<DataTemplate >
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<SymbolIcon Symbol="{Binding SymbolIcon}" />
|
||||
<TextBlock Text="{Binding Title}" Margin="10,5,0,0" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</controls:ListViewWithDisable.ItemTemplate>
|
||||
<controls:ListViewWithDisable.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="Padding" Value="20,5,0,0" />
|
||||
<Setter Property="Margin" Value="0" />
|
||||
</Style>
|
||||
</controls:ListViewWithDisable.ItemContainerStyle>
|
||||
<controls:ListViewWithDisable.GroupStyle>
|
||||
<GroupStyle HidesIfEmpty="True">
|
||||
<GroupStyle.HeaderTemplate>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using ModernKeePass.ViewModels;
|
||||
|
||||
@@ -30,7 +29,7 @@ namespace ModernKeePass.Pages
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
base.OnNavigatedTo(e);
|
||||
DataContext = new MainVm(Frame, MenuFrame);
|
||||
if (Model.SelectedItem == null) MenuFrame.Navigate(typeof(WelcomePage));
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
</Page.DataContext>
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="80,-60,0,20" FontSize="36">
|
||||
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="60,-50,0,20" FontSize="36">
|
||||
<Run Text="About"/>
|
||||
</TextBlock>
|
||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}">
|
||||
|
@@ -19,7 +19,7 @@
|
||||
</Page.DataContext>
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="80,-60,0,20" FontSize="36">
|
||||
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="60,-50,0,20" FontSize="36">
|
||||
<Run Text="New"></Run>
|
||||
</TextBlock>
|
||||
<HyperlinkButton Content="Create new..." Click="ButtonBase_OnClick" />
|
||||
|
@@ -17,7 +17,7 @@
|
||||
</Page.DataContext>
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="80,-60,0,20" FontSize="36">
|
||||
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="60,-50,0,20" FontSize="36">
|
||||
<Run Text="Open"></Run>
|
||||
</TextBlock>
|
||||
<HyperlinkButton Content="Browse files..." Click="ButtonBase_OnClick" />
|
||||
|
@@ -17,13 +17,14 @@
|
||||
<viewModels:RecentVm/>
|
||||
</Page.DataContext>
|
||||
<StackPanel Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="80,-60,0,20" FontSize="36">
|
||||
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="60,-50,0,20" FontSize="36">
|
||||
<Run Text="Recent"/>
|
||||
</TextBlock>
|
||||
<ListView
|
||||
ItemsSource="{Binding Source={StaticResource RecentItemsSource}}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
Width="600" >
|
||||
Width="600"
|
||||
ItemContainerStyle="{StaticResource ListViewLeftIndicatorItemExpanded}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="10,0,10,0">
|
||||
@@ -39,12 +40,6 @@
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
</ListView>
|
||||
</StackPanel>
|
||||
</Page>
|
@@ -11,7 +11,7 @@
|
||||
</Page.DataContext>
|
||||
|
||||
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="80,-60,0,20" FontSize="36">
|
||||
<TextBlock Style="{StaticResource HeaderTextBlockStyle}" Margin="60,-50,0,20" FontSize="36">
|
||||
<Run Text="Save"></Run>
|
||||
</TextBlock>
|
||||
<HyperlinkButton Content="Save and close" Click="SaveButton_OnClick" />
|
||||
|
401
ModernKeePass/Styles/ListViewLeftIndicatorStyle.xaml
Normal file
401
ModernKeePass/Styles/ListViewLeftIndicatorStyle.xaml
Normal file
@@ -0,0 +1,401 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:core="using:Microsoft.Xaml.Interactions.Core">
|
||||
|
||||
<!-- Style for Windows.UI.Xaml.Controls.ListViewItem with left selection indicator -->
|
||||
<Style TargetType="ListViewItem" x:Key="ListViewLeftIndicatorItemExpanded">
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="TabNavigation" Value="Local"/>
|
||||
<Setter Property="IsHoldingEnabled" Value="True"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="Padding" Value="10,0,0,0"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListViewItem">
|
||||
<Border x:Name="OuterContainer">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal"/>
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="PointerOverBorder"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedEarmark"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewItemSelectedPointerOverBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<PointerDownThemeAnimation TargetName="ContentContainer" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="PointerOverPressed">
|
||||
<Storyboard>
|
||||
<PointerDownThemeAnimation TargetName="ContentContainer" />
|
||||
<DoubleAnimation Storyboard.TargetName="PointerOverBorder"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedEarmark"
|
||||
Storyboard.TargetProperty="Fill">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewItemSelectedPointerOverBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="contentPresenter"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="{ThemeResource ListViewItemDisabledThemeOpacity}" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisual" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused"/>
|
||||
<VisualState x:Name="PointerFocused"/>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="SelectionHintStates">
|
||||
<VisualState x:Name="VerticalSelectionHint">
|
||||
<Storyboard>
|
||||
<SwipeHintThemeAnimation TargetName="ContentBorder" ToVerticalOffset="15" ToHorizontalOffset="0" />
|
||||
<SwipeHintThemeAnimation TargetName="SelectedLeftIndicator" ToVerticalOffset="15" ToHorizontalOffset="0" />
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="HintGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0:0:0.500">
|
||||
<DiscreteDoubleKeyFrame Value="0.5" KeyTime="0:0:0" />
|
||||
<DiscreteDoubleKeyFrame Value="0" KeyTime="0:0:0.500" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="HorizontalSelectionHint">
|
||||
<Storyboard>
|
||||
<SwipeHintThemeAnimation TargetName="ContentBorder" ToHorizontalOffset="-23" ToVerticalOffset="0" />
|
||||
<SwipeHintThemeAnimation TargetName="SelectedLeftIndicator" ToHorizontalOffset="-23" ToVerticalOffset="0" />
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="HintGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0:0:0.500">
|
||||
<DiscreteDoubleKeyFrame Value="0.5" KeyTime="0:0:0" />
|
||||
<DiscreteDoubleKeyFrame Value="0" KeyTime="0:0:0.500" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="NoSelectionHint" />
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition To="NoSelectionHint" GeneratedDuration="0:0:0.65"/>
|
||||
</VisualStateGroup.Transitions>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="SelectionStates">
|
||||
<VisualState x:Name="Unselecting">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="HintGlyphBorder"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unselected">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="HintGlyphBorder"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="UnselectedPointerOver">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="HintGlyphBorder"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewItemSelectedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="UnselectedSwiping">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="SelectingGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="0.5" />
|
||||
<DoubleAnimation Storyboard.TargetName="HintGlyphBorder"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Selecting">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="SelectedLeftIndicator"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
<DoubleAnimation Storyboard.TargetName="SelectingGlyph"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
<DoubleAnimation Storyboard.TargetName="HintGlyphBorder"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewItemSelectedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Selected">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="SelectedLeftIndicator"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewItemSelectedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedSwiping">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="SelectedLeftIndicator"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewItemSelectedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="SelectedUnfocused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="SelectedLeftIndicator"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ListViewItemSelectedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="DragStates">
|
||||
<VisualState x:Name="NotDragging" />
|
||||
<VisualState x:Name="Dragging">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="InnerDragContent"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="{ThemeResource ListViewItemDragThemeOpacity}" />
|
||||
<DragItemThemeAnimation TargetName="InnerDragContent" />
|
||||
<FadeOutThemeAnimation TargetName="SelectedLeftIndicator" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="DraggingTarget">
|
||||
<Storyboard>
|
||||
<DropTargetItemThemeAnimation TargetName="OuterContainer" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="MultipleDraggingPrimary">
|
||||
<Storyboard>
|
||||
<!-- These two Opacity animations are required - the FadeInThemeAnimations
|
||||
on the same elements animate an internal Opacity. -->
|
||||
<DoubleAnimation Storyboard.TargetName="MultiArrangeOverlayBackground"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
<DoubleAnimation Storyboard.TargetName="MultiArrangeOverlayText"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="1" />
|
||||
|
||||
<DoubleAnimation Storyboard.TargetName="ContentBorder"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
Duration="0"
|
||||
To="{ThemeResource ListViewItemDragThemeOpacity}" />
|
||||
<FadeInThemeAnimation TargetName="MultiArrangeOverlayBackground" />
|
||||
<FadeInThemeAnimation TargetName="MultiArrangeOverlayText" />
|
||||
<DragItemThemeAnimation TargetName="ContentBorder" />
|
||||
<FadeOutThemeAnimation TargetName="SelectedLeftIndicator" />
|
||||
<FadeOutThemeAnimation TargetName="PointerOverBorder" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="MultipleDraggingSecondary">
|
||||
<Storyboard>
|
||||
<FadeOutThemeAnimation TargetName="ContentContainer" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition To="NotDragging" GeneratedDuration="0:0:0.2"/>
|
||||
</VisualStateGroup.Transitions>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="ReorderHintStates">
|
||||
<VisualState x:Name="NoReorderHint"/>
|
||||
<VisualState x:Name="BottomReorderHint">
|
||||
<Storyboard>
|
||||
<DragOverThemeAnimation TargetName="ReorderHintContent" ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" Direction="Bottom" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="TopReorderHint">
|
||||
<Storyboard>
|
||||
<DragOverThemeAnimation TargetName="ReorderHintContent" ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" Direction="Top" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="RightReorderHint">
|
||||
<Storyboard>
|
||||
<DragOverThemeAnimation TargetName="ReorderHintContent" ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" Direction="Right" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="LeftReorderHint">
|
||||
<Storyboard>
|
||||
<DragOverThemeAnimation TargetName="ReorderHintContent" ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" Direction="Left" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualStateGroup.Transitions>
|
||||
<VisualTransition To="NoReorderHint" GeneratedDuration="0:0:0.2"/>
|
||||
</VisualStateGroup.Transitions>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="DataVirtualizationStates">
|
||||
<VisualState x:Name="DataAvailable"/>
|
||||
<VisualState x:Name="DataPlaceholder">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextBlock"
|
||||
Storyboard.TargetProperty="Visibility"
|
||||
Duration="0">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Visible</Visibility>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderRect"
|
||||
Storyboard.TargetProperty="Visibility"
|
||||
Duration="0">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Visible</Visibility>
|
||||
</DiscreteObjectKeyFrame.Value>
|
||||
</DiscreteObjectKeyFrame>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid x:Name="ReorderHintContent" Background="Transparent">
|
||||
<Path x:Name="SelectingGlyph" Opacity="0" Data="F1 M133.1,17.9 L137.2,13.2 L144.6,19.6 L156.4,5.8 L161.2,9.9 L145.6,28.4 z" Fill="{ThemeResource ListViewItemCheckSelectingThemeBrush}" Height="13" Stretch="Fill" Width="15" HorizontalAlignment="Right" Margin="0,9.5,9.5,0" VerticalAlignment="Top" FlowDirection="LeftToRight"/>
|
||||
<Border x:Name="HintGlyphBorder"
|
||||
Height="40"
|
||||
Width="40"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Opacity="0"
|
||||
Margin="4">
|
||||
<Path x:Name="HintGlyph" Opacity="0" Data="F1 M133.1,17.9 L137.2,13.2 L144.6,19.6 L156.4,5.8 L161.2,9.9 L145.6,28.4 z" Fill="{ThemeResource ListViewItemCheckHintThemeBrush}" Height="13" Stretch="Fill" Width="15" HorizontalAlignment="Right" Margin="0,5.5,5.5,0" VerticalAlignment="Top" FlowDirection="LeftToRight"/>
|
||||
</Border>
|
||||
<Border x:Name="ContentContainer">
|
||||
<Grid x:Name="InnerDragContent">
|
||||
<Rectangle x:Name="PointerOverBorder"
|
||||
IsHitTestVisible="False"
|
||||
Opacity="0"
|
||||
Fill="{ThemeResource ListViewItemPointerOverBackgroundThemeBrush}"
|
||||
Margin="0" />
|
||||
<Rectangle x:Name="FocusVisual"
|
||||
IsHitTestVisible="False"
|
||||
Opacity="0"
|
||||
StrokeThickness="2"
|
||||
Stroke="{ThemeResource ListViewItemFocusBorderThemeBrush}" />
|
||||
<Rectangle x:Name="SelectionBackground"
|
||||
Margin="0"
|
||||
Fill="{ThemeResource ListViewItemSelectedBackgroundThemeBrush}"
|
||||
Opacity="0" />
|
||||
<Border x:Name="ContentBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Margin="0">
|
||||
<Grid>
|
||||
<ContentPresenter x:Name="contentPresenter"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Content="{TemplateBinding Content}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}" />
|
||||
<!-- The 'Xg' text simulates the amount of space one line of text will occupy.
|
||||
In the DataPlaceholder state, the Content is not loaded yet so we
|
||||
approximate the size of the item using placeholder text. -->
|
||||
<TextBlock x:Name="PlaceholderTextBlock"
|
||||
Opacity="0"
|
||||
Text="Xg"
|
||||
Foreground="{x:Null}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
IsHitTestVisible="False"
|
||||
AutomationProperties.AccessibilityView="Raw"/>
|
||||
<Rectangle x:Name="PlaceholderRect"
|
||||
Visibility="Collapsed"
|
||||
Fill="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}"/>
|
||||
<Rectangle x:Name="MultiArrangeOverlayBackground"
|
||||
IsHitTestVisible="False"
|
||||
Opacity="0"
|
||||
Fill="{ThemeResource ListViewItemDragBackgroundThemeBrush}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border x:Name="SelectedLeftIndicator"
|
||||
BorderBrush="{ThemeResource ListViewItemSelectedBackgroundThemeBrush}"
|
||||
BorderThickness="5,0,0,0"
|
||||
Opacity="0"/>
|
||||
<Rectangle x:Name="SelectedBorder"
|
||||
IsHitTestVisible="False"
|
||||
Opacity="0"
|
||||
Stroke="{ThemeResource ListViewItemSelectedBackgroundThemeBrush}"
|
||||
StrokeThickness="{ThemeResource ListViewItemSelectedBorderThemeThickness}"
|
||||
Margin="0" />
|
||||
<Border x:Name="SelectedCheckMarkOuter"
|
||||
IsHitTestVisible="False"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Margin="4">
|
||||
<Grid x:Name="SelectedCheckMark" Opacity="0" Height="40" Width="40">
|
||||
<Path x:Name="SelectedEarmark" Data="M0,0 L40,0 L40,40 z" Fill="{ThemeResource ListViewItemSelectedBackgroundThemeBrush}" Stretch="Fill"/>
|
||||
<Path Data="F1 M133.1,17.9 L137.2,13.2 L144.6,19.6 L156.4,5.8 L161.2,9.9 L145.6,28.4 z" Fill="{ThemeResource ListViewItemCheckThemeBrush}" Height="13" Stretch="Fill" Width="15" HorizontalAlignment="Right" Margin="0,5.5,5.5,0" VerticalAlignment="Top" FlowDirection="LeftToRight"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<TextBlock x:Name="MultiArrangeOverlayText"
|
||||
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.DragItemsCount}"
|
||||
Foreground="{ThemeResource ListViewItemDragForegroundThemeBrush}"
|
||||
FontFamily="{ThemeResource ContentControlThemeFontFamily}"
|
||||
FontSize="26.667"
|
||||
IsHitTestVisible="False"
|
||||
Opacity="0"
|
||||
TextWrapping="Wrap"
|
||||
TextTrimming="WordEllipsis"
|
||||
Margin="18,9,0,0"
|
||||
AutomationProperties.AccessibilityView="Raw"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
116
ModernKeePass/Styles/NoBorderButtonStyle.xaml
Normal file
116
ModernKeePass/Styles/NoBorderButtonStyle.xaml
Normal file
@@ -0,0 +1,116 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:ModernKeePass.Styles">
|
||||
<!-- Default style for Windows.UI.Xaml.Controls.Button -->
|
||||
<Style TargetType="Button" x:Key="NoBorderButtonStyle">
|
||||
<Setter Property="Background" Value="{ThemeResource ButtonBackgroundThemeBrush}" />
|
||||
<Setter Property="Foreground" Value="{ThemeResource ButtonForegroundThemeBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource ButtonBorderThemeBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}" />
|
||||
<Setter Property="Padding" Value="12,4,12,4" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="PointerOver">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPressedBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
||||
Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonDisabledBackgroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
|
||||
Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonDisabledBorderThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
|
||||
Storyboard.TargetProperty="Foreground">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="FocusStates">
|
||||
<VisualState x:Name="Focused">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
<DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
|
||||
Storyboard.TargetProperty="Opacity"
|
||||
To="1"
|
||||
Duration="0" />
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Unfocused" />
|
||||
<VisualState x:Name="PointerFocused" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Border x:Name="Border"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Margin="0">
|
||||
<ContentPresenter x:Name="ContentPresenter"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
AutomationProperties.AccessibilityView="Raw"/>
|
||||
</Border>
|
||||
<Rectangle x:Name="FocusVisualWhite"
|
||||
IsHitTestVisible="False"
|
||||
Stroke="{ThemeResource FocusVisualWhiteStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="1.5" />
|
||||
<Rectangle x:Name="FocusVisualBlack"
|
||||
IsHitTestVisible="False"
|
||||
Stroke="{ThemeResource FocusVisualBlackStrokeThemeBrush}"
|
||||
StrokeEndLineCap="Square"
|
||||
StrokeDashArray="1,1"
|
||||
Opacity="0"
|
||||
StrokeDashOffset="0.5" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
Reference in New Issue
Block a user