mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
Adjust button styles for wasm
This commit is contained in:
parent
07f96db088
commit
c0126bd4ef
3 changed files with 53 additions and 46 deletions
|
@ -129,25 +129,6 @@ namespace CalculationManager
|
|||
SetMemorizedNumbers = (IntPtr)int.Parse(ptrs[10]),
|
||||
};
|
||||
|
||||
#else
|
||||
var p = new CalculatorManager_CreateParams
|
||||
{
|
||||
CalculatorState = GCHandle.ToIntPtr(_displayCallbackHandle),
|
||||
GetCEngineString = Marshal.GetFunctionPointerForDelegate(NativeDispatch._getCEngineStringCallback),
|
||||
|
||||
GetCEngineString = (IntPtr)int.Parse(ptrs[0]),
|
||||
BinaryOperatorReceived = (IntPtr)int.Parse(ptrs[1]),
|
||||
SetPrimaryDisplay = (IntPtr)int.Parse(ptrs[2]),
|
||||
SetIsInError = (IntPtr)int.Parse(ptrs[3]),
|
||||
SetParenthesisNumber = (IntPtr)int.Parse(ptrs[4]),
|
||||
MaxDigitsReached = (IntPtr)int.Parse(ptrs[5]),
|
||||
MemoryItemChanged = (IntPtr)int.Parse(ptrs[6]),
|
||||
OnHistoryItemAdded = (IntPtr)int.Parse(ptrs[7]),
|
||||
OnNoRightParenAdded = (IntPtr)int.Parse(ptrs[8]),
|
||||
SetExpressionDisplay = (IntPtr)int.Parse(ptrs[9]),
|
||||
SetMemorizedNumbers = (IntPtr)int.Parse(ptrs[10]),
|
||||
};
|
||||
|
||||
#else
|
||||
var p = new CalculatorManager_CreateParams
|
||||
{
|
||||
|
|
|
@ -219,12 +219,18 @@
|
|||
<SolidColorBrush x:Key="AppControlPageTextBaseMediumHighBrush"
|
||||
Color="{StaticResource SystemBaseMediumHighColor}" />
|
||||
|
||||
<RevealBackgroundBrush x:Key="AppControlHoverButtonFaceBrush"
|
||||
<win:RevealBackgroundBrush x:Key="AppControlHoverButtonFaceBrush"
|
||||
Color="#18FFFFFF" />
|
||||
|
||||
<RevealBackgroundBrush x:Key="AppControlPressedButtonFaceBrush"
|
||||
<xamarin:SolidColorBrush x:Key="AppControlHoverButtonFaceBrush"
|
||||
Color="{ThemeResource SystemColorHighlightColor}" />
|
||||
|
||||
<win:RevealBackgroundBrush x:Key="AppControlPressedButtonFaceBrush"
|
||||
Color="#30FFFFFF" />
|
||||
|
||||
<xamarin:SolidColorBrush x:Key="AppControlPressedButtonFaceBrush"
|
||||
Color="{ThemeResource SystemColorButtonFaceColor}" />
|
||||
|
||||
<SolidColorBrush x:Key="AppControlTransparentAccentColorBrush"
|
||||
Color="{ThemeResource SystemAccentColor}" />
|
||||
|
||||
|
@ -234,24 +240,32 @@
|
|||
<SolidColorBrush x:Key="AppControlPageTextRedColorBrush"
|
||||
Color="Red" />
|
||||
|
||||
<RevealBorderBrush x:Key="AppControlForegroundTransparentRevealBorderBrush"
|
||||
<win:RevealBorderBrush x:Key="AppControlForegroundTransparentRevealBorderBrush"
|
||||
FallbackColor="Transparent"
|
||||
TargetTheme="Dark"
|
||||
Color="Transparent" />
|
||||
|
||||
<RevealBackgroundBrush x:Key="AppControlHighlightAltListAccentHighRevealBackgroundBrush"
|
||||
TargetTheme="Dark"
|
||||
/>
|
||||
<!--
|
||||
UNO TODO
|
||||
Color="{ThemeResource SystemAccentColorDark3}"
|
||||
FallbackColor="{ThemeResource SystemAccentColorDark3}"-->
|
||||
<xamarin:SolidColorBrush x:Key="AppControlForegroundTransparentRevealBorderBrush"
|
||||
Color="Transparent" />
|
||||
|
||||
<AcrylicBrush x:Key="AppChromeAcrylicHostBackdropMediumLowBrush"
|
||||
<win:RevealBackgroundBrush x:Key="AppControlHighlightAltListAccentHighRevealBackgroundBrush"
|
||||
TargetTheme="Dark"
|
||||
Color="{ThemeResource SystemAccentColorDark3}"
|
||||
FallbackColor="{ThemeResource SystemAccentColorDark3}"
|
||||
/>
|
||||
|
||||
<xamarin:SolidColorBrush x:Key="AppControlHighlightAltListAccentHighRevealBackgroundBrush"
|
||||
Color="{ThemeResource SystemColorHighlightTextColor}" />
|
||||
|
||||
<win:AcrylicBrush x:Key="AppChromeAcrylicHostBackdropMediumLowBrush"
|
||||
BackgroundSource="HostBackdrop"
|
||||
FallbackColor="{ThemeResource SystemChromeMediumColor}"
|
||||
TintColor="{ThemeResource SystemChromeLowColor}"
|
||||
TintOpacity="0.7" />
|
||||
|
||||
<xamarin:SolidColorBrush x:Key="AppChromeAcrylicHostBackdropMediumLowBrush"
|
||||
Color="{ThemeResource SystemColorWindowColor}" />
|
||||
|
||||
<!-- UNO TODO END THEME RESOURCES -->
|
||||
|
||||
<!-- Min Window Height/Width -->
|
||||
|
@ -336,9 +350,7 @@
|
|||
To="KeyBoardEntry" />
|
||||
</VisualStateGroup.Transitions>
|
||||
<VisualState x:Name="Normal" />
|
||||
<!--
|
||||
UNO TODO
|
||||
<VisualState x:Name="PointerOver">
|
||||
<win:VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.(RevealBrush.State)"
|
||||
Value="PointerOver" />
|
||||
|
@ -347,17 +359,22 @@
|
|||
<Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
|
||||
Value="{Binding HoverForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</win:VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.(RevealBrush.State)"
|
||||
Value="Pressed" />
|
||||
<Setter Target="RootGrid.Background"
|
||||
<win:Setter Target="RootGrid.Background"
|
||||
Value="{Binding PressBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
|
||||
<win:Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
|
||||
Value="{Binding PressForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<!-- UNO TODO -->
|
||||
<xamarin:Setter Target="RootGrid.Background"
|
||||
Value="{ThemeResource AppControlPressedButtonFaceBrush}" />
|
||||
<xamarin:Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
|
||||
Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>-->
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ContentPresenter.Foreground"
|
||||
|
@ -471,9 +488,7 @@
|
|||
To="KeyBoardEntry" />
|
||||
</VisualStateGroup.Transitions>
|
||||
<VisualState x:Name="Normal" />
|
||||
<!--
|
||||
UNO TODO
|
||||
<VisualState x:Name="PointerOver">
|
||||
<win:VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.(RevealBrush.State)"
|
||||
Value="PointerOver" />
|
||||
|
@ -484,19 +499,25 @@
|
|||
<Setter Target="ParenthesisCount.Foreground"
|
||||
Value="{Binding HoverForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</win:VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.(RevealBrush.State)"
|
||||
Value="Pressed" />
|
||||
<Setter Target="RootGrid.Background"
|
||||
<win:Setter Target="RootGrid.Background"
|
||||
Value="{Binding PressBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Setter Target="ContentPresenter.Foreground"
|
||||
<win:Setter Target="ContentPresenter.Foreground"
|
||||
Value="{Binding PressForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Setter Target="ParenthesisCount.Foreground"
|
||||
<win:Setter Target="ParenthesisCount.Foreground"
|
||||
Value="{Binding PressForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<xamarin:Setter Target="RootGrid.Background"
|
||||
Value="{ThemeResource AppControlPressedButtonFaceBrush}" />
|
||||
<xamarin:Setter Target="ContentPresenter.Foreground"
|
||||
Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}" />
|
||||
<xamarin:Setter Target="ParenthesisCount.Foreground"
|
||||
Value="{ThemeResource SystemControlHighlightAltBaseHighBrush}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>-->
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ContentPresenter.Foreground"
|
||||
|
@ -574,8 +595,10 @@
|
|||
<Style x:Key="ResultsScrollerSnapped"
|
||||
BasedOn="{StaticResource ResultsScroller}"
|
||||
TargetType="ScrollViewer">
|
||||
<Setter Property="HorizontalScrollMode"
|
||||
<win:Setter Property="HorizontalScrollMode"
|
||||
Value="Enabled" />
|
||||
<xamarin:Setter Property="HorizontalScrollMode"
|
||||
Value="Disabled" />
|
||||
<Setter Property="HorizontalScrollBarVisibility"
|
||||
Value="Hidden" />
|
||||
<Setter Property="IsHitTestVisible"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<UserControl x:Class="CalculatorApp.Calculator"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:xamarin="http://uno.ui/xamarin"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:automation="using:CalculatorApp.Common.Automation"
|
||||
xmlns:common="using:CalculatorApp.Common"
|
||||
|
@ -10,7 +11,7 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:model="using:CalculatorApp.ViewModels"
|
||||
Loaded="OnLoaded"
|
||||
mc:Ignorable="">
|
||||
mc:Ignorable="xamarin">
|
||||
|
||||
<UserControl.Resources>
|
||||
<!-- DataTemplates -->
|
||||
|
@ -188,6 +189,7 @@
|
|||
<ScrollViewer x:Name="expressionContainer"
|
||||
Grid.Column="1"
|
||||
Padding="0,0,0,0"
|
||||
xamarin:HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Style="{StaticResource ResultsScrollerSnapped}"
|
||||
AutomationProperties.AccessibilityView="Raw">
|
||||
|
@ -967,6 +969,7 @@
|
|||
IsOperatorCommand="{x:Bind Model.IsOperatorCommand, Mode=OneWay}"
|
||||
TabIndex="1" />
|
||||
<controls:OverflowTextBlock x:Name="expressionText"
|
||||
xamarin:Style="{StaticResource overflowTextBlockStyle}"
|
||||
Grid.Row="1"
|
||||
Margin="6,0,6,0"
|
||||
VerticalAlignment="Bottom"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue