Skip to content

Commit

Permalink
chore: NeumorphismHollow and Raising
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelMendesRosa committed Aug 10, 2023
1 parent 5941a3f commit ea73f9d
Show file tree
Hide file tree
Showing 4 changed files with 290 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,16 @@
</utu:ShadowContainer>
</StackPanel>
</StackPanel>

<!-- Test ShadowContainer not stretching its content by default -->

<StackPanel Background="{StaticResource UnoColor}"
HorizontalAlignment="Stretch"
BorderBrush="Black"
BorderThickness="1"
Spacing="10"
Spacing="50"
Padding="20">

<Button Content="Test Test TestTest Test Test" HorizontalAlignment="Stretch" Background="Aquamarine"></Button>
<TextBox Padding="10"
Background="Purple"
CornerRadius="20"
Expand All @@ -321,7 +321,99 @@
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Password" />


<utu:ShadowContainer Shadows="{StaticResource ButtonShadows}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Padding="10"
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="NO Padding NO Margin"/>
</utu:ShadowContainer>

<utu:ShadowContainer Shadows="{StaticResource ButtonShadows}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Padding="10"
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Padding"/>
</utu:ShadowContainer>


<utu:ShadowContainer Shadows="{StaticResource ButtonShadows}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Margin"
Margin="30,30,30,30"/>
</utu:ShadowContainer>


<utu:ShadowContainer Shadows="{StaticResource ButtonShadows}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Padding="10"
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Padding + Margin diff"
Margin="15,30,50,30"/>
</utu:ShadowContainer>


<utu:ShadowContainer Shadows="{StaticResource ButtonShadows}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Padding"
Padding="15,30,50,30"/>
</utu:ShadowContainer>
</StackPanel>

<StackPanel Background="{StaticResource UnoColor}"
HorizontalAlignment="Stretch"
BorderBrush="Black"
BorderThickness="1"
Spacing="50"
Padding="20">
<Button Content="Test Test TestTest Test Test" HorizontalAlignment="Stretch" Background="Aquamarine"></Button>
<TextBox Padding="10"
Background="Purple"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Password" />

<utu:ShadowContainer Shadows="{StaticResource NeumorphismHollow}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
Expand All @@ -333,9 +425,164 @@
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Password" />
Text="NO Padding NO Margin"/>
</utu:ShadowContainer>

<utu:ShadowContainer Shadows="{StaticResource NeumorphismHollow}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Padding="10"
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Padding"/>
</utu:ShadowContainer>


<utu:ShadowContainer Shadows="{StaticResource NeumorphismHollow}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Margin"
Margin="30,30,30,30"/>
</utu:ShadowContainer>


<utu:ShadowContainer Shadows="{StaticResource NeumorphismHollow}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Padding="10"
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Padding + Margin diff"
Margin="15,30,50,30"/>
</utu:ShadowContainer>


<utu:ShadowContainer Shadows="{StaticResource NeumorphismHollow}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Padding"
Padding="15,30,50,30"/>
</utu:ShadowContainer>
</StackPanel>

<StackPanel Background="{StaticResource UnoColor}"
HorizontalAlignment="Stretch"
BorderBrush="Black"
BorderThickness="1"
Spacing="50"
Padding="20">
<Button Content="Test Test TestTest Test Test" HorizontalAlignment="Stretch" Background="Aquamarine"></Button>
<TextBox Padding="10"
Background="Purple"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Password" />

<utu:ShadowContainer Shadows="{StaticResource NeumorphismRaising}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Padding="10"
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="NO Padding NO Margin"/>
</utu:ShadowContainer>

<utu:ShadowContainer Shadows="{StaticResource NeumorphismRaising}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Padding="10"
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Padding"/>
</utu:ShadowContainer>


<utu:ShadowContainer Shadows="{StaticResource NeumorphismRaising}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Margin"
Margin="30,30,30,30"/>
</utu:ShadowContainer>


<utu:ShadowContainer Shadows="{StaticResource NeumorphismRaising}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox Padding="10"
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Padding + Margin diff"
Margin="15,30,50,30"/>
</utu:ShadowContainer>


<utu:ShadowContainer Shadows="{StaticResource NeumorphismRaising}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch">
<TextBox
Background="{StaticResource UnoColor}"
BorderThickness="0"
CornerRadius="20"
Foreground="White"
HorizontalAlignment="Stretch"
PlaceholderForeground="LightGray"
PlaceholderText="Hollow element"
Text="Padding"
Padding="15,30,50,30"/>
</utu:ShadowContainer>
</StackPanel>


</StackPanel>

</ScrollViewer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ private void OnShadowSizeChanged()
{
if (_currentContent != null && _currentContent.ActualWidth > 0 && _currentContent.ActualHeight > 0)
{
UpdateCanvasSize(_currentContent.ActualWidth, _currentContent.ActualHeight, Shadows);
Thickness marginElement = new Thickness();
if (_currentContent is FrameworkElement fm)
{
marginElement = fm.Margin;
}
UpdateCanvasSize(_currentContent.ActualWidth, _currentContent.ActualHeight, Shadows, marginElement);
}
}

Expand Down
Loading

0 comments on commit ea73f9d

Please sign in to comment.