|
7 | 7 | xmlns:Custom="using:Microsoft.Toolkit.Uwp.UI.Controls"
|
8 | 8 | x:Class="Files.InstanceTabsView"
|
9 | 9 | mc:Ignorable="d"
|
10 |
| - Background="{ThemeResource SystemControlChromeHighAcrylicWindowMediumBrush}" Name="InstanceTabsPage"> |
| 10 | + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" |
| 11 | + xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"> |
11 | 12 | <Page.Resources>
|
12 | 13 | <ResourceDictionary>
|
13 | 14 | <ResourceDictionary.MergedDictionaries>
|
14 | 15 | <ResourceDictionary>
|
15 | 16 | <ResourceDictionary.ThemeDictionaries>
|
16 | 17 | <ResourceDictionary x:Key="Default">
|
17 | 18 | <SolidColorBrush x:Key="TabViewItemHeaderBackgroundSelected" Color="White" />
|
18 |
| - <SolidColorBrush x:Key="TabViewItemHeaderBackgroundPointerOver" Color="LightGray" /> |
| 19 | + <SolidColorBrush x:Key="TabViewItemHeaderBackgroundPointerOver" Color="White" /> |
19 | 20 | <SolidColorBrush x:Key="TabViewItemHeaderBackgroundPressed" Color="White" />
|
20 | 21 | </ResourceDictionary>
|
21 | 22 | <ResourceDictionary x:Key="Light">
|
22 | 23 | <SolidColorBrush x:Key="TabViewItemHeaderBackgroundSelected" Color="White" />
|
23 |
| - <SolidColorBrush x:Key="TabViewItemHeaderBackgroundPointerOver" Color="LightGray" /> |
| 24 | + <SolidColorBrush x:Key="TabViewItemHeaderBackgroundPointerOver" Color="White" /> |
24 | 25 | <SolidColorBrush x:Key="TabViewItemHeaderBackgroundPressed" Color="White" />
|
25 | 26 | </ResourceDictionary>
|
26 | 27 | <ResourceDictionary x:Key="Dark">
|
27 | 28 | <SolidColorBrush x:Key="TabViewItemHeaderBackgroundSelected" Color="#191919" />
|
28 |
| - <SolidColorBrush x:Key="TabViewItemHeaderBackgroundPointerOver" Color="DarkGray" /> |
| 29 | + <SolidColorBrush x:Key="TabViewItemHeaderBackgroundPointerOver" Color="#191919" /> |
29 | 30 | <SolidColorBrush x:Key="TabViewItemHeaderBackgroundPressed" Color="#191919" />
|
30 | 31 | </ResourceDictionary>
|
31 | 32 | <ResourceDictionary x:Key="HighContrast">
|
|
34 | 35 | </ResourceDictionary.ThemeDictionaries>
|
35 | 36 | </ResourceDictionary>
|
36 | 37 | </ResourceDictionary.MergedDictionaries>
|
| 38 | + <StaticResource x:Key="TabViewItemHeaderRevealBorderBrush" ResourceKey="SystemControlBackgroundTransparentRevealBorderBrush"/> |
| 39 | + <converters:DoubleToVisibilityConverter x:Key="GreaterThanToleranceVisibilityConverter" GreaterThan="65.0"/> |
| 40 | + <Style x:Key="TabViewScrollViewer" TargetType="ScrollViewer"> |
| 41 | + <Setter Property="HorizontalScrollMode" Value="Auto"/> |
| 42 | + <Setter Property="VerticalScrollMode" Value="Auto"/> |
| 43 | + <Setter Property="IsHorizontalRailEnabled" Value="True"/> |
| 44 | + <Setter Property="IsVerticalRailEnabled" Value="True"/> |
| 45 | + <Setter Property="IsTabStop" Value="False"/> |
| 46 | + <Setter Property="ZoomMode" Value="Disabled"/> |
| 47 | + <Setter Property="HorizontalContentAlignment" Value="Left"/> |
| 48 | + <Setter Property="VerticalContentAlignment" Value="Top"/> |
| 49 | + <Setter Property="VerticalScrollBarVisibility" Value="Visible"/> |
| 50 | + <Setter Property="Padding" Value="0"/> |
| 51 | + <Setter Property="BorderThickness" Value="1,0,0,0"/> |
| 52 | + <Setter Property="BorderBrush" Value="{ThemeResource TabViewItemHeaderRevealBorderBrush}"/> |
| 53 | + <Setter Property="Background" Value="Transparent"/> |
| 54 | + <Setter Property="UseSystemFocusVisuals" Value="True"/> |
| 55 | + <Setter Property="Template"> |
| 56 | + <Setter.Value> |
| 57 | + <ControlTemplate TargetType="ScrollViewer"> |
| 58 | + <Border x:Name="Root" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"> |
| 59 | + <Grid Background="{TemplateBinding Background}"> |
| 60 | + <Grid.ColumnDefinitions> |
| 61 | + <ColumnDefinition Width="Auto"/> |
| 62 | + <ColumnDefinition Width="*"/> |
| 63 | + <ColumnDefinition Width="Auto"/> |
| 64 | + </Grid.ColumnDefinitions> |
| 65 | + <RepeatButton x:Name="ScrollBackButton" Background="Transparent" BorderThickness="1" Content="" Delay="50" FontFamily="Segoe MDL2 Assets" Interval="100" Style="{StaticResource RepeatButtonRevealStyle}" VerticalAlignment="Stretch" Visibility="{Binding ScrollableWidth, Converter={StaticResource GreaterThanToleranceVisibilityConverter}, FallbackValue=Collapsed, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue=Collapsed}"/> |
| 66 | + <ScrollContentPresenter x:Name="ScrollContentPresenter" Grid.Column="1" Margin="{TemplateBinding Padding}" TabFocusNavigation="Once"/> |
| 67 | + <RepeatButton x:Name="ScrollForwardButton" Background="Transparent" BorderThickness="1" Content="" Grid.Column="2" Delay="50" FontFamily="Segoe MDL2 Assets" Interval="100" Style="{StaticResource RepeatButtonRevealStyle}" VerticalAlignment="Stretch" Visibility="{Binding ScrollableWidth, Converter={StaticResource GreaterThanToleranceVisibilityConverter}, FallbackValue=Collapsed, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue=Collapsed}"/> |
| 68 | + </Grid> |
| 69 | + </Border> |
| 70 | + </ControlTemplate> |
| 71 | + </Setter.Value> |
| 72 | + </Setter> |
| 73 | + </Style> |
| 74 | + <ControlTemplate x:Key="TabViewTemplate1" TargetType="Custom:TabView"> |
| 75 | + <Grid Background="{ThemeResource SystemControlChromeHighAcrylicWindowMediumBrush}" x:Name="TabViewContainer"> |
| 76 | + <Grid.ColumnDefinitions> |
| 77 | + <ColumnDefinition Width="Auto"/> |
| 78 | + <ColumnDefinition Custom:TabView.ConstrainColumn="True" Custom:TabView.IgnoreColumn="True" Width="Auto"/> |
| 79 | + <ColumnDefinition Width="Auto"/> |
| 80 | + <ColumnDefinition Width="Auto"/> |
| 81 | + <ColumnDefinition Custom:TabView.IgnoreColumn="True" Width="*"/> |
| 82 | + <ColumnDefinition Width="175"/> |
| 83 | + </Grid.ColumnDefinitions> |
| 84 | + <Grid.RowDefinitions> |
| 85 | + <RowDefinition Height="Auto"/> |
| 86 | + <RowDefinition Height="Auto"/> |
| 87 | + <RowDefinition Height="*"/> |
| 88 | + <RowDefinition Height="Auto"/> |
| 89 | + </Grid.RowDefinitions> |
| 90 | + <ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Grid.ColumnSpan="6" Grid.Row="0"/> |
| 91 | + <ContentPresenter ContentTemplate="{TemplateBinding TabStartHeaderTemplate}" Content="{TemplateBinding TabStartHeader}" Grid.Column="0" Grid.Row="1"/> |
| 92 | + <ScrollViewer x:Name="ScrollViewer" AutomationProperties.AccessibilityView="Raw" BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}" Grid.Column="1" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" IsVerticalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsVerticalScrollChainingEnabled}" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsHorizontalScrollChainingEnabled="{TemplateBinding ScrollViewer.IsHorizontalScrollChainingEnabled}" Grid.Row="1" Style="{StaticResource TabViewScrollViewer}" TabNavigation="{TemplateBinding TabNavigation}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}"> |
| 93 | + <ItemsPresenter x:Name="TabsItemsPresenter" Padding="{TemplateBinding Padding}"/> |
| 94 | + </ScrollViewer> |
| 95 | + <ContentPresenter ContentTemplate="{TemplateBinding TabActionHeaderTemplate}" Content="{TemplateBinding TabActionHeader}" Grid.Column="3" HorizontalAlignment="Left" Grid.Row="1"/> |
| 96 | + <Grid Background="Transparent" Name="DragArea" Loaded="DragArea_Loaded" Grid.Column="4" Grid.Row="1"/> |
| 97 | + <ContentPresenter ContentTemplate="{TemplateBinding TabEndHeaderTemplate}" Content="{TemplateBinding TabEndHeader}" Grid.Column="5" Grid.Row="1"/> |
| 98 | + <ContentPresenter x:Name="TabContentPresenter" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Grid.ColumnSpan="6" Grid.Row="2"/> |
| 99 | + <ContentPresenter ContentTemplate="{TemplateBinding FooterTemplate}" Content="{TemplateBinding Footer}" Grid.ColumnSpan="6" Grid.Row="3"/> |
| 100 | + </Grid> |
| 101 | + </ControlTemplate> |
37 | 102 | </ResourceDictionary>
|
38 | 103 | </Page.Resources>
|
39 | 104 |
|
40 |
| - <Grid Background="Transparent"> |
41 |
| - <Grid.RowDefinitions> |
42 |
| - <RowDefinition Height="Auto"/> |
43 |
| - <RowDefinition/> |
44 |
| - </Grid.RowDefinitions> |
45 |
| - |
46 |
| - <Grid.ColumnDefinitions> |
47 |
| - <ColumnDefinition Width="{Binding Width, ElementName=LeftPaddingColumn}"/> |
48 |
| - <ColumnDefinition/> |
49 |
| - <ColumnDefinition Width="{Binding Width, ElementName=RightPaddingColumn}"/> |
50 |
| - </Grid.ColumnDefinitions> |
51 |
| - |
52 |
| - <ContentPresenter Name="tabContentPresenter" Grid.Row="1" Grid.ColumnSpan="3" Content="{x:Bind local:InstanceTabsView.ContentPresGrid, Mode=OneWay}"/> |
53 |
| - |
54 |
| - <Grid Grid.ColumnSpan="3" Name="DragArea" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Loaded="DragArea_Loaded" Background="Transparent"> |
55 |
| - <Grid.ColumnDefinitions> |
56 |
| - <ColumnDefinition x:Name="LeftPaddingColumn" Width="0"/> |
57 |
| - <ColumnDefinition/> |
58 |
| - <ColumnDefinition x:Name="RightPaddingColumn" Width="0"/> |
59 |
| - </Grid.ColumnDefinitions> |
60 |
| - </Grid> |
61 |
| - |
62 |
| - <Custom:TabView CanReorderItems="False" SelectionChanged="TabStrip_SelectionChanged" Name="TabStrip" SelectedTabWidth="150" IsCloseButtonOverlay="False" Background="Transparent" TabWidthBehavior="Actual" CanCloseTabs="True" ItemsSource="{x:Bind local:InstanceTabsView.instanceTabs}" TabClosing="TabStrip_TabClosing"> |
| 105 | + <Grid Name="rootGrid" Background="Transparent"> |
| 106 | + <Custom:TabView Template="{StaticResource TabViewTemplate1}" Grid.ColumnSpan="3" CanReorderItems="False" Name="TabStrip" IsCloseButtonOverlay="False" Background="Transparent" SelectedTabWidth="200" CanCloseTabs="True"> |
63 | 107 | <Custom:TabView.Resources>
|
64 | 108 | <x:Double x:Key="TabViewItemHeaderMinHeight">32</x:Double>
|
65 | 109 | <StaticResource x:Key="TabViewSelectionIndicatorForeground" ResourceKey="SystemControlTransparentBrush" />
|
66 | 110 | </Custom:TabView.Resources>
|
67 |
| - <Custom:TabView.ItemTemplate> |
68 |
| - <DataTemplate/> |
69 |
| - </Custom:TabView.ItemTemplate> |
70 |
| - |
71 |
| - <Custom:TabView.ItemHeaderTemplate> |
72 |
| - <DataTemplate> |
73 |
| - <Grid Canvas.ZIndex="5" Width="150"> |
74 |
| - <TextBlock VerticalAlignment="Center" Text="{Binding HeaderText}"/> |
75 |
| - </Grid> |
76 |
| - </DataTemplate> |
77 |
| - </Custom:TabView.ItemHeaderTemplate> |
78 |
| - |
| 111 | + <Custom:TabView.TabEndHeader> |
| 112 | + <Grid Background="Transparent"/> |
| 113 | + </Custom:TabView.TabEndHeader> |
79 | 114 | <Custom:TabView.TabActionHeader>
|
80 | 115 | <Button BorderThickness="1" x:Name="NewTabButton" Canvas.ZIndex="2" Background="Transparent" Style="{StaticResource ButtonRevealStyle}" Height="32" Width="32" Click="NewTabButton_Click">
|
81 | 116 | <Button.Content>
|
82 | 117 | <FontIcon FontSize="12" Glyph=""/>
|
83 | 118 | </Button.Content>
|
| 119 | + <Button.KeyboardAccelerators> |
| 120 | + <KeyboardAccelerator Modifiers="Control" Key="T"/> |
| 121 | + </Button.KeyboardAccelerators> |
84 | 122 | </Button>
|
85 | 123 | </Custom:TabView.TabActionHeader>
|
86 | 124 |
|
|
0 commit comments