mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-23 06:25:19 -07:00
Merge pull request #58 from nventive/dev/madi/fix-background-color
Fix Background color for xamarin platforms
This commit is contained in:
commit
8c425ec42c
2 changed files with 284 additions and 226 deletions
|
@ -1,5 +1,4 @@
|
||||||
<ResourceDictionary
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:xamarin="http://uno.ui/xamarin"
|
xmlns:xamarin="http://uno.ui/xamarin"
|
||||||
xmlns:android="http://uno.ui/android"
|
xmlns:android="http://uno.ui/android"
|
||||||
xmlns:ios="http://uno.ui/ios"
|
xmlns:ios="http://uno.ui/ios"
|
||||||
|
@ -193,6 +192,8 @@
|
||||||
|
|
||||||
<Color x:Key="AccentHoverColor">#FF0077D7</Color>
|
<Color x:Key="AccentHoverColor">#FF0077D7</Color>
|
||||||
|
|
||||||
|
<Color x:Key="XamarinBackgroundColor">#FFEBEBEB</Color>
|
||||||
|
|
||||||
<SolidColorBrush x:Key="AccentPressBackgroundColorBrush"
|
<SolidColorBrush x:Key="AccentPressBackgroundColorBrush"
|
||||||
Color="{StaticResource AccentPressColor}" />
|
Color="{StaticResource AccentPressColor}" />
|
||||||
|
|
||||||
|
@ -229,6 +230,9 @@
|
||||||
<SolidColorBrush x:Key="AppControlPageTextBaseMediumHighBrush"
|
<SolidColorBrush x:Key="AppControlPageTextBaseMediumHighBrush"
|
||||||
Color="{StaticResource SystemBaseMediumHighColor}" />
|
Color="{StaticResource SystemBaseMediumHighColor}" />
|
||||||
|
|
||||||
|
<SolidColorBrush x:Key="XamarinBackgroundBrush"
|
||||||
|
Color="{StaticResource XamarinBackgroundColor}" />
|
||||||
|
|
||||||
<win:RevealBackgroundBrush x:Key="AppControlHoverButtonFaceBrush"
|
<win:RevealBackgroundBrush x:Key="AppControlHoverButtonFaceBrush"
|
||||||
Color="#17000000" />
|
Color="#17000000" />
|
||||||
|
|
||||||
|
@ -575,15 +579,68 @@
|
||||||
BasedOn="{StaticResource SymbolOperatorButtonStyle}"
|
BasedOn="{StaticResource SymbolOperatorButtonStyle}"
|
||||||
TargetType="Controls:CalculatorButton">
|
TargetType="Controls:CalculatorButton">
|
||||||
|
|
||||||
<Setter Property="HoverBackground"
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Controls:CalculatorButton">
|
||||||
|
<Grid x:Name="RootGrid"
|
||||||
|
Background="{TemplateBinding Background}">
|
||||||
|
<VisualStateManager.VisualStateGroups>
|
||||||
|
<VisualStateGroup x:Name="CommonStates">
|
||||||
|
<VisualStateGroup.Transitions>
|
||||||
|
<VisualTransition GeneratedDuration="0" />
|
||||||
|
<VisualTransition From="Normal"
|
||||||
|
GeneratedDuration="0:0:0.1"
|
||||||
|
To="KeyBoardEntry" />
|
||||||
|
</VisualStateGroup.Transitions>
|
||||||
|
<VisualState x:Name="Normal" />
|
||||||
|
<win:VisualState x:Name="PointerOver">
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Target="RootGrid.(RevealBrush.State)"
|
||||||
|
Value="PointerOver" />
|
||||||
|
<Setter Target="RootGrid.Background"
|
||||||
Value="{StaticResource AccentHoverBackgroundColorBrush}" />
|
Value="{StaticResource AccentHoverBackgroundColorBrush}" />
|
||||||
<Setter Property="HoverForeground"
|
<Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
|
||||||
Value="{ThemeResource AccentHoverForegroundColorBrush}" />
|
Value="{ThemeResource AccentHoverForegroundColorBrush}" />
|
||||||
|
</VisualState.Setters>
|
||||||
<Setter Property="PressBackground"
|
</win:VisualState>
|
||||||
|
<VisualState x:Name="Pressed">
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Target="RootGrid.(RevealBrush.State)"
|
||||||
|
Value="Pressed" />
|
||||||
|
<Setter Target="RootGrid.Background"
|
||||||
Value="{StaticResource AccentPressBackgroundColorBrush}" />
|
Value="{StaticResource AccentPressBackgroundColorBrush}" />
|
||||||
<Setter Property="PressForeground"
|
<Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
|
||||||
Value="{ThemeResource AccentHoverForegroundColorBrush}" />
|
Value="{ThemeResource AccentHoverForegroundColorBrush}" />
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
<VisualState x:Name="Disabled">
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Target="ContentPresenter.Foreground"
|
||||||
|
Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
|
||||||
|
<Setter Target="ContentPresenter.BorderThickness"
|
||||||
|
Value="0" />
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
<VisualState x:Name="KeyBoardEntry" />
|
||||||
|
</VisualStateGroup>
|
||||||
|
</VisualStateManager.VisualStateGroups>
|
||||||
|
|
||||||
|
<ContentPresenter x:Name="ContentPresenter"
|
||||||
|
Margin="{TemplateBinding Padding}"
|
||||||
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||||
|
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||||
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
|
BorderBrush="{ThemeResource AppControlForegroundTransparentRevealBorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
AutomationProperties.AccessibilityView="Raw"
|
||||||
|
Content="{TemplateBinding Content}"
|
||||||
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
|
ContentTransitions="{TemplateBinding ContentTransitions}" />
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- RESULTS -->
|
<!-- RESULTS -->
|
||||||
|
|
|
@ -12,8 +12,9 @@
|
||||||
x:Name="pageRoot"
|
x:Name="pageRoot"
|
||||||
Background="{ThemeResource AppChromeAcrylicHostBackdropMediumLowBrush}"
|
Background="{ThemeResource AppChromeAcrylicHostBackdropMediumLowBrush}"
|
||||||
Loaded="OnPageLoaded"
|
Loaded="OnPageLoaded"
|
||||||
|
xmlns:xamarin="http://uno.ui/xamarin"
|
||||||
xmlns:android="http://nventive.com/android"
|
xmlns:android="http://nventive.com/android"
|
||||||
mc:Ignorable="android">
|
mc:Ignorable="android xamarin">
|
||||||
<!--
|
<!--
|
||||||
xmlns:automation="using:WindowsCalculator.Common.Automation"
|
xmlns:automation="using:WindowsCalculator.Common.Automation"
|
||||||
-->
|
-->
|
||||||
|
@ -63,7 +64,7 @@
|
||||||
</Page.Resources>
|
</Page.Resources>
|
||||||
|
|
||||||
<Grid toolkit:VisibleBoundsPadding.PaddingMask="All"
|
<Grid toolkit:VisibleBoundsPadding.PaddingMask="All"
|
||||||
android:Background="White">
|
xamarin:Background="{StaticResource XamarinBackgroundBrush}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<!--
|
<!--
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue