Skip to content

Commit

Permalink
Smaller switch theme button
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed Apr 14, 2021
1 parent 3e3cbd2 commit 2bc4034
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 5 additions & 1 deletion Unigram/Unigram/Controls/SwitchThemeButton.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Windows.Graphics;
using Windows.Graphics.Display;
using Windows.UI.Xaml;

namespace Unigram.Controls
Expand All @@ -16,11 +17,14 @@ public SwitchThemeButton()

protected override void OnApplyTemplate()
{
var dpi = DisplayInformation.GetForCurrentView().LogicalDpi / 96.0f;
var size = (int)(24 * dpi);

_player = GetTemplateChild("ContentPresenter") as LottieView;
_player.IsLoopingEnabled = false;
_player.IsCachingEnabled = false;
_player.IsBackward = ActualTheme == ElementTheme.Dark;
_player.FrameSize = new SizeInt32 { Width = 40, Height = 40 };
_player.FrameSize = new SizeInt32 { Width = size, Height = size };
_player.Source = new Uri("ms-appx:///Assets/Animations/Sun.tgs");
}

Expand Down
4 changes: 2 additions & 2 deletions Unigram/Unigram/Themes/Generic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2834,8 +2834,8 @@
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
AutomationProperties.AccessibilityView="Raw"
Width="32"
Height="32"/>
Width="24"
Height="24"/>
</Grid>
</ControlTemplate>
</Setter.Value>
Expand Down
5 changes: 2 additions & 3 deletions Unigram/Unigram/Views/Host/RootPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@
</VisualStateManager.VisualStateGroups>
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}"
Glyph="&#xE0E5;"
FontSize="12"
FontSize="20"
Foreground="{ThemeResource CheckBoxForegroundUnchecked}"
RenderTransformOrigin="0.5,0.5"
VerticalAlignment="Bottom"
Margin="0,0,0,2">
VerticalAlignment="Bottom">
<FontIcon.RenderTransform>
<RotateTransform x:Name="CheckGlyphRotation" />
</FontIcon.RenderTransform>
Expand Down

0 comments on commit 2bc4034

Please sign in to comment.