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]),
|
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
|
#else
|
||||||
var p = new CalculatorManager_CreateParams
|
var p = new CalculatorManager_CreateParams
|
||||||
{
|
{
|
||||||
|
|
|
@ -219,12 +219,18 @@
|
||||||
<SolidColorBrush x:Key="AppControlPageTextBaseMediumHighBrush"
|
<SolidColorBrush x:Key="AppControlPageTextBaseMediumHighBrush"
|
||||||
Color="{StaticResource SystemBaseMediumHighColor}" />
|
Color="{StaticResource SystemBaseMediumHighColor}" />
|
||||||
|
|
||||||
<RevealBackgroundBrush x:Key="AppControlHoverButtonFaceBrush"
|
<win:RevealBackgroundBrush x:Key="AppControlHoverButtonFaceBrush"
|
||||||
Color="#18FFFFFF" />
|
Color="#18FFFFFF" />
|
||||||
|
|
||||||
<RevealBackgroundBrush x:Key="AppControlPressedButtonFaceBrush"
|
<xamarin:SolidColorBrush x:Key="AppControlHoverButtonFaceBrush"
|
||||||
|
Color="{ThemeResource SystemColorHighlightColor}" />
|
||||||
|
|
||||||
|
<win:RevealBackgroundBrush x:Key="AppControlPressedButtonFaceBrush"
|
||||||
Color="#30FFFFFF" />
|
Color="#30FFFFFF" />
|
||||||
|
|
||||||
|
<xamarin:SolidColorBrush x:Key="AppControlPressedButtonFaceBrush"
|
||||||
|
Color="{ThemeResource SystemColorButtonFaceColor}" />
|
||||||
|
|
||||||
<SolidColorBrush x:Key="AppControlTransparentAccentColorBrush"
|
<SolidColorBrush x:Key="AppControlTransparentAccentColorBrush"
|
||||||
Color="{ThemeResource SystemAccentColor}" />
|
Color="{ThemeResource SystemAccentColor}" />
|
||||||
|
|
||||||
|
@ -234,24 +240,32 @@
|
||||||
<SolidColorBrush x:Key="AppControlPageTextRedColorBrush"
|
<SolidColorBrush x:Key="AppControlPageTextRedColorBrush"
|
||||||
Color="Red" />
|
Color="Red" />
|
||||||
|
|
||||||
<RevealBorderBrush x:Key="AppControlForegroundTransparentRevealBorderBrush"
|
<win:RevealBorderBrush x:Key="AppControlForegroundTransparentRevealBorderBrush"
|
||||||
FallbackColor="Transparent"
|
FallbackColor="Transparent"
|
||||||
TargetTheme="Dark"
|
TargetTheme="Dark"
|
||||||
Color="Transparent" />
|
Color="Transparent" />
|
||||||
|
|
||||||
<RevealBackgroundBrush x:Key="AppControlHighlightAltListAccentHighRevealBackgroundBrush"
|
<xamarin:SolidColorBrush x:Key="AppControlForegroundTransparentRevealBorderBrush"
|
||||||
TargetTheme="Dark"
|
Color="Transparent" />
|
||||||
/>
|
|
||||||
<!--
|
|
||||||
UNO TODO
|
|
||||||
Color="{ThemeResource SystemAccentColorDark3}"
|
|
||||||
FallbackColor="{ThemeResource SystemAccentColorDark3}"-->
|
|
||||||
|
|
||||||
<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"
|
BackgroundSource="HostBackdrop"
|
||||||
FallbackColor="{ThemeResource SystemChromeMediumColor}"
|
FallbackColor="{ThemeResource SystemChromeMediumColor}"
|
||||||
TintColor="{ThemeResource SystemChromeLowColor}"
|
TintColor="{ThemeResource SystemChromeLowColor}"
|
||||||
TintOpacity="0.7" />
|
TintOpacity="0.7" />
|
||||||
|
|
||||||
|
<xamarin:SolidColorBrush x:Key="AppChromeAcrylicHostBackdropMediumLowBrush"
|
||||||
|
Color="{ThemeResource SystemColorWindowColor}" />
|
||||||
|
|
||||||
<!-- UNO TODO END THEME RESOURCES -->
|
<!-- UNO TODO END THEME RESOURCES -->
|
||||||
|
|
||||||
<!-- Min Window Height/Width -->
|
<!-- Min Window Height/Width -->
|
||||||
|
@ -336,9 +350,7 @@
|
||||||
To="KeyBoardEntry" />
|
To="KeyBoardEntry" />
|
||||||
</VisualStateGroup.Transitions>
|
</VisualStateGroup.Transitions>
|
||||||
<VisualState x:Name="Normal" />
|
<VisualState x:Name="Normal" />
|
||||||
<!--
|
<win:VisualState x:Name="PointerOver">
|
||||||
UNO TODO
|
|
||||||
<VisualState x:Name="PointerOver">
|
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="RootGrid.(RevealBrush.State)"
|
<Setter Target="RootGrid.(RevealBrush.State)"
|
||||||
Value="PointerOver" />
|
Value="PointerOver" />
|
||||||
|
@ -347,17 +359,22 @@
|
||||||
<Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
|
<Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
|
||||||
Value="{Binding HoverForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
Value="{Binding HoverForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
</VisualState.Setters>
|
</VisualState.Setters>
|
||||||
</VisualState>
|
</win:VisualState>
|
||||||
<VisualState x:Name="Pressed">
|
<VisualState x:Name="Pressed">
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="RootGrid.(RevealBrush.State)"
|
<Setter Target="RootGrid.(RevealBrush.State)"
|
||||||
Value="Pressed" />
|
Value="Pressed" />
|
||||||
<Setter Target="RootGrid.Background"
|
<win:Setter Target="RootGrid.Background"
|
||||||
Value="{Binding PressBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
Value="{Binding PressBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
<Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
|
<win:Setter Target="ContentPresenter.(ContentPresenter.Foreground)"
|
||||||
Value="{Binding PressForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
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.Setters>
|
||||||
</VisualState>-->
|
</VisualState>
|
||||||
<VisualState x:Name="Disabled">
|
<VisualState x:Name="Disabled">
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="ContentPresenter.Foreground"
|
<Setter Target="ContentPresenter.Foreground"
|
||||||
|
@ -471,9 +488,7 @@
|
||||||
To="KeyBoardEntry" />
|
To="KeyBoardEntry" />
|
||||||
</VisualStateGroup.Transitions>
|
</VisualStateGroup.Transitions>
|
||||||
<VisualState x:Name="Normal" />
|
<VisualState x:Name="Normal" />
|
||||||
<!--
|
<win:VisualState x:Name="PointerOver">
|
||||||
UNO TODO
|
|
||||||
<VisualState x:Name="PointerOver">
|
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="RootGrid.(RevealBrush.State)"
|
<Setter Target="RootGrid.(RevealBrush.State)"
|
||||||
Value="PointerOver" />
|
Value="PointerOver" />
|
||||||
|
@ -484,19 +499,25 @@
|
||||||
<Setter Target="ParenthesisCount.Foreground"
|
<Setter Target="ParenthesisCount.Foreground"
|
||||||
Value="{Binding HoverForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
Value="{Binding HoverForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
</VisualState.Setters>
|
</VisualState.Setters>
|
||||||
</VisualState>
|
</win:VisualState>
|
||||||
<VisualState x:Name="Pressed">
|
<VisualState x:Name="Pressed">
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="RootGrid.(RevealBrush.State)"
|
<Setter Target="RootGrid.(RevealBrush.State)"
|
||||||
Value="Pressed" />
|
Value="Pressed" />
|
||||||
<Setter Target="RootGrid.Background"
|
<win:Setter Target="RootGrid.Background"
|
||||||
Value="{Binding PressBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
Value="{Binding PressBackground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
<Setter Target="ContentPresenter.Foreground"
|
<win:Setter Target="ContentPresenter.Foreground"
|
||||||
Value="{Binding PressForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
Value="{Binding PressForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
<Setter Target="ParenthesisCount.Foreground"
|
<win:Setter Target="ParenthesisCount.Foreground"
|
||||||
Value="{Binding PressForeground, RelativeSource={RelativeSource TemplatedParent}}" />
|
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.Setters>
|
||||||
</VisualState>-->
|
</VisualState>
|
||||||
<VisualState x:Name="Disabled">
|
<VisualState x:Name="Disabled">
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="ContentPresenter.Foreground"
|
<Setter Target="ContentPresenter.Foreground"
|
||||||
|
@ -574,8 +595,10 @@
|
||||||
<Style x:Key="ResultsScrollerSnapped"
|
<Style x:Key="ResultsScrollerSnapped"
|
||||||
BasedOn="{StaticResource ResultsScroller}"
|
BasedOn="{StaticResource ResultsScroller}"
|
||||||
TargetType="ScrollViewer">
|
TargetType="ScrollViewer">
|
||||||
<Setter Property="HorizontalScrollMode"
|
<win:Setter Property="HorizontalScrollMode"
|
||||||
Value="Enabled" />
|
Value="Enabled" />
|
||||||
|
<xamarin:Setter Property="HorizontalScrollMode"
|
||||||
|
Value="Disabled" />
|
||||||
<Setter Property="HorizontalScrollBarVisibility"
|
<Setter Property="HorizontalScrollBarVisibility"
|
||||||
Value="Hidden" />
|
Value="Hidden" />
|
||||||
<Setter Property="IsHitTestVisible"
|
<Setter Property="IsHitTestVisible"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<UserControl x:Class="CalculatorApp.Calculator"
|
<UserControl x:Class="CalculatorApp.Calculator"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:win="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:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:automation="using:CalculatorApp.Common.Automation"
|
xmlns:automation="using:CalculatorApp.Common.Automation"
|
||||||
xmlns:common="using:CalculatorApp.Common"
|
xmlns:common="using:CalculatorApp.Common"
|
||||||
|
@ -10,7 +11,7 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:model="using:CalculatorApp.ViewModels"
|
xmlns:model="using:CalculatorApp.ViewModels"
|
||||||
Loaded="OnLoaded"
|
Loaded="OnLoaded"
|
||||||
mc:Ignorable="">
|
mc:Ignorable="xamarin">
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<!-- DataTemplates -->
|
<!-- DataTemplates -->
|
||||||
|
@ -188,6 +189,7 @@
|
||||||
<ScrollViewer x:Name="expressionContainer"
|
<ScrollViewer x:Name="expressionContainer"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Padding="0,0,0,0"
|
Padding="0,0,0,0"
|
||||||
|
xamarin:HorizontalScrollBarVisibility="Disabled"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Style="{StaticResource ResultsScrollerSnapped}"
|
Style="{StaticResource ResultsScrollerSnapped}"
|
||||||
AutomationProperties.AccessibilityView="Raw">
|
AutomationProperties.AccessibilityView="Raw">
|
||||||
|
@ -967,6 +969,7 @@
|
||||||
IsOperatorCommand="{x:Bind Model.IsOperatorCommand, Mode=OneWay}"
|
IsOperatorCommand="{x:Bind Model.IsOperatorCommand, Mode=OneWay}"
|
||||||
TabIndex="1" />
|
TabIndex="1" />
|
||||||
<controls:OverflowTextBlock x:Name="expressionText"
|
<controls:OverflowTextBlock x:Name="expressionText"
|
||||||
|
xamarin:Style="{StaticResource overflowTextBlockStyle}"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="6,0,6,0"
|
Margin="6,0,6,0"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue