mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-14 21:15:48 +02:00
Restore loading background color and spinner from before the TweetDeck update
This commit is contained in:
parent
a60be2afcc
commit
07d29207f0
@ -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);
|
||||
|
@ -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;
|
||||
|
10
Properties/Resources.Designer.cs
generated
10
Properties/Resources.Designer.cs
generated
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
@ -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}
|
||||
|
BIN
Resources/spinner.apng
Normal file
BIN
Resources/spinner.apng
Normal file
Binary file not shown.
After (image error) Size: 12 KiB |
@ -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\" />
|
||||
|
Loading…
Reference in New Issue
Block a user