Modify how we manage the visibility of the history button (#821)
* Modify how we manage the visibility of the history button * rename function
This commit is contained in:
parent
6e2b82c8bf
commit
25d7a46ac1
@ -454,7 +454,6 @@
|
||||
<Setter Target="M5.MaxWidth" Value="80"/>
|
||||
<Setter Target="MemButton.(Grid.Column)" Value="5"/>
|
||||
<Setter Target="MemoryButton.(Grid.Column)" Value="6"/>
|
||||
<Setter Target="HistoryButton.Visibility" Value="Collapsed"/>
|
||||
</VisualState.Setters>
|
||||
<Storyboard Completed="OnModeVisualStateCompleted"/>
|
||||
</VisualState>
|
||||
@ -491,7 +490,6 @@
|
||||
<Setter Target="ColumnMain.Width" Value="320*"/>
|
||||
<Setter Target="ColumnHistory.Width" Value="240*"/>
|
||||
<Setter Target="DockPanel.Visibility" Value="Visible"/>
|
||||
<Setter Target="HistoryButton.Visibility" Value="Collapsed"/>
|
||||
<Setter Target="M6.Width" Value="0"/>
|
||||
</VisualState.Setters>
|
||||
<Storyboard Completed="OnLayoutVisualStateCompleted"/>
|
||||
@ -657,7 +655,6 @@
|
||||
IsEnabled="{x:Bind Model.IsProgrammer, Mode=OneWay}"
|
||||
x:Load="False"/>
|
||||
|
||||
<Grid x:Name="HistoryButtonParent" Visibility="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}">
|
||||
<Button x:Name="HistoryButton"
|
||||
x:Uid="HistoryButton"
|
||||
Grid.Row="0"
|
||||
@ -667,6 +664,7 @@
|
||||
Content=""
|
||||
ExitDisplayModeOnAccessKeyInvoked="False"
|
||||
TabIndex="2"
|
||||
Visibility="{x:Bind local:Calculator.ShouldDisplayHistoryButton(Model.IsAlwaysOnTop, Model.IsProgrammer, DockPanel.Visibility), Mode=OneWay}"
|
||||
IsEnabled="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanNegationConverter}, Mode=OneWay}">
|
||||
<FlyoutBase.AttachedFlyout>
|
||||
<Flyout x:Name="HistoryFlyout"
|
||||
@ -677,7 +675,6 @@
|
||||
Placement="Full"/>
|
||||
</FlyoutBase.AttachedFlyout>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<!-- Scientific angle buttons -->
|
||||
<local:CalculatorScientificAngleButtons x:Name="ScientificAngleButtons"
|
||||
|
@ -714,3 +714,7 @@ void Calculator::Calculator_SizeChanged(Object ^ /*sender*/, SizeChangedEventArg
|
||||
}
|
||||
}
|
||||
|
||||
::Visibility Calculator::ShouldDisplayHistoryButton(bool isAlwaysOnTop, bool isProgrammer, ::Visibility dockPanelVisibility)
|
||||
{
|
||||
return !isAlwaysOnTop && !isProgrammer && dockPanelVisibility == ::Visibility::Collapsed ? ::Visibility::Visible : ::Visibility::Collapsed;
|
||||
}
|
||||
|
@ -69,6 +69,9 @@ public
|
||||
void CloseMemoryFlyout();
|
||||
|
||||
void SetDefaultFocus();
|
||||
|
||||
// Methods used by native bindings
|
||||
static Windows::UI::Xaml::Visibility ShouldDisplayHistoryButton(bool isAlwaysOnTop, bool isProgrammer, Windows::UI::Xaml::Visibility dockPanelVisibility);
|
||||
private:
|
||||
void OnLoaded(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
|
||||
@ -143,5 +146,6 @@ public
|
||||
void OnHistoryAccessKeyInvoked(_In_ Windows::UI::Xaml::UIElement ^ sender, _In_ Windows::UI::Xaml::Input::AccessKeyInvokedEventArgs ^ args);
|
||||
void OnMemoryAccessKeyInvoked(_In_ Windows::UI::Xaml::UIElement ^ sender, _In_ Windows::UI::Xaml::Input::AccessKeyInvokedEventArgs ^ args);
|
||||
void OnVisualStateChanged(Platform::Object ^ sender, Windows::UI::Xaml::VisualStateChangedEventArgs ^ e);
|
||||
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user