Skip to content

Commit

Permalink
Remove ripple animation from Material themes, fixes #484
Browse files Browse the repository at this point in the history
  • Loading branch information
bcssov committed Jan 28, 2024
1 parent 5094d15 commit b4ee19f
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 0 deletions.
72 changes: 72 additions & 0 deletions src/IronyModManager/Controls/Themes/MaterialDark/ListBoxItem.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Material.Styles.Converters;assembly=Material.Styles"
xmlns:animations="clr-namespace:Material.Styles.Additional.Animations;assembly=Material.Styles"
xmlns:ripple="clr-namespace:Material.Ripple;assembly=Material.Ripple;assembly=Material.Styles">

<Style Selector="ListBoxItem">
<Setter Property="Foreground" Value="{TemplateBinding Foreground}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Padding" Value="8" />
<Setter Property="Template">
<ControlTemplate>
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Margin="{TemplateBinding Margin}"
ClipToBounds="{TemplateBinding ClipToBounds}">
<Grid>
<Border Name="selectedBorder"
Background="{TemplateBinding Foreground}"/>
<Border Name="pointerOverBorder"
Background="{TemplateBinding Foreground}"/>
<!--<ripple:RippleEffect Name="Ripple"
RippleFill="{TemplateBinding Foreground}"
Focusable="False"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Padding="{TemplateBinding Padding}">-->
<ContentPresenter Name="PART_ContentPresenter"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Padding="{TemplateBinding Padding}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
<!--</ripple:RippleEffect>-->
</Grid>
</Border>
</ControlTemplate>
</Setter>
</Style>

<!-- Transitions -->
<Style Selector="ListBoxItem:not(.notransitions) /template/ Border#selectedBorder,
ListBoxItem:not(.notransitions) /template/ Border#pointerOverBorder">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Duration="0:0:0.25" Property="Opacity" Easing="LinearEasing" />
</Transitions>
</Setter>
</Style>


<Style Selector="ListBoxItem:disabled">
<Setter Property="Opacity" Value="0.56" />
</Style>
<Style Selector="ListBoxItem:not(:disabled):pointerover /template/ Border#pointerOverBorder">
<Setter Property="Opacity" Value="0.06" />
</Style>
<Style Selector="ListBoxItem:selected /template/ Border#selectedBorder">
<Setter Property="Opacity" Value="0.12" />
</Style>
<Style
Selector="ListBoxItem:not(:pointerover) /template/ Border#pointerOverBorder,
ListBoxItem:not(:selected) /template/ Border#selectedBorder">
<Setter Property="Opacity" Value="0" />
</Style>
</Styles>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<StyleInclude Source="avares://IronyModManager/Controls/Themes/MaterialDark/IronyResizeBorder.axaml"/>
<StyleInclude Source="avares://IronyModManager/Controls/Themes/MaterialDark/IronyClientSideDecorations.axaml"/>
<StyleInclude Source="avares://IronyModManager/Controls/Themes/MaterialDark/Window.axaml"/>
<StyleInclude Source="avares://IronyModManager/Controls/Themes/MaterialDark/ListBoxItem.axaml"/>

<!--Individual styles-->
<Style Selector="NotificationCard">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Material.Styles.Converters;assembly=Material.Styles"
xmlns:animations="clr-namespace:Material.Styles.Additional.Animations;assembly=Material.Styles"
xmlns:ripple="clr-namespace:Material.Ripple;assembly=Material.Ripple;assembly=Material.Styles">

<Style Selector="ListBoxItem">
<Setter Property="Foreground" Value="{TemplateBinding Foreground}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Padding" Value="8" />
<Setter Property="Template">
<ControlTemplate>
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Margin="{TemplateBinding Margin}"
ClipToBounds="{TemplateBinding ClipToBounds}">
<Grid>
<Border Name="selectedBorder"
Background="{TemplateBinding Foreground}"/>
<Border Name="pointerOverBorder"
Background="{TemplateBinding Foreground}"/>
<!--<ripple:RippleEffect Name="Ripple"
RippleFill="{TemplateBinding Foreground}"
Focusable="False"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Padding="{TemplateBinding Padding}">-->
<ContentPresenter Name="PART_ContentPresenter"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Padding="{TemplateBinding Padding}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
<!--</ripple:RippleEffect>-->
</Grid>
</Border>
</ControlTemplate>
</Setter>
</Style>

<!-- Transitions -->
<Style Selector="ListBoxItem:not(.notransitions) /template/ Border#selectedBorder,
ListBoxItem:not(.notransitions) /template/ Border#pointerOverBorder">
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Duration="0:0:0.25" Property="Opacity" Easing="LinearEasing" />
</Transitions>
</Setter>
</Style>


<Style Selector="ListBoxItem:disabled">
<Setter Property="Opacity" Value="0.56" />
</Style>
<Style Selector="ListBoxItem:not(:disabled):pointerover /template/ Border#pointerOverBorder">
<Setter Property="Opacity" Value="0.06" />
</Style>
<Style Selector="ListBoxItem:selected /template/ Border#selectedBorder">
<Setter Property="Opacity" Value="0.12" />
</Style>
<Style
Selector="ListBoxItem:not(:pointerover) /template/ Border#pointerOverBorder,
ListBoxItem:not(:selected) /template/ Border#selectedBorder">
<Setter Property="Opacity" Value="0" />
</Style>
</Styles>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<StyleInclude Source="avares://IronyModManager/Controls/Themes/MaterialLight/IronyResizeBorder.axaml"/>
<StyleInclude Source="avares://IronyModManager/Controls/Themes/MaterialLight/IronyClientSideDecorations.axaml"/>
<StyleInclude Source="avares://IronyModManager/Controls/Themes/MaterialLight/Window.axaml"/>
<StyleInclude Source="avares://IronyModManager/Controls/Themes/MaterialLight/ListBoxItem.axaml"/>

<!--Individual styles-->
<Style Selector="NotificationCard">
Expand Down

0 comments on commit b4ee19f

Please sign in to comment.