Skip to content

Commit

Permalink
feat: implement scrollable tabs in config window
Browse files Browse the repository at this point in the history
  • Loading branch information
DorielRivalet committed Oct 19, 2022
1 parent 6282204 commit 4a7c155
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 0 deletions.
139 changes: 139 additions & 0 deletions MHFZ_Overlay/ConfigWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,33 @@
</Setter>
</Style>
</TabControl.Resources>

<!--https://stackoverflow.com/a/7041848/18859245-->
<TabControl.Template>
<ControlTemplate TargetType="TabControl">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden" >
<TabPanel x:Name="HeaderPanel"
Panel.ZIndex ="1"
KeyboardNavigation.TabIndex="1"
Grid.Column="0"
Grid.Row="0"
Margin="2,2,2,0"
IsItemsHost="true"/>
</ScrollViewer>
<ContentPresenter x:Name="PART_SelectedContentHost"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
Margin="{TemplateBinding Padding}"
ContentSource="SelectedContent" Grid.Row="1"/>
</Grid>
</ControlTemplate>
</TabControl.Template>


<TabItem ToolTip="General settings" Background="Transparent" Foreground="#cdd6f4">
<TabItem.Header>
<StackPanel Background="Transparent" Orientation="Horizontal">
Expand Down Expand Up @@ -316,6 +343,7 @@
<Button Background="Transparent" Grid.Row="2" x:Name="BtnImageFile" ToolTip="Export image" Content="{Binding Converter={StaticResource XamlIconToViewBoxConverter },ConverterParameter='icons/image_FILL0_wght400_GRAD0_opsz48.xaml'}" Click="BtnImageFile_Click" Width="40" Style="{StaticResource ConfigBottomButtons}" Height="40"/>
</Grid>


<TabControl Margin="5" BorderBrush="Transparent" Background="Transparent" Grid.Row="0" Grid.Column="1">
<TabControl.Resources>
<Style TargetType="TabItem">
Expand Down Expand Up @@ -347,6 +375,32 @@
</Setter>
</Style>
</TabControl.Resources>
<TabControl.Template>
<ControlTemplate TargetType="TabControl">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden" >
<TabPanel x:Name="HeaderPanel"
Panel.ZIndex ="1"
KeyboardNavigation.TabIndex="1"
Grid.Column="0"
Grid.Row="0"
Margin="2,2,2,0"
IsItemsHost="true"/>
</ScrollViewer>
<ContentPresenter x:Name="PART_SelectedContentHost"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
Margin="{TemplateBinding Padding}"
ContentSource="SelectedContent" Grid.Row="1"/>
</Grid>
</ControlTemplate>
</TabControl.Template>



<TabItem ToolTip="View Image" Background="#11111b" Foreground="#cdd6f4">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
Expand All @@ -373,7 +427,92 @@
</DockPanel>
</Grid>
</TabItem>
<TabItem ToolTip="View Guild Food" Background="#11111b" Foreground="#cdd6f4">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Guild Food" Margin="4,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</TabItem.Header>
<Grid>
<DockPanel Margin="5,5,5,5">
<ScrollViewer VerticalScrollBarVisibility="Visible">
<TextBlock ToolTip="" Text="text" TextWrapping="Wrap"/>
</ScrollViewer>
</DockPanel>
</Grid>
</TabItem>
<TabItem ToolTip="View Caravan Skills" Background="#11111b" Foreground="#cdd6f4">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Caravan" Margin="4,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</TabItem.Header>
<Grid>
<DockPanel Margin="5,5,5,5">
<ScrollViewer VerticalScrollBarVisibility="Visible">
<TextBlock ToolTip="" Text="text" TextWrapping="Wrap"/>
</ScrollViewer>
</DockPanel>
</Grid>
</TabItem>
<TabItem ToolTip="View Road/Duremudira Skills" Background="#11111b" Foreground="#cdd6f4">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Road/Duremudira Skills" Margin="4,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</TabItem.Header>
<Grid>
<DockPanel Margin="5,5,5,5">
<ScrollViewer VerticalScrollBarVisibility="Visible">
<TextBlock ToolTip="" Text="text" TextWrapping="Wrap"/>
</ScrollViewer>
</DockPanel>
</Grid>
</TabItem>
<TabItem ToolTip="View Armor Skills" Background="#11111b" Foreground="#cdd6f4">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Armor Skills" Margin="4,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</TabItem.Header>
<Grid>
<DockPanel Margin="5,5,5,5">
<ScrollViewer VerticalScrollBarVisibility="Visible">
<TextBlock ToolTip="" Text="text" TextWrapping="Wrap"/>
</ScrollViewer>
</DockPanel>
</Grid>
</TabItem>
<TabItem ToolTip="View Motion Values" Background="#11111b" Foreground="#cdd6f4">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Motion Values" Margin="4,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</TabItem.Header>
<Grid>
<DockPanel Margin="5,5,5,5">
<ScrollViewer VerticalScrollBarVisibility="Visible">
<TextBlock ToolTip="" Text="text" TextWrapping="Wrap"/>
</ScrollViewer>
</DockPanel>
</Grid>
</TabItem>
<TabItem ToolTip="View Hunting Horn Songs" Background="#11111b" Foreground="#cdd6f4">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Hunting Horn Songs" Margin="4,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</TabItem.Header>
<Grid>
<DockPanel Margin="5,5,5,5">
<ScrollViewer VerticalScrollBarVisibility="Visible">
<TextBlock ToolTip="" Text="text" TextWrapping="Wrap"/>
</ScrollViewer>
</DockPanel>
</Grid>
</TabItem>
</TabControl>

</Grid>


Expand Down
Binary file added img/icon/dure2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4a7c155

Please sign in to comment.