way better
This commit is contained in:
parent
f29882c0f6
commit
134a4c3299
|
@ -19,7 +19,7 @@ namespace winrt::TerminalApp::implementation
|
|||
void OnNewTabButtonDragOver(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::DragEventArgs const& e);
|
||||
|
||||
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
|
||||
WINRT_OBSERVABLE_PROPERTY(bool, ShowUacShield, _PropertyChangedHandlers, false);
|
||||
WINRT_OBSERVABLE_PROPERTY(bool, ShowElevationShield, _PropertyChangedHandlers, false);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,6 @@ namespace TerminalApp
|
|||
{
|
||||
TabRowControl();
|
||||
Microsoft.UI.Xaml.Controls.TabView TabView { get; };
|
||||
Boolean ShowUacShield;
|
||||
Boolean ShowElevationShield;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,117 +11,107 @@
|
|||
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ContentPresenter x:Name="ElevatedShield"
|
||||
Grid.Column="0">
|
||||
<mux:TabView x:Name="TabView"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
AllowDropTabs="True"
|
||||
CanDragTabs="True"
|
||||
CanReorderTabs="True"
|
||||
IsAddTabButtonVisible="false"
|
||||
TabWidthMode="Equal">
|
||||
|
||||
<mux:TabView.TabStripHeader>
|
||||
<!-- EA18 is the "Shield" glyph -->
|
||||
<FontIcon x:Uid="ElevationShield"
|
||||
Margin="9,4,0,0"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="16"
|
||||
Glyph=""
|
||||
Visibility="{x:Bind ShowUacShield, Mode=OneWay}" />
|
||||
Visibility="{x:Bind ShowElevationShield, Mode=OneWay}" />
|
||||
</mux:TabView.TabStripHeader>
|
||||
|
||||
</ContentPresenter>
|
||||
<mux:TabView.TabStripFooter>
|
||||
<mux:SplitButton x:Name="NewTabButton"
|
||||
x:Uid="NewTabSplitButton"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Stretch"
|
||||
AllowDrop="True"
|
||||
AutomationProperties.AccessibilityView="Control"
|
||||
BorderThickness="0"
|
||||
Click="OnNewTabButtonClick"
|
||||
Content=""
|
||||
CornerRadius="{Binding Source={ThemeResource OverlayCornerRadius}, Converter={StaticResource TopCornerRadiusFilterConverter}}"
|
||||
DragOver="OnNewTabButtonDragOver"
|
||||
Drop="OnNewTabButtonDrop"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
FontWeight="SemiLight"
|
||||
UseLayoutRounding="true">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Placement="Mouse">
|
||||
<TextBlock IsTextSelectionEnabled="False">
|
||||
<Run x:Uid="NewTabRun" /> <LineBreak />
|
||||
<Run x:Uid="NewPaneRun"
|
||||
FontStyle="Italic" /> <LineBreak />
|
||||
<Run x:Uid="NewWindowRun"
|
||||
FontStyle="Italic" />
|
||||
</TextBlock>
|
||||
</ToolTip>
|
||||
</ToolTipService.ToolTip>
|
||||
<!-- U+E710 is the fancy plus icon. -->
|
||||
<mux:SplitButton.Resources>
|
||||
<!-- Override the SplitButton* resources to match the tab view's button's styles. -->
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewItemHeaderForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewItemHeaderForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewItemHeaderForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
</mux:SplitButton.Resources>
|
||||
</mux:SplitButton>
|
||||
</mux:TabView.TabStripFooter>
|
||||
|
||||
<mux:TabView x:Name="TabView"
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Bottom"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
AllowDropTabs="True"
|
||||
CanDragTabs="True"
|
||||
CanReorderTabs="True"
|
||||
IsAddTabButtonVisible="false"
|
||||
TabWidthMode="Equal">
|
||||
|
||||
<mux:TabView.TabStripFooter>
|
||||
<mux:SplitButton x:Name="NewTabButton"
|
||||
x:Uid="NewTabSplitButton"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Stretch"
|
||||
AllowDrop="True"
|
||||
AutomationProperties.AccessibilityView="Control"
|
||||
BorderThickness="0"
|
||||
Click="OnNewTabButtonClick"
|
||||
Content=""
|
||||
CornerRadius="{Binding Source={ThemeResource OverlayCornerRadius}, Converter={StaticResource TopCornerRadiusFilterConverter}}"
|
||||
DragOver="OnNewTabButtonDragOver"
|
||||
Drop="OnNewTabButtonDrop"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="12"
|
||||
FontWeight="SemiLight"
|
||||
UseLayoutRounding="true">
|
||||
<ToolTipService.ToolTip>
|
||||
<ToolTip Placement="Mouse">
|
||||
<TextBlock IsTextSelectionEnabled="False">
|
||||
<Run x:Uid="NewTabRun" /> <LineBreak />
|
||||
<Run x:Uid="NewPaneRun"
|
||||
FontStyle="Italic" /> <LineBreak />
|
||||
<Run x:Uid="NewWindowRun"
|
||||
FontStyle="Italic" />
|
||||
</TextBlock>
|
||||
</ToolTip>
|
||||
</ToolTipService.ToolTip>
|
||||
<!-- U+E710 is the fancy plus icon. -->
|
||||
<mux:SplitButton.Resources>
|
||||
<!-- Override the SplitButton* resources to match the tab view's button's styles. -->
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewItemHeaderForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewItemHeaderForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<StaticResource x:Key="SplitButtonBackground"
|
||||
ResourceKey="TabViewButtonBackground" />
|
||||
<StaticResource x:Key="SplitButtonForeground"
|
||||
ResourceKey="TabViewButtonForeground" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPressed"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPressed"
|
||||
ResourceKey="TabViewItemHeaderForegroundPressed" />
|
||||
<StaticResource x:Key="SplitButtonBackgroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderBackgroundPointerOver" />
|
||||
<StaticResource x:Key="SplitButtonForegroundPointerOver"
|
||||
ResourceKey="TabViewItemHeaderForegroundPointerOver" />
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
</mux:SplitButton.Resources>
|
||||
</mux:SplitButton>
|
||||
</mux:TabView.TabStripFooter>
|
||||
|
||||
</mux:TabView>
|
||||
</Grid>
|
||||
</mux:TabView>
|
||||
|
||||
</ContentPresenter>
|
||||
|
|
|
@ -278,7 +278,7 @@ namespace winrt::TerminalApp::implementation
|
|||
// Setup mouse vanish attributes
|
||||
SystemParametersInfoW(SPI_GETMOUSEVANISH, 0, &_shouldMouseVanish, false);
|
||||
|
||||
_tabRow.ShowUacShield(IsElevated() && _settings.GlobalSettings().ShowAdminShield());
|
||||
_tabRow.ShowElevationShield(IsElevated() && _settings.GlobalSettings().ShowAdminShield());
|
||||
|
||||
// Store cursor, so we can restore it, e.g., after mouse vanishing
|
||||
// (we'll need to adapt this logic once we make cursor context aware)
|
||||
|
@ -2270,7 +2270,7 @@ namespace winrt::TerminalApp::implementation
|
|||
// want to create an animation.
|
||||
WUX::Media::Animation::Timeline::AllowDependentAnimations(!_settings.GlobalSettings().DisableAnimations());
|
||||
|
||||
_tabRow.ShowUacShield(IsElevated() && _settings.GlobalSettings().ShowAdminShield());
|
||||
_tabRow.ShowElevationShield(IsElevated() && _settings.GlobalSettings().ShowAdminShield());
|
||||
}
|
||||
|
||||
// This is a helper to aid in sorting commands by their `Name`s, alphabetically.
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<ContentPresenter x:Name="ContentRoot"
|
||||
Grid.Column="0" />
|
||||
|
||||
|
@ -45,3 +44,4 @@
|
|||
Grid.Column="2"
|
||||
HorizontalAlignment="Right" />
|
||||
</Grid>
|
||||
|
||||
|
|
Loading…
Reference in a new issue