From cdd1ac8db845112190d8621c3d522dc2857fe0b1 Mon Sep 17 00:00:00 2001 From: ItzBluebxrry the Malicious Date: Sun, 5 Nov 2023 11:28:59 +0800 Subject: [PATCH] SOO MANY CHANGES --- CubeKit.UI/Controls/Settings/Converters.cs | 219 + .../Settings/SettingsBlockControl.xaml | 90 + .../Settings/SettingsBlockControl.xaml.cs | 115 + .../Settings/SettingsDisplayControl.xaml | 98 + .../Settings/SettingsDisplayControl.xaml.cs | 85 + .../Toolkit/DropShadowPanel.Properties.cs | 250 + .../Controls/Toolkit/DropShadowPanel.xaml | 30 + .../Controls/Toolkit/DropShadowPanel.xaml.cs | 247 + .../ColorToSolidColorBrushConverter.cs | 18 + CubeKit.UI/CubeKit.UI.csproj | 219 + CubeKit.UI/Materials/AuroraLite.xaml | 601 ++ CubeKit.UI/Materials/AuroraLite.xaml.cs | 27 + CubeKit.UI/Materials/Bloom.html | 917 +++ CubeKit.UI/Materials/BloomView.xaml | 14 + CubeKit.UI/Materials/BloomView.xaml.cs | 35 + CubeKit.UI/Materials/Windows11Danger.html | 885 +++ CubeKit.UI/Properties/AssemblyInfo.cs | 29 + CubeKit.UI/Properties/CubeKit.UI.rd.xml | 33 + CubeKit.UI/Services/WindowService.cs | 82 + CubeKit.UI/Styles/CubeThemeDictionary.xaml | 78 + CubeKit.UI/Styles/CubeUI.xaml | 159 + CubeKit.UI/Styles/GlowGradientUI.xaml | 4892 +++++++++++++++++ CubeKit.UI/Styles/GlowUI.xaml | 638 +++ Project Radon.sln | 22 + Project-Radon/App.xaml | 6 +- Project-Radon/Controls/BrowserTab.xaml | 9 +- Project-Radon/Controls/BrowserTab.xaml.cs | 15 +- .../Controls/BrowserTabViewItem.xaml | 6 + .../Controls/BrowserTabViewItem.xaml.cs | 5 + Project-Radon/MainPage.xaml | 40 +- Project-Radon/MainPage.xaml.cs | 97 +- Project-Radon/Package.appxmanifest | 18 +- Project-Radon/Project Radon.csproj | 68 +- Project-Radon/Settings/SettingsPage.xaml | 77 - Project-Radon/Settings/SettingsPage.xaml.cs | 60 - .../Settings/SettingsPage_Favorites.xaml | 15 - .../Settings/SettingsPage_Favorites.xaml.cs | 17 - .../Settings/SettingsPage_History.xaml | 54 - .../Settings/SettingsPage_History.xaml.cs | 17 - .../Settings/SettingsPage_SearchEngine.xaml | 14 - .../SettingsPage_SearchEngine.xaml.cs | 17 - Project-Radon/Settings/UserProfileDialog.xaml | 12 +- .../Settings/UserProfileDialog.xaml.cs | 6 + Project-Radon/Settings/oobe2.xaml.cs | 4 +- Project-Radon/Settings/oobe5.xaml | 9 +- Project-Radon/Settings/oobe5.xaml.cs | 18 +- Project-Radon/Strings/en-MY/Resources.resw | 156 - Project-Radon/Strings/en-US/Resources.resw | 156 - 48 files changed, 9988 insertions(+), 691 deletions(-) create mode 100644 CubeKit.UI/Controls/Settings/Converters.cs create mode 100644 CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml create mode 100644 CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml.cs create mode 100644 CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml create mode 100644 CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml.cs create mode 100644 CubeKit.UI/Controls/Toolkit/DropShadowPanel.Properties.cs create mode 100644 CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml create mode 100644 CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml.cs create mode 100644 CubeKit.UI/Converters/ColorToSolidColorBrushConverter.cs create mode 100644 CubeKit.UI/CubeKit.UI.csproj create mode 100644 CubeKit.UI/Materials/AuroraLite.xaml create mode 100644 CubeKit.UI/Materials/AuroraLite.xaml.cs create mode 100644 CubeKit.UI/Materials/Bloom.html create mode 100644 CubeKit.UI/Materials/BloomView.xaml create mode 100644 CubeKit.UI/Materials/BloomView.xaml.cs create mode 100644 CubeKit.UI/Materials/Windows11Danger.html create mode 100644 CubeKit.UI/Properties/AssemblyInfo.cs create mode 100644 CubeKit.UI/Properties/CubeKit.UI.rd.xml create mode 100644 CubeKit.UI/Services/WindowService.cs create mode 100644 CubeKit.UI/Styles/CubeThemeDictionary.xaml create mode 100644 CubeKit.UI/Styles/CubeUI.xaml create mode 100644 CubeKit.UI/Styles/GlowGradientUI.xaml create mode 100644 CubeKit.UI/Styles/GlowUI.xaml delete mode 100644 Project-Radon/Settings/SettingsPage.xaml delete mode 100644 Project-Radon/Settings/SettingsPage.xaml.cs delete mode 100644 Project-Radon/Settings/SettingsPage_Favorites.xaml delete mode 100644 Project-Radon/Settings/SettingsPage_Favorites.xaml.cs delete mode 100644 Project-Radon/Settings/SettingsPage_History.xaml delete mode 100644 Project-Radon/Settings/SettingsPage_History.xaml.cs delete mode 100644 Project-Radon/Settings/SettingsPage_SearchEngine.xaml delete mode 100644 Project-Radon/Settings/SettingsPage_SearchEngine.xaml.cs delete mode 100644 Project-Radon/Strings/en-MY/Resources.resw delete mode 100644 Project-Radon/Strings/en-US/Resources.resw diff --git a/CubeKit.UI/Controls/Settings/Converters.cs b/CubeKit.UI/Controls/Settings/Converters.cs new file mode 100644 index 0000000..a956c92 --- /dev/null +++ b/CubeKit.UI/Controls/Settings/Converters.cs @@ -0,0 +1,219 @@ +using System; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Data; + +#nullable enable + +namespace CubeKit.UI.Controls.Settings +{ + /// + /// The generic base implementation of a value converter. + /// + /// The source type. + /// The target type. + public abstract class ValueConverter + : IValueConverter + { + /// + /// Converts a source value to the target type. + /// + /// + /// + public TTarget? Convert(TSource? value) + { + return Convert(value, null, null); + } + + /// + /// Converts a target value back to the source type. + /// + /// + /// + public TSource? ConvertBack(TTarget? value) + { + return ConvertBack(value, null, null); + } + + /// + /// Modifies the source data before passing it to the target for display in the UI. + /// + /// + /// + /// + /// + /// + public object? Convert(object? value, Type? targetType, object? parameter, string? language) + { + // CastExceptions will occur when invalid value, or target type provided. + return Convert((TSource?)value, parameter, language); + } + + /// + /// Modifies the target data before passing it to the source object. This method is called only in TwoWay bindings. + /// + /// + /// + /// + /// + /// + public object? ConvertBack(object? value, Type? targetType, object? parameter, string? language) + { + // CastExceptions will occur when invalid value, or target type provided. + return ConvertBack((TTarget?)value, parameter, language); + } + + /// + /// Converts a source value to the target type. + /// + /// + /// + /// + /// + protected virtual TTarget? Convert(TSource? value, object? parameter, string? language) + { + throw new NotSupportedException(); + } + + /// + /// Converts a target value back to the source type. + /// + /// + /// + /// + /// + protected virtual TSource? ConvertBack(TTarget? value, object? parameter, string? language) + { + throw new NotSupportedException(); + } + } + + /// + /// The base class for converting instances of type T to object and vice versa. + /// + public abstract class ToObjectConverter + : ValueConverter + { + /// + /// Converts a source value to the target type. + /// + /// + /// + /// + /// + protected override object? Convert(T? value, object? parameter, string? language) + { + return value; + } + + /// + /// Converts a target value back to the source type. + /// + /// + /// + /// + /// + protected override T? ConvertBack(object? value, object? parameter, string? language) + { + return (T?)value; + } + } + + /// + /// Converts a boolean to and from a visibility value. + /// + public class InverseBooleanConverter + : ValueConverter + { + /// + /// Converts a source value to the target type. + /// + /// + /// + /// + /// + protected override bool Convert(bool value, object? parameter, string? language) + { + return !value; + } + + /// + /// Converts a target value back to the source type. + /// + /// + /// + /// + /// + protected override bool ConvertBack(bool value, object? parameter, string? language) + { + return !value; + } + } + + public class NullToTrueConverter + : ValueConverter + { + /// + /// Determines whether an inverse conversion should take place. + /// + /// If set, the value True results in , and false in . + public bool Inverse { get; set; } + + /// + /// Converts a source value to the target type. + /// + /// + /// + /// + /// + protected override bool Convert(object? value, object? parameter, string? language) + { + return Inverse ? value != null : value == null; + } + + /// + /// Converts a target value back to the source type. + /// + /// + /// + /// + /// + protected override object? ConvertBack(bool value, object? parameter, string? language) + { + return null; + } + } + + public class StringNullOrWhiteSpaceToTrueConverter + : ValueConverter + { + /// + /// Determines whether an inverse conversion should take place. + /// + /// If set, the value True results in , and false in . + public bool Inverse { get; set; } + + /// + /// Converts a source value to the target type. + /// + /// + /// + /// + /// + protected override bool Convert(string? value, object? parameter, string? language) + { + return Inverse ? !string.IsNullOrWhiteSpace(value) : string.IsNullOrWhiteSpace(value); + } + + /// + /// Converts a target value back to the source type. + /// + /// + /// + /// + /// + protected override string ConvertBack(bool value, object? parameter, string? language) + { + return string.Empty; + } + } +} diff --git a/CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml b/CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml new file mode 100644 index 0000000..0d4e793 --- /dev/null +++ b/CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml.cs b/CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml.cs new file mode 100644 index 0000000..1ccc43b --- /dev/null +++ b/CubeKit.UI/Controls/Settings/SettingsBlockControl.xaml.cs @@ -0,0 +1,115 @@ +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Markup; + +namespace CubeKit.UI.Controls.Settings +{ + [ContentProperty(Name = nameof(SettingsActionableElement))] + public sealed partial class SettingsBlockControl : UserControl + { + public FrameworkElement SettingsActionableElement { get; set; } + + public static readonly DependencyProperty ExpandableContentProperty = DependencyProperty.Register( + "ExpandableContent", + typeof(FrameworkElement), + typeof(SettingsBlockControl), + new PropertyMetadata(null) + ); + + public FrameworkElement ExpandableContent + { + get => (FrameworkElement)GetValue(ExpandableContentProperty); + set => SetValue(ExpandableContentProperty, value); + } + + public static readonly DependencyProperty AdditionalDescriptionContentProperty = DependencyProperty.Register( + "AdditionalDescriptionContent", + typeof(FrameworkElement), + typeof(SettingsBlockControl), + new PropertyMetadata(null) + ); + + public FrameworkElement AdditionalDescriptionContent + { + get => (FrameworkElement)GetValue(AdditionalDescriptionContentProperty); + set => SetValue(AdditionalDescriptionContentProperty, value); + } + + public static readonly DependencyProperty TitleProperty = DependencyProperty.Register( + "Title", + typeof(string), + typeof(SettingsBlockControl), + new PropertyMetadata(null) + ); + + public string Title + { + get => (string)GetValue(TitleProperty); + set => SetValue(TitleProperty, value); + } + + public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register( + "Description", + typeof(string), + typeof(SettingsBlockControl), + new PropertyMetadata(null) + ); + + public string Description + { + get => (string)GetValue(DescriptionProperty); + set => SetValue(DescriptionProperty, value); + } + + public static readonly DependencyProperty IconProperty = DependencyProperty.Register( + "Icon", + typeof(IconElement), + typeof(SettingsBlockControl), + new PropertyMetadata(null) + ); + + public IconElement Icon + { + get => (IconElement)GetValue(IconProperty); + set => SetValue(IconProperty, value); + } + + public static readonly DependencyProperty IsClickableProperty = DependencyProperty.Register( + "IsClickable", + typeof(bool), + typeof(SettingsBlockControl), + new PropertyMetadata(false) + ); + + public bool IsClickable + { + get => (bool)GetValue(IsClickableProperty); + set => SetValue(IsClickableProperty, value); + } + + // + // Summary: + // Occurs when a button control is clicked. + public event RoutedEventHandler Click; + + public SettingsBlockControl() + { + this.InitializeComponent(); + } + + private void ActionableButton_Click(object sender, RoutedEventArgs e) + { + Click?.Invoke(this, e); + } + + private void Expander_Expanding(Microsoft.UI.Xaml.Controls.Expander sender, Microsoft.UI.Xaml.Controls.ExpanderExpandingEventArgs args) + { + Click?.Invoke(this, new RoutedEventArgs()); + } + + private void Expander_Collapsed(Microsoft.UI.Xaml.Controls.Expander sender, Microsoft.UI.Xaml.Controls.ExpanderCollapsedEventArgs args) + { + Click?.Invoke(this, new RoutedEventArgs()); + } + } +} diff --git a/CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml b/CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml new file mode 100644 index 0000000..65ce9e7 --- /dev/null +++ b/CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml.cs b/CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml.cs new file mode 100644 index 0000000..afb3aac --- /dev/null +++ b/CubeKit.UI/Controls/Settings/SettingsDisplayControl.xaml.cs @@ -0,0 +1,85 @@ +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Markup; + +namespace CubeKit.UI.Controls.Settings +{ + [ContentProperty(Name = nameof(SettingsActionableElement))] + public sealed partial class SettingsDisplayControl : UserControl + { + public FrameworkElement SettingsActionableElement { get; set; } + + public static readonly DependencyProperty AdditionalDescriptionContentProperty = DependencyProperty.Register( + "AdditionalDescriptionContent", + typeof(FrameworkElement), + typeof(SettingsDisplayControl), + new PropertyMetadata(null) + ); + + public FrameworkElement AdditionalDescriptionContent + { + get => (FrameworkElement)GetValue(AdditionalDescriptionContentProperty); + set => SetValue(AdditionalDescriptionContentProperty, value); + } + + public static readonly DependencyProperty TitleProperty = DependencyProperty.Register( + "Title", + typeof(string), + typeof(SettingsDisplayControl), + new PropertyMetadata(null) + ); + + public string Title + { + get => (string)GetValue(TitleProperty); + set => SetValue(TitleProperty, value); + } + + public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register( + "Description", + typeof(string), + typeof(SettingsDisplayControl), + new PropertyMetadata(null) + ); + + public string Description + { + get => (string)GetValue(DescriptionProperty); + set => SetValue(DescriptionProperty, value); + } + + public static readonly DependencyProperty IconProperty = DependencyProperty.Register( + "Icon", + typeof(IconElement), + typeof(SettingsDisplayControl), + new PropertyMetadata(null) + ); + + public IconElement Icon + { + get => (IconElement)GetValue(IconProperty); + set => SetValue(IconProperty, value); + } + + public SettingsDisplayControl() + { + this.InitializeComponent(); + VisualStateManager.GoToState(this, "NormalState", false); + } + + private void MainPanel_SizeChanged(object sender, SizeChangedEventArgs e) + { + if (e.NewSize.Width == e.PreviousSize.Width || ActionableElement == null) + return; + + if (ActionableElement.ActualWidth > e.NewSize.Width / 3) + { + VisualStateManager.GoToState(this, "CompactState", false); + } + else + { + VisualStateManager.GoToState(this, "NormalState", false); + } + } + } +} diff --git a/CubeKit.UI/Controls/Toolkit/DropShadowPanel.Properties.cs b/CubeKit.UI/Controls/Toolkit/DropShadowPanel.Properties.cs new file mode 100644 index 0000000..2a1a45b --- /dev/null +++ b/CubeKit.UI/Controls/Toolkit/DropShadowPanel.Properties.cs @@ -0,0 +1,250 @@ +using Microsoft.Toolkit.Uwp.UI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.UI; +using Windows.UI.Composition; +using Windows.UI.Xaml; + +namespace CubeKit.UI.Controls.Toolkit +{ + /// + /// The control allows the creation of a DropShadow for any Xaml FrameworkElement in markup + /// making it easier to add shadows to Xaml without having to directly drop down to Windows.UI.Composition APIs. + /// + public partial class DropShadowPanel + { + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty BlurRadiusProperty = + DependencyProperty.Register(nameof(BlurRadius), typeof(double), typeof(DropShadowPanel), new PropertyMetadata(9.0, OnBlurRadiusChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty ColorProperty = + DependencyProperty.Register(nameof(Color), typeof(Color), typeof(DropShadowPanel), new PropertyMetadata(Colors.Black, OnColorChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty OffsetXProperty = + DependencyProperty.Register(nameof(OffsetX), typeof(double), typeof(DropShadowPanel), new PropertyMetadata(0.0, OnOffsetXChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty OffsetYProperty = + DependencyProperty.Register(nameof(OffsetY), typeof(double), typeof(DropShadowPanel), new PropertyMetadata(0.0, OnOffsetYChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty OffsetZProperty = + DependencyProperty.Register(nameof(OffsetZ), typeof(double), typeof(DropShadowPanel), new PropertyMetadata(0.0, OnOffsetZChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty ShadowOpacityProperty = + DependencyProperty.Register(nameof(ShadowOpacity), typeof(double), typeof(DropShadowPanel), new PropertyMetadata(1.0, OnShadowOpacityChanged)); + + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty IsMaskedProperty = + DependencyProperty.Register(nameof(IsMasked), typeof(bool), typeof(DropShadowPanel), new PropertyMetadata(true, OnIsMaskedChanged)); + + /// + /// Gets DropShadow. Exposes the underlying composition object to allow custom Windows.UI.Composition animations. + /// + public DropShadow DropShadow => _dropShadow; + + /// + /// Gets or sets the mask of the underlying . + /// Allows for a custom to be set. + /// + public CompositionBrush Mask + { + get + { + return _dropShadow?.Mask; + } + + set + { + if (_dropShadow != null) + { + _dropShadow.Mask = value; + } + } + } + + /// + /// Gets or sets the blur radius of the drop shadow. + /// + public double BlurRadius + { + get + { + return (double)GetValue(BlurRadiusProperty); + } + + set + { + SetValue(BlurRadiusProperty, value); + } + } + + /// + /// Gets or sets the color of the drop shadow. + /// + public Color Color + { + get + { + return (Color)GetValue(ColorProperty); + } + + set + { + SetValue(ColorProperty, value); + } + } + + /// + /// Gets or sets the x offset of the drop shadow. + /// + public double OffsetX + { + get + { + return (double)GetValue(OffsetXProperty); + } + + set + { + SetValue(OffsetXProperty, value); + } + } + + /// + /// Gets or sets the y offset of the drop shadow. + /// + public double OffsetY + { + get + { + return (double)GetValue(OffsetYProperty); + } + + set + { + SetValue(OffsetYProperty, value); + } + } + + /// + /// Gets or sets the z offset of the drop shadow. + /// + public double OffsetZ + { + get + { + return (double)GetValue(OffsetZProperty); + } + + set + { + SetValue(OffsetZProperty, value); + } + } + + /// + /// Gets or sets the opacity of the drop shadow. + /// + public double ShadowOpacity + { + get + { + return (double)GetValue(ShadowOpacityProperty); + } + + set + { + SetValue(ShadowOpacityProperty, value); + } + } + + /// + /// Gets or sets a value indicating whether the panel uses an alpha mask to create a more precise shadow vs. a quicker rectangle shape. + /// + /// + /// Turn this off to lose fidelity and gain performance of the panel. + /// + public bool IsMasked + { + get { return (bool)GetValue(IsMaskedProperty); } + set { SetValue(IsMaskedProperty, value); } + } + + private static void OnBlurRadiusChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && d is DropShadowPanel panel) + { + panel.OnBlurRadiusChanged((double)e.NewValue); + } + } + + private static void OnColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && d is DropShadowPanel panel) + { + panel.OnColorChanged((Color)e.NewValue); + } + } + + private static void OnOffsetXChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && d is DropShadowPanel panel) + { + panel.OnOffsetXChanged((double)e.NewValue); + } + } + + private static void OnOffsetYChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && d is DropShadowPanel panel) + { + panel.OnOffsetYChanged((double)e.NewValue); + } + } + + private static void OnOffsetZChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && d is DropShadowPanel panel) + { + panel.OnOffsetZChanged((double)e.NewValue); + } + } + + private static void OnShadowOpacityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && d is DropShadowPanel panel) + { + panel.OnShadowOpacityChanged((double)e.NewValue); + } + } + + private static void OnIsMaskedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && d is DropShadowPanel panel) + { + panel.UpdateShadowMask(); + } + } + } +} diff --git a/CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml b/CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml new file mode 100644 index 0000000..e1cabbf --- /dev/null +++ b/CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml @@ -0,0 +1,30 @@ + + + + \ No newline at end of file diff --git a/CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml.cs b/CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml.cs new file mode 100644 index 0000000..08ace93 --- /dev/null +++ b/CubeKit.UI/Controls/Toolkit/DropShadowPanel.xaml.cs @@ -0,0 +1,247 @@ +using Microsoft.Toolkit.Uwp.UI; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Numerics; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI; +using Windows.UI.Composition; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Hosting; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; +using Windows.UI.Xaml.Shapes; + +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 + +namespace CubeKit.UI.Controls.Toolkit +{ + /// + /// The control allows the creation of a DropShadow for any Xaml FrameworkElement in markup + /// making it easier to add shadows to Xaml without having to directly drop down to Windows.UI.Composition APIs. + /// + [Obsolete("DropShadowPanel will be removed in a future release, please use the AttachedDropShadow or AttachedCardShadow implementations instead.")] + [TemplatePart(Name = PartShadow, Type = typeof(Border))] + public partial class DropShadowPanel : ContentControl + { + private const string PartShadow = "ShadowElement"; + + private readonly DropShadow _dropShadow; + private readonly SpriteVisual _shadowVisual; + private Border _border; + + /// + /// Initializes a new instance of the class. + /// + public DropShadowPanel() + { + this.DefaultStyleKey = typeof(DropShadowPanel); + + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode) + { + Compositor compositor = ElementCompositionPreview.GetElementVisual(this).Compositor; + + _shadowVisual = compositor.CreateSpriteVisual(); + + _dropShadow = compositor.CreateDropShadow(); + _shadowVisual.Shadow = _dropShadow; + } + } + + /// + /// Update the visual state of the control when its template is changed. + /// + protected override void OnApplyTemplate() + { + if (DesignTimeHelpers.IsRunningInLegacyDesignerMode) + { + return; + } + + _border = GetTemplateChild(PartShadow) as Border; + + if (_border != null) + { + ElementCompositionPreview.SetElementChildVisual(_border, _shadowVisual); + } + + ConfigureShadowVisualForCastingElement(); + + base.OnApplyTemplate(); + } + + /// + protected override void OnContentChanged(object oldContent, object newContent) + { + if (oldContent != null) + { + if (oldContent is FrameworkElement oldElement) + { + oldElement.SizeChanged -= OnSizeChanged; + } + } + + if (newContent != null) + { + if (newContent is FrameworkElement newElement) + { + newElement.SizeChanged += OnSizeChanged; + } + } + + UpdateShadowMask(); + + base.OnContentChanged(oldContent, newContent); + } + + private void OnSizeChanged(object sender, SizeChangedEventArgs e) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode) + { + UpdateShadowSize(); + } + } + + private void ConfigureShadowVisualForCastingElement() + { + UpdateShadowMask(); + + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode) + { + UpdateShadowSize(); + } + } + + private void OnBlurRadiusChanged(double newValue) + { + if (_dropShadow != null) + { + _dropShadow.BlurRadius = (float)newValue; + } + } + + private void OnColorChanged(Color newValue) + { + if (_dropShadow != null) + { + _dropShadow.Color = newValue; + } + } + + private void OnOffsetXChanged(double newValue) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && _dropShadow != null) + { + UpdateShadowOffset((float)newValue, _dropShadow.Offset.Y, _dropShadow.Offset.Z); + } + } + + private void OnOffsetYChanged(double newValue) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && _dropShadow != null) + { + UpdateShadowOffset(_dropShadow.Offset.X, (float)newValue, _dropShadow.Offset.Z); + } + } + + private void OnOffsetZChanged(double newValue) + { + if (!DesignTimeHelpers.IsRunningInLegacyDesignerMode && _dropShadow != null) + { + UpdateShadowOffset(_dropShadow.Offset.X, _dropShadow.Offset.Y, (float)newValue); + } + } + + private void OnShadowOpacityChanged(double newValue) + { + if (_dropShadow != null) + { + _dropShadow.Opacity = (float)newValue; + } + } + + private void UpdateShadowMask() + { + if (DesignTimeHelpers.IsRunningInLegacyDesignerMode) + { + return; + } + + if (Content != null && IsMasked) + { + CompositionBrush mask = null; + + // We check for IAlphaMaskProvider first, to ensure that we use the custom + // alpha mask even if Content happens to extend any of the other classes + if (Content is IAlphaMaskProvider maskedControl) + { + if (maskedControl.WaitUntilLoaded && maskedControl is FrameworkElement element && !element.IsLoaded) + { + element.Loaded += CustomMaskedElement_Loaded; + } + else + { + mask = maskedControl.GetAlphaMask(); + } + } + else if (Content is Image) + { + mask = ((Image)Content).GetAlphaMask(); + } + else if (Content is Shape) + { + mask = ((Shape)Content).GetAlphaMask(); + } + else if (Content is TextBlock) + { + mask = ((TextBlock)Content).GetAlphaMask(); + } + + _dropShadow.Mask = mask; + } + else + { + _dropShadow.Mask = null; + } + } + + private void CustomMaskedElement_Loaded(object sender, RoutedEventArgs e) + { + if (sender is FrameworkElement element) + { + element.Loaded -= CustomMaskedElement_Loaded; + + _dropShadow.Mask = ((IAlphaMaskProvider)element).GetAlphaMask(); + } + } + + private void UpdateShadowOffset(float x, float y, float z) + { + if (_dropShadow != null) + { + _dropShadow.Offset = new Vector3(x, y, z); + } + } + + private void UpdateShadowSize() + { + if (_shadowVisual != null) + { + Vector2 newSize = new Vector2(0, 0); + if (Content is FrameworkElement contentFE) + { + newSize = new Vector2((float)contentFE.ActualWidth, (float)contentFE.ActualHeight); + } + + _shadowVisual.Size = newSize; + } + } + } +} diff --git a/CubeKit.UI/Converters/ColorToSolidColorBrushConverter.cs b/CubeKit.UI/Converters/ColorToSolidColorBrushConverter.cs new file mode 100644 index 0000000..c68e003 --- /dev/null +++ b/CubeKit.UI/Converters/ColorToSolidColorBrushConverter.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.UI; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Media; + +namespace CubeKit.UI.Converters +{ + public class ColorToSolidColorBrushConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) => new SolidColorBrush((Color)value); + + public object ConvertBack(object value, Type targetType, object parameter, string language) => ((SolidColorBrush)value).Color; + } +} diff --git a/CubeKit.UI/CubeKit.UI.csproj b/CubeKit.UI/CubeKit.UI.csproj new file mode 100644 index 0000000..f1c99ca --- /dev/null +++ b/CubeKit.UI/CubeKit.UI.csproj @@ -0,0 +1,219 @@ + + + + + Debug + AnyCPU + {73936751-6325-49CE-8A7B-7006D6135B19} + Library + Properties + CubeKit.UI + CubeKit.UI + en-US + UAP + 10.0.22000.0 + 10.0.18362.0 + 14 + 512 + 9.0 + {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + prompt + 4 + + + x86 + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + false + prompt + + + x86 + bin\x86\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + false + prompt + + + ARM + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + false + prompt + + + ARM + bin\ARM\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + false + prompt + + + ARM64 + true + bin\ARM64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + false + prompt + + + ARM64 + bin\ARM64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + false + prompt + + + x64 + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + false + prompt + + + x64 + bin\x64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + false + prompt + + + PackageReference + + + + + SettingsBlockControl.xaml + + + SettingsDisplayControl.xaml + + + + DropShadowPanel.xaml + + + + AuroraLite.xaml + + + BloomView.xaml + + + + + + + + 1.1.110 + + + 6.2.14 + + + 7.1.3 + + + 7.1.3 + + + 7.1.3 + + + 2.8.5 + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + + + + 14.0 + + + + \ No newline at end of file diff --git a/CubeKit.UI/Materials/AuroraLite.xaml b/CubeKit.UI/Materials/AuroraLite.xaml new file mode 100644 index 0000000..df33f51 --- /dev/null +++ b/CubeKit.UI/Materials/AuroraLite.xaml @@ -0,0 +1,601 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CubeKit.UI/Materials/AuroraLite.xaml.cs b/CubeKit.UI/Materials/AuroraLite.xaml.cs new file mode 100644 index 0000000..ed1062f --- /dev/null +++ b/CubeKit.UI/Materials/AuroraLite.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 + +namespace CubeKit.UI.Materials +{ + public sealed partial class AuroraLite : UserControl + { + public AuroraLite() + { + this.InitializeComponent(); + } + } +} diff --git a/CubeKit.UI/Materials/Bloom.html b/CubeKit.UI/Materials/Bloom.html new file mode 100644 index 0000000..7f9d6ad --- /dev/null +++ b/CubeKit.UI/Materials/Bloom.html @@ -0,0 +1,917 @@ + + + + + + + + + + +
+
+
+
+ [ ] +
+
+
+
+
+
+ [After your PC is ready] +
+
+ [Swipe in from any edge] +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + +
+
+
+ + + + + +
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
+
+
+
+ [After your PC is ready] +
+
+ [With mouse, go to corners] +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + +
+
+
+
+ + + + + + + +
+
+
+
+ + + + + +
+
+
+ + + + + + +
+
+
+
+
+
+
+ [After your PC is ready] +
+
+ [With touch, swipe in from any edge] +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + +
+
+
+ + + + + +
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
+
+
+
+ [After your PC is ready] +
+
+ [With mouse, go to corners] +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + +
+
+
+
+ + + + + + + +
+
+
+
+ + + + + +
+
+
+ + + + + + +
+
+
+
+ +
+ + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/CubeKit.UI/Materials/BloomView.xaml b/CubeKit.UI/Materials/BloomView.xaml new file mode 100644 index 0000000..9d3bafd --- /dev/null +++ b/CubeKit.UI/Materials/BloomView.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/CubeKit.UI/Materials/BloomView.xaml.cs b/CubeKit.UI/Materials/BloomView.xaml.cs new file mode 100644 index 0000000..77c3e5c --- /dev/null +++ b/CubeKit.UI/Materials/BloomView.xaml.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 + +namespace CubeKit.UI.Materials +{ + public sealed partial class BloomView : UserControl + { + public BloomView() + { + this.InitializeComponent(); + BloomWebView.Height = Window.Current.Bounds.Height; + BloomWebView.Width = Window.Current.Bounds.Width; + } + + private void Bloom_SizeChanged(object sender, SizeChangedEventArgs e) + { + BloomWebView.Height = Window.Current.Bounds.Height; + BloomWebView.Width = Window.Current.Bounds.Width; + } + } +} diff --git a/CubeKit.UI/Materials/Windows11Danger.html b/CubeKit.UI/Materials/Windows11Danger.html new file mode 100644 index 0000000..9cde6c0 --- /dev/null +++ b/CubeKit.UI/Materials/Windows11Danger.html @@ -0,0 +1,885 @@ + + + + + + + + + +
+
+
+
+[ ] +
+
+
+
+
+
+[After your PC is ready] +
+
+[Swipe in from any edge] +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + +
+
+
+ + + + + +
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
+
+
+
+[After your PC is ready] +
+
+[With mouse, go to corners] +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + +
+
+
+
+ + + + + + + +
+
+
+
+ + + + + +
+
+
+ + + + + + +
+
+
+
+
+
+
+[After your PC is ready] +
+
+[With touch, swipe in from any edge] +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + +
+
+
+ + + + + +
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
+
+
+
+[After your PC is ready] +
+
+[With mouse, go to corners] +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + +
+
+
+
+ + + + + + + +
+
+
+
+ + + + + +
+
+
+ + + + + + +
+
+
+
+ +
+ + + +
+
+
+
+
+ + + diff --git a/CubeKit.UI/Properties/AssemblyInfo.cs b/CubeKit.UI/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..505e020 --- /dev/null +++ b/CubeKit.UI/Properties/AssemblyInfo.cs @@ -0,0 +1,29 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CubeKit.UI")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CubeKit.UI")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/CubeKit.UI/Properties/CubeKit.UI.rd.xml b/CubeKit.UI/Properties/CubeKit.UI.rd.xml new file mode 100644 index 0000000..d236901 --- /dev/null +++ b/CubeKit.UI/Properties/CubeKit.UI.rd.xml @@ -0,0 +1,33 @@ + + + + + + + + + diff --git a/CubeKit.UI/Services/WindowService.cs b/CubeKit.UI/Services/WindowService.cs new file mode 100644 index 0000000..bd38eea --- /dev/null +++ b/CubeKit.UI/Services/WindowService.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.ApplicationModel.Core; +using Windows.UI; +using Windows.UI.ViewManagement; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Media; + +namespace CubeKit.UI.Services +{ + public static class WindowService + { + private static Border AppTitleBar; + private static TextBlock AppTitle; + + public static void Initialize(Border TitleBar, TextBlock Title) + { + AppTitleBar = TitleBar; + AppTitle = Title; + var titleBar = ApplicationView.GetForCurrentView().TitleBar; + + titleBar.ButtonBackgroundColor = Colors.Transparent; + titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; + + // Hide default title bar. + var coreTitleBar = CoreApplication.GetCurrentView().TitleBar; + coreTitleBar.ExtendViewIntoTitleBar = true; + UpdateTitleBarLayout(coreTitleBar); + + // Set XAML element as a draggable region. + Window.Current.SetTitleBar(AppTitleBar); + + // Register a handler for when the size of the overlaid caption control changes. + // For example, when the app moves to a screen with a different DPI. + coreTitleBar.LayoutMetricsChanged += CoreTitleBar_LayoutMetricsChanged; + + // Register a handler for when the title bar visibility changes. + // For example, when the title bar is invoked in full screen mode. + coreTitleBar.IsVisibleChanged += CoreTitleBar_IsVisibleChanged; + + //Register a handler for when the window changes focus + Window.Current.Activated += Current_Activated; + } + + private static void CoreTitleBar_LayoutMetricsChanged(CoreApplicationViewTitleBar sender, object args) + { + UpdateTitleBarLayout(sender); + } + + private static void UpdateTitleBarLayout(CoreApplicationViewTitleBar coreTitleBar) + { + // Update title bar control size as needed to account for system size changes. + AppTitleBar.Height = coreTitleBar.Height; + + // Ensure the custom title bar does not overlap window caption controls + Thickness currMargin = AppTitleBar.Margin; + AppTitleBar.Margin = new Thickness(currMargin.Left, currMargin.Top, coreTitleBar.SystemOverlayRightInset, currMargin.Bottom); + } + + private static void CoreTitleBar_IsVisibleChanged(CoreApplicationViewTitleBar sender, object args) => AppTitleBar.Visibility = sender.IsVisible ? Visibility.Visible : Visibility.Collapsed; + + // Update the TitleBar based on the inactive/active state of the app + private static void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e) + { + SolidColorBrush defaultForegroundBrush = (SolidColorBrush)Application.Current.Resources["TextFillColorPrimaryBrush"]; + SolidColorBrush inactiveForegroundBrush = (SolidColorBrush)Application.Current.Resources["TextFillColorDisabledBrush"]; + + if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated) + { + AppTitle.Foreground = inactiveForegroundBrush; + } + else + { + AppTitle.Foreground = defaultForegroundBrush; + } + } + } +} diff --git a/CubeKit.UI/Styles/CubeThemeDictionary.xaml b/CubeKit.UI/Styles/CubeThemeDictionary.xaml new file mode 100644 index 0000000..682eb9d --- /dev/null +++ b/CubeKit.UI/Styles/CubeThemeDictionary.xaml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + White + + + + + + + + + + + + + + + + + + + + + + + Black + + + + + + + + + + + + + + + + + + + + White + + + + + + + + + + + + + + + + + diff --git a/CubeKit.UI/Styles/CubeUI.xaml b/CubeKit.UI/Styles/CubeUI.xaml new file mode 100644 index 0000000..18be495 --- /dev/null +++ b/CubeKit.UI/Styles/CubeUI.xaml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + diff --git a/CubeKit.UI/Styles/GlowGradientUI.xaml b/CubeKit.UI/Styles/GlowGradientUI.xaml new file mode 100644 index 0000000..18cb265 --- /dev/null +++ b/CubeKit.UI/Styles/GlowGradientUI.xaml @@ -0,0 +1,4892 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visible + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Project-Radon/Controls/BrowserTab.xaml.cs b/Project-Radon/Controls/BrowserTab.xaml.cs index 37fcce1..fa3a93e 100644 --- a/Project-Radon/Controls/BrowserTab.xaml.cs +++ b/Project-Radon/Controls/BrowserTab.xaml.cs @@ -20,6 +20,7 @@ using Project_Radon.Settings; using Windows.UI.Xaml.Media.Animation; using System.Linq; +using Microsoft.Web.WebView2.Core; namespace Project_Radon.Controls { @@ -58,8 +59,9 @@ public BrowserTab() { InitializeComponent(); - + var options = new CoreWebView2EnvironmentOptions(); + options.AdditionalBrowserArguments = "--edge-webview-optional-enable-uwp-regular-downloads"; WebBrowser.Source = new Uri("edge://radon-ntp"); @@ -75,6 +77,8 @@ public BrowserTab() WebBrowser.CoreWebView2.DocumentTitleChanged += (_, e) => InvokePropertyChanged(); WebBrowser.CoreWebView2.SourceChanged += (_, e) => InvokePropertyChanged(); WebBrowser.CoreWebView2.ContextMenuRequested += async (s, e) => + + { IList menuList = e.MenuItems; if (e.ContextMenuTarget.HasLinkUri) @@ -258,6 +262,11 @@ public void FowardButtonSender() WebBrowser.GoForward(); } } + + public async void Task1() + { + + } public void Reload() { WebBrowser.Reload(); @@ -287,9 +296,9 @@ private void ntpSearchBar_PointerEntered(object sender, Windows.UI.Xaml.Input.Po } - private void profileCenterToggle_Click(object sender, RoutedEventArgs e) + private async void profileCenterToggle_Click(object sender, RoutedEventArgs e) { - + await new UserProfileDialog().ShowAsync(); } } } diff --git a/Project-Radon/Controls/BrowserTabViewItem.xaml b/Project-Radon/Controls/BrowserTabViewItem.xaml index 9bf908f..8e5d602 100644 --- a/Project-Radon/Controls/BrowserTabViewItem.xaml +++ b/Project-Radon/Controls/BrowserTabViewItem.xaml @@ -12,6 +12,12 @@ Background="Transparent" Content="{x:Bind TabContent,Mode=OneWay}" HorizontalAlignment="Center" mc:Ignorable="d" HorizontalContentAlignment="Center" ToolTipService.Placement="Bottom" ToolTipService.PlacementTarget="{x:Bind tooltiptarget}"> + + + + + + diff --git a/Project-Radon/Controls/BrowserTabViewItem.xaml.cs b/Project-Radon/Controls/BrowserTabViewItem.xaml.cs index 89ef179..02b138c 100644 --- a/Project-Radon/Controls/BrowserTabViewItem.xaml.cs +++ b/Project-Radon/Controls/BrowserTabViewItem.xaml.cs @@ -76,5 +76,10 @@ private void Tab_PropertyChanged(object sender, System.ComponentModel.PropertyCh InvokePropertyChanged(); PropertyChanged += Tab_PropertyChanged; } + + private void tabcontext_closetab_Click(object sender, RoutedEventArgs e) + { + + } } } diff --git a/Project-Radon/MainPage.xaml b/Project-Radon/MainPage.xaml index 5b3ad3e..48af520 100644 --- a/Project-Radon/MainPage.xaml +++ b/Project-Radon/MainPage.xaml @@ -4,7 +4,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" - xmlns:winui="using:Microsoft.UI.Xaml.Controls" xmlns:controls="using:Project_Radon.Controls" + xmlns:winui="using:Microsoft.UI.Xaml.Controls" + xmlns:controls="using:Project_Radon.Controls" xmlns:toolkit="using:Microsoft.Toolkit.Uwp.UI.Controls" xmlns:ui="using:Microsoft.Toolkit.Uwp.UI" xmlns:media="using:Microsoft.Toolkit.Uwp.UI.Media" @@ -30,6 +31,7 @@ + @@ -88,7 +90,7 @@ Grid.Column="0" Grid.Row="0" Canvas.ZIndex="1"> - @@ -102,7 +104,7 @@ - + @@ -618,7 +620,7 @@ - + Profile Picture: - + @@ -70,9 +74,9 @@ - diff --git a/Project-Radon/Settings/UserProfileDialog.xaml.cs b/Project-Radon/Settings/UserProfileDialog.xaml.cs index 8f376cd..95501d2 100644 --- a/Project-Radon/Settings/UserProfileDialog.xaml.cs +++ b/Project-Radon/Settings/UserProfileDialog.xaml.cs @@ -53,5 +53,11 @@ private void debug_Click(object sender, RoutedEventArgs e) ApplicationData.Current.LocalSettings.Values["username"] = null; Username_Display.Text = username_box.Text; } + + private void KeyboardAccelerator_Invoked(Windows.UI.Xaml.Input.KeyboardAccelerator sender, Windows.UI.Xaml.Input.KeyboardAcceleratorInvokedEventArgs args) + { + ApplicationData.Current.LocalSettings.Values["username"] = null; + Username_Display.Text = username_box.Text; + } } } diff --git a/Project-Radon/Settings/oobe2.xaml.cs b/Project-Radon/Settings/oobe2.xaml.cs index 3f792c2..a8d274d 100644 --- a/Project-Radon/Settings/oobe2.xaml.cs +++ b/Project-Radon/Settings/oobe2.xaml.cs @@ -57,12 +57,12 @@ public async void setlicensetext() private void Button_Click(object sender, RoutedEventArgs e) { - this.Frame.Navigate(typeof(oobe3),null, new SlideNavigationTransitionInfo() { Effect = SlideNavigationTransitionEffect.FromRight }); + this.Frame.Navigate(typeof(oobe5),null, new SlideNavigationTransitionInfo() { Effect = SlideNavigationTransitionEffect.FromRight }); } private void Button_Click_1(object sender, RoutedEventArgs e) { - this.Frame.Navigate(typeof(oobe1), null, new SlideNavigationTransitionInfo() { Effect = SlideNavigationTransitionEffect.FromLeft }); + this.Frame.GoBack(); } private void CheckBox_Checked(object sender, RoutedEventArgs e) diff --git a/Project-Radon/Settings/oobe5.xaml b/Project-Radon/Settings/oobe5.xaml index 8b4dd67..9e95975 100644 --- a/Project-Radon/Settings/oobe5.xaml +++ b/Project-Radon/Settings/oobe5.xaml @@ -102,7 +102,7 @@ + IsSpellCheckEnabled="False" MaxLength="45" KeyUp="username_textbox_KeyDown"/> @@ -110,8 +110,7 @@ IsSpellCheckEnabled="False" MaxLength="45" KeyDown="email_textbox_KeyDown"/> Fields with * are required. -