Remove preview tag from graphing mode (#1285)

* Remove preview tag

* Remove preview tag

* fix bug
This commit is contained in:
Pepe Rivera
2020-06-23 13:06:23 -07:00
committed by GitHub
parent 76e33ef159
commit 876a7fe13c
10 changed files with 33 additions and 199 deletions

View File

@@ -247,9 +247,6 @@
<ClInclude Include="Controls\CalculatorButton.h" />
<ClInclude Include="Controls\FlipButtons.h" />
<ClInclude Include="Controls\OverflowTextBlock.h" />
<ClInclude Include="Controls\PreviewTagControl.xaml.h">
<DependentUpon>Controls\PreviewTagControl.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Controls\RadixButton.h" />
<ClInclude Include="Controls\SupplementaryItemsControl.h" />
<ClInclude Include="Converters\BooleanNegationConverter.h" />
@@ -350,9 +347,6 @@
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="AboutFlyout.xaml" />
<Page Include="Controls\PreviewTagControl.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="EquationStylePanelControl.xaml">
<SubType>Designer</SubType>
</Page>
@@ -415,9 +409,6 @@
<ClCompile Include="Controls\CalculatorButton.cpp" />
<ClCompile Include="Controls\FlipButtons.cpp" />
<ClCompile Include="Controls\OverflowTextBlock.cpp" />
<ClCompile Include="Controls\PreviewTagControl.xaml.cpp">
<DependentUpon>Controls\PreviewTagControl.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Controls\RadixButton.cpp" />
<ClCompile Include="Controls\SupplementaryItemsControl.cpp" />
<ClCompile Include="Converters\BooleanNegationConverter.cpp" />

View File

@@ -1,57 +0,0 @@
<UserControl x:Class="CalculatorApp.Controls.PreviewTagControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="300"
d:DesignWidth="400"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<Style x:Key="PreviewTagRectStyle" TargetType="Rectangle">
<Setter Property="Opacity" Value="0.86"/>
<Setter Property="Fill" Value="{ThemeResource SystemAccentColor}"/>
</Style>
<Style x:Key="PreviewTagTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="11"/>
<Setter Property="Margin" Value="4,0,4,1"/>
</Style>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<Style x:Key="PreviewTagRectStyle" TargetType="Rectangle">
<Setter Property="Opacity" Value="0.86"/>
<Setter Property="Fill" Value="{ThemeResource SystemAccentColor}"/>
</Style>
<Style x:Key="PreviewTagTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="11"/>
<Setter Property="Margin" Value="4,0,4,1"/>
</Style>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<Style x:Key="PreviewTagRectStyle" TargetType="Rectangle">
<Setter Property="Fill" Value="{ThemeResource SystemColorWindowBrush}"/>
<Setter Property="Stroke" Value="{ThemeResource SystemColorWindowTextBrush}"/>
<Setter Property="StrokeThickness" Value="1"/>
</Style>
<Style x:Key="PreviewTagTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{ThemeResource SystemColorWindowTextBrush}"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Margin" Value="6,2,6,3"/>
</Style>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Rectangle Style="{ThemeResource PreviewTagRectStyle}"
RadiusX="2"
RadiusY="2"/>
<TextBlock x:Uid="PreviewTag"
Style="{ThemeResource PreviewTagTextStyle}"
FontWeight="SemiBold"/>
</Grid>
</UserControl>

View File

@@ -1,23 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "PreviewTagControl.xaml.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Controls;
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
PreviewTagControl::PreviewTagControl()
{
InitializeComponent();
}

View File

@@ -1,16 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "Controls\PreviewTagControl.g.h"
namespace CalculatorApp::Controls
{
[Windows::Foundation::Metadata::WebHostHidden]
public ref class PreviewTagControl sealed
{
public:
PreviewTagControl();
};
}

View File

@@ -39,13 +39,6 @@
<Setter Property="OpticalMarginAlignment" Value="TrimSideBearings"/>
</Style>
<DataTemplate x:Key="NavMenuItemPreviewDataTemplate" x:DataType="x:String">
<StackPanel Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="{x:Bind}"/>
<controls:PreviewTagControl Margin="10,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</DataTemplate>
<converters:BooleanToVisibilityNegationConverter x:Key="BooleanToVisibilityNegationConverter"/>
<converters:BooleanNegationConverter x:Key="BooleanNegationConverter"/>
</Page.Resources>
@@ -128,20 +121,15 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1"
Margin="8,0,0,0"
Orientation="Horizontal">
<TextBlock x:Name="Header"
Margin="0,-3,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Style="{StaticResource CategoryNameTextBlockStyle}"
Text="{x:Bind Model.CategoryName, Mode=OneWay}"
Visibility="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}"/>
<controls:PreviewTagControl Margin="10,0,0,0"
VerticalAlignment="Center"
Visibility="{x:Bind Model.IsModePreview, Mode=OneWay}"/>
</StackPanel>
<TextBlock x:Name="Header"
Grid.Column="1"
Margin="8,-3,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Style="{StaticResource CategoryNameTextBlockStyle}"
Text="{x:Bind Model.CategoryName, Mode=OneWay}"
Visibility="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanToVisibilityNegationConverter}, Mode=OneWay}"/>
<Button x:Name="NormalAlwaysOnTopButton"
x:Uid="EnterAlwaysOnTopButton"
Grid.Column="2"
@@ -168,7 +156,6 @@
DataContext="{x:Bind Model}"
ExpandedModeThresholdWidth="Infinity"
IsBackButtonVisible="Collapsed"
IsEnabled="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanNegationConverter}, Mode=OneWay}"
IsPaneToggleButtonVisible="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanNegationConverter}, Mode=OneWay}"
IsSettingsVisible="False"
ItemInvoked="OnNavItemInvoked"
@@ -181,6 +168,7 @@
SelectionChanged="OnNavSelectionChanged"
TabIndex="1"
UseSystemFocusVisuals="True"
IsEnabled="{x:Bind Model.IsAlwaysOnTop, Converter={StaticResource BooleanNegationConverter}, Mode=OneWay}"
x:Load="False">
<muxc:NavigationView.PaneFooter>

View File

@@ -497,17 +497,7 @@ MUXC::NavigationViewItem ^ MainPage::CreateNavViewItemFromCategory(NavCategory ^
icon->Glyph = category->Glyph;
item->Icon = icon;
if (category->IsPreview)
{
auto contentPresenter = ref new ContentPresenter();
contentPresenter->Content = category->Name;
contentPresenter->ContentTemplate = static_cast<DataTemplate ^>(Resources->Lookup(L"NavMenuItemPreviewDataTemplate"));
item->Content = contentPresenter;
}
else
{
item->Content = category->Name;
}
item->Content = category->Name;
item->AccessKey = category->AccessKey;
item->IsEnabled = category->IsEnabled;
item->Style = static_cast<Windows::UI::Xaml::Style ^>(Resources->Lookup(L"NavViewItemStyle"));