Skip to content

Commit

Permalink
Merge branch 'lamparter/refactor' into lamparter/vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamparter authored Sep 18, 2024
2 parents b9ee9b8 + b2ac1b1 commit 9de494f
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 29 deletions.
25 changes: 25 additions & 0 deletions src/FluentHub.App/UserControls/CustomTabView/CustomTabView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
x:Class="FluentHub.App.UserControls.CustomTabView.CustomTabView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dataitems="using:FluentHub.App.Data.Items"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Expand Down Expand Up @@ -34,6 +35,30 @@
SelectedItem="{x:Bind SelectedItem, Mode=TwoWay}"
TabCloseRequested="OnMainTabViewTabCloseRequested"
TabItemsSource="{x:Bind TabItems, Mode=OneWay}">
<TabView.TabStripHeader>
<Button
Grid.Column="1"
Width="30"
Height="30"
Margin="4,0,-2,2"
Padding="5"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Background="Transparent"
BorderThickness="0"
ToolTipService.ToolTip="Home">
<Viewbox Width="16">
<AnimatedIcon>
<AnimatedIcon.Source>
<animatedvisuals:AnimatedGlobalNavigationButtonVisualSource />
</AnimatedIcon.Source>
<AnimatedIcon.FallbackIconSource>
<SymbolIconSource Symbol="GlobalNavigationButton" />
</AnimatedIcon.FallbackIconSource>
</AnimatedIcon>
</Viewbox>
</Button>
</TabView.TabStripHeader>

<TabView.TabItemTemplate>
<DataTemplate x:DataType="dataitems:TabViewItem">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private async Task LoadRepositoryReleasesAsync(string login, string name)
_lastPageInfo = result.PageInfo;
var items = (List<Release>)result.Response;

if (items.Any())
if (items.Count != 0)
{
LatestRelease = items.FirstOrDefault();
}
Expand Down
99 changes: 71 additions & 28 deletions src/FluentHub.App/Views/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Copyright (c) 2022-2024 0x5BFA. Licensed under the MIT License. See the LICENSE. -->
<!-- Copyright (c) 2022-2024 0x5BFA. Licensed under the MIT License. See the LICENSE. -->
<Page
x:Class="FluentHub.App.Views.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Expand Down Expand Up @@ -75,6 +75,17 @@
<SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="Transparent" />
<Thickness x:Key="NavigationViewContentGridBorderThickness">0</Thickness>
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0</CornerRadius>
<!-- Definitely not copied directly from Files.... -->
<Style
x:Key="AddressToolbarButtonStyle"
BasedOn="{StaticResource DefaultButtonStyle}"
TargetType="Button">
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Width" Value="36" />
<Setter Property="Height" Value="32" />
</Style>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>

Expand Down Expand Up @@ -139,34 +150,16 @@

<StackPanel Orientation="Horizontal" Spacing="8">

<!-- Root Navigation Pane -->
<!--<Button
x:Name="LeftSideNavigationViewOpenerButton"
Width="32"
Height="32"
Padding="0"
Click="LeftSideNavigationViewOpenerButton_Click"
IsEnabled="False">
<Viewbox Width="16">
<AnimatedIcon>
<AnimatedIcon.Source>
<animatedvisuals:AnimatedGlobalNavigationButtonVisualSource />
</AnimatedIcon.Source>
<AnimatedIcon.FallbackIconSource>
<SymbolIconSource Symbol="GlobalNavigationButton" />
</AnimatedIcon.FallbackIconSource>
</AnimatedIcon>
</Viewbox>
</Button>-->

<!-- Backward -->
<Button
x:Name="ContentFrameBackwardNavigationButton"
Width="32"
Height="32"
Padding="0"
Background="Transparent"
Command="{x:Bind ViewModel.GoBackCommand, Mode=OneWay}"
IsEnabled="{x:Bind CustomCustomTabView.SelectedItem.NavigationHistory.CanGoBack, Mode=OneWay}"
Style="{StaticResource AddressToolbarButtonStyle}"
ToolTipService.ToolTip="{helpers:ResourceString Name=GoBackButton/ToolTipService/Tooltip}">
<Viewbox Width="16">
<AnimatedIcon>
Expand All @@ -182,12 +175,14 @@

<!-- Forward -->
<Button
x:Name="ContentFrameForewardNavigationButton"
x:Name="ContentFrameForwardNavigationButton"
Width="32"
Height="32"
Padding="0"
x:Load="{x:Bind CustomCustomTabView.SelectedItem.NavigationHistory.CanGoForward, Mode=OneWay}"
Background="Transparent"
Command="{x:Bind ViewModel.GoForwardCommand, Mode=OneWay}"
Style="{StaticResource AddressToolbarButtonStyle}"
ToolTipService.ToolTip="{helpers:ResourceString Name=GoForwardButton/ToolTipService/Tooltip}">
<Viewbox Width="16">
<AnimatedIcon>
Expand All @@ -210,11 +205,25 @@
Width="32"
Height="32"
Padding="0"
Background="Transparent"
Command="{x:Bind ViewModel.ReloadCommand, Mode=OneWay}"
IsEnabled="{x:Bind CustomCustomTabView.SelectedItem.NavigationHistory.CanReload, Mode=OneWay}"
Style="{StaticResource AddressToolbarButtonStyle}"
ToolTipService.ToolTip="Refresh">
<FontIcon FontSize="14" Glyph="&#xE72C;" />
</Button>

<!-- Home -->
<Button
x:Name="ContentFrameHomeNavigationButton"
Width="32"
Height="32"
Padding="0"
Background="Transparent"
Style="{StaticResource AddressToolbarButtonStyle}"
ToolTipService.ToolTip="Home">
<FontIcon FontSize="14" Glyph="&#xE80F;" />
</Button>
</StackPanel>

<StackPanel Grid.Column="1" Orientation="Horizontal">
Expand Down Expand Up @@ -255,29 +264,63 @@
Spacing="8">

<!-- Search GitHub -->
<!--<TextBox
<TextBox
Width="256"
Height="32"
Background="Transparent"
IsEnabled="False"
PlaceholderText="Search GitHub" />-->
PlaceholderText="Search GitHub" />

<!-- Add New -->
<!--<DropDownButton
<DropDownButton
x:Name="AddNewItemButton"
Width="64"
Height="32"
Background="Transparent"
IsEnabled="False">
<FontIcon FontSize="16" Glyph="&#xE710;" />
</DropDownButton>-->
</DropDownButton>

<!-- User Icon -->
<!-- Issues Feed -->
<Button
x:Name="UserIssuesFeedButton"
Width="32"
Height="32"
Padding="0"
Background="Transparent"
IsEnabled="False">
<FontIcon
FontFamily="{StaticResource Octicons}"
FontSize="16"
Glyph="&#xE9EA;" />
</Button>

<!-- Pulls Feed -->
<Button
x:Name="UserPullsFeedButton"
Width="32"
Height="32"
Padding="0"
Background="Transparent"
IsEnabled="False">
<FontIcon
FontFamily="{StaticResource Octicons}"
FontSize="16"
Glyph="&#xE9BF;" />
</Button>

<!-- Notifications Inbox -->
<Button
x:Name="UserNotificationInBoxButton"
Width="32"
Height="32"
Padding="0"
Background="Transparent"
Click="UserNotificationInBoxButton_Click">
<FontIcon FontSize="16" Glyph="&#xEA8F;" />
<FontIcon
FontFamily="{StaticResource Octicons}"
FontSize="16"
Glyph="&#xE9E0;" />
</Button>

<!-- User Icon -->
Expand Down

0 comments on commit 9de494f

Please sign in to comment.