Skip to content

Commit

Permalink
messes
Browse files Browse the repository at this point in the history
  • Loading branch information
itzbluebxrry committed Apr 18, 2023
1 parent 4acb9c7 commit 35419f0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Project-Radon/Controls/BrowserTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
</Grid.Background>
<Grid Background="Black" Opacity="0.5"/>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Stretch" Margin="100,90" MinWidth="500">
<TextBlock x:Name="ntpTimeDisplay" FontWeight="Medium" TextAlignment="Center" Text="12:00" FontSize="68" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom">
<TextBlock x:Name="ntpHourDisplay" FontWeight="Medium" TextAlignment="Center" Text="12:00" FontSize="68" />

</StackPanel>
<TextBlock x:Name="ntpDateDisplay" FontWeight="Medium" TextAlignment="Center" Text="Saturday, April 15th" Margin="0,0,0,60" FontSize="16" />
<Grid Background="{ThemeResource AcrylicInAppFillColorDefaultBrush}" BorderBrush="{StaticResource SystemControlAcrylicElementBrush}" BorderThickness="0" CornerRadius="4"
RequestedTheme="Dark">
Expand All @@ -49,7 +52,7 @@

<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="8">

<Button Style="{ThemeResource ButtonRevealStyle}" x:Name="profileCenterToggle" Background="{x:Null}" BorderThickness="0" Margin="10,0,0,0" Padding="5" CornerRadius="40">
<Button Style="{ThemeResource ButtonRevealStyle}" Click="profileCenterToggle_Click" x:Name="profileCenterToggle" Background="{x:Null}" BorderThickness="0" Margin="10,0,0,0" Padding="5" CornerRadius="40">
<Ellipse Width="28" Height="28">
<Ellipse.Fill>
<ImageBrush ImageSource="ms-appx:///accountpictures/clippy.png" Stretch="UniformToFill"/>
Expand Down
18 changes: 16 additions & 2 deletions Project-Radon/Controls/BrowserTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Imaging;
using Yttrium;

namespace Project_Radon.Controls
{
Expand Down Expand Up @@ -44,12 +45,14 @@ public bool IsLoading
public string Favicon => IsCoreInitialized && !IsLoading ? ("https://icons.duckduckgo.com/ip3/" + WebBrowser.Source.AbsoluteUri+".ico") : "https://raw.githubusercontent.com/microsoft/fluentui-system-icons/main/assets/Document/SVG/ic_fluent_document_48_regular.svg";
public string Title => IsCoreInitialized && !IsLoading ? (WebBrowser.CoreWebView2.DocumentTitle ?? WebBrowser.Source.AbsoluteUri) : "Loading";
public bool IsCoreInitialized { get; private set; }

public BrowserTab()
{
InitializeComponent();


WebBrowser.Source = new Uri("about:radon-ntp");

//Windows.System.Launcher.LaunchFolderAsync(ApplicationData.Current.LocalFolder);
WebBrowser.CoreWebView2Initialized += delegate
{
Expand All @@ -59,7 +62,7 @@ public BrowserTab()
.Replace("Mozilla/5.0", "Mozilla/4.0");
WebBrowser.CoreWebView2.Settings.UserAgent = GoogleSignInUserAgent;
WebBrowser.CoreWebView2.DocumentTitleChanged += (_, e) => InvokePropertyChanged();
WebBrowser.CoreWebView2.SourceChanged+= (_, e) => InvokePropertyChanged();
WebBrowser.CoreWebView2.SourceChanged += (_, e) => InvokePropertyChanged();
WebBrowser.CoreWebView2.ContextMenuRequested += async (s, e) =>
{
IList<CoreWebView2ContextMenuItem> menuList = e.MenuItems;
Expand Down Expand Up @@ -89,8 +92,14 @@ public BrowserTab()
Content = username
};
ToolTipService.SetToolTip(profileCenterToggle, toolTip);


}






private void WebBrowser_NavigationCompleted(Microsoft.UI.Xaml.Controls.WebView2 sender, CoreWebView2NavigationCompletedEventArgs args)
{
Expand Down Expand Up @@ -202,5 +211,10 @@ private void ntpSearchBar_PointerEntered(object sender, Windows.UI.Xaml.Input.Po
{

}

private async void profileCenterToggle_Click(object sender, RoutedEventArgs e)
{
await new UserProfileDialog().ShowAsync();
}
}
}

0 comments on commit 35419f0

Please sign in to comment.