diff --git a/Core/TweetDeckBrowser.cs b/Core/TweetDeckBrowser.cs index 8136754e..7aef666d 100644 --- a/Core/TweetDeckBrowser.cs +++ b/Core/TweetDeckBrowser.cs @@ -65,6 +65,7 @@ public TweetDeckBrowser(FormBrowser owner, PluginManager plugins, TweetDeckBridg this.browser.Location = ControlExtensions.InvisibleLocation; this.browser.SetupResourceHandler(TweetNotification.AppLogoLink, TweetNotification.AppLogoHandler); + this.browser.SetupResourceHandler(TwitterUtils.SpinnerLink, TwitterUtils.SpinnerHandler); owner.Controls.Add(browser); @@ -127,7 +128,7 @@ private void browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e){ private void browser_FrameLoadEnd(object sender, FrameLoadEndEventArgs e){ if (e.Frame.IsMain && TwitterUtils.IsTweetDeckWebsite(e.Frame)){ - e.Frame.ExecuteJavaScriptAsync(TwitterUtils.BackgroundColorFix); + e.Frame.ExecuteJavaScriptAsync(TwitterUtils.OverrideScript); UpdateProperties(); TweetDeckBridge.RestoreSessionData(e.Frame); diff --git a/Core/Utils/TwitterUtils.cs b/Core/Utils/TwitterUtils.cs index cb284d8f..8f60c5a4 100644 --- a/Core/Utils/TwitterUtils.cs +++ b/Core/Utils/TwitterUtils.cs @@ -12,7 +12,11 @@ static class TwitterUtils{ public const string TweetDeckURL = "https://tweetdeck.twitter.com"; public static readonly Color BackgroundColor = Color.FromArgb(28, 99, 153); - public const string BackgroundColorFix = "let e=document.createElement('style');document.head.appendChild(e);e.innerHTML='body::before{background:#1c6399!important}'"; + + public static readonly IResourceHandler SpinnerHandler = ResourceHandler.FromByteArray(Properties.Resources.spinner, "image/apng"); + public const string SpinnerLink = "https://ton.twimg.com/tduck/spinner"; + + public const string OverrideScript = "let e=document.createElement('style');document.head.appendChild(e);e.innerHTML='body,body::before{background:#1c6399!important}';e=document.querySelector('.js-signin-ui img');if(e)e.src='"+SpinnerLink+"'"; private static readonly Lazy<Regex> RegexAccountLazy = new Lazy<Regex>(() => new Regex(@"^https?://twitter\.com/(?!signup$|tos$|privacy$)([^/]+)/?$", RegexOptions.Compiled), false); public static Regex RegexAccount => RegexAccountLazy.Value; diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index b2731f44..20c91403 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -99,5 +99,15 @@ internal static System.Drawing.Icon icon_tray_new { return ((System.Drawing.Icon)(obj)); } } + + /// <summary> + /// Looks up a localized resource of type System.Byte[]. + /// </summary> + internal static byte[] spinner { + get { + object obj = ResourceManager.GetObject("spinner", resourceCulture); + return ((byte[])(obj)); + } + } } } diff --git a/Properties/Resources.resx b/Properties/Resources.resx index d01687dc..a8d8f0ef 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -130,4 +130,7 @@ <data name="icon_tray_new" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\icon-tray-new.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="spinner" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\spinner.apng;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </data> </root> \ No newline at end of file diff --git a/Resources/Plugins/edit-design/theme.black.css b/Resources/Plugins/edit-design/theme.black.css index 4a2bf237..c713b08c 100644 --- a/Resources/Plugins/edit-design/theme.black.css +++ b/Resources/Plugins/edit-design/theme.black.css @@ -1,7 +1,5 @@ html.dark{color:#e1e8ed} html.dark .is-inverted-dark .stream-item{background-color:#fff} -html.dark body{background-color:#1c6399} -html.dark body:before{background-image:radial-gradient(circle,#1c6399,#274256)} html.dark::selection{background:#e1e8ed;color:#111} html.dark a{color:#8bd} html.dark a:hover,html.dark a:focus,html.dark a:active{color:#8bd} diff --git a/Resources/spinner.apng b/Resources/spinner.apng new file mode 100644 index 00000000..235c1380 Binary files /dev/null and b/Resources/spinner.apng differ diff --git a/TweetDuck.csproj b/TweetDuck.csproj index 250bb150..395b1263 100644 --- a/TweetDuck.csproj +++ b/TweetDuck.csproj @@ -356,6 +356,7 @@ <None Include="Resources\icon-tray-new.ico" /> <None Include="Resources\icon-tray.ico" /> <None Include="Resources\PostBuild.ps1" /> + <None Include="Resources\spinner.apng" /> </ItemGroup> <ItemGroup> <Folder Include="Resources\Plugins\" />