1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2024-11-25 23:42:46 +01:00

Compare commits

..

No commits in common. "c303346bc33fc1f789c93cef7255a719045c3c6d" and "9953f06ab17689565ab8233a1e75be4af0c55d2c" have entirely different histories.

25 changed files with 42 additions and 66 deletions

1
.gitignore vendored
View File

@ -12,7 +12,6 @@ bld/*
# Rider
**/.idea/dictionaries
**/.idea/misc.xml
**/.idea/riderMarkupCache.xml
# User-specific files
*.suo

View File

@ -12,7 +12,7 @@
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
<option name="PROJECT_KIND" value="DotNetCore" />
<option name="PROJECT_TFM" value="net7.0-windows" />
<option name="PROJECT_TFM" value="net6.0-windows7.0" />
<method v="2">
<option name="Build" />
</method>

View File

@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.0",
"version": "6.0.0",
"rollForward": "latestMinor",
"allowPrerelease": false
}

View File

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x86;x64</Platforms>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

View File

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x86;x64</Platforms>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

View File

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Platforms>x86</Platforms>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

View File

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x86;x64</Platforms>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

View File

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x86;x64</Platforms>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Platforms>x86</Platforms>
<RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers>
</PropertyGroup>

View File

@ -7,7 +7,7 @@ open Xunit
module RegexAccount =
module IsMatch =
let isMatch: string -> bool = TwitterUrls.RegexAccount.IsMatch
let isMatch = TwitterUrls.RegexAccount.IsMatch
[<Fact>]
let ``accepts HTTP protocol`` () =

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Platforms>x86</Platforms>
<RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers>
</PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Platforms>x86</Platforms>
<RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers>
</PropertyGroup>

View File

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x64</Platforms>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<OutputType>WinExe</OutputType>
<Nullable>enable</Nullable>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>

View File

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x64</Platforms>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

View File

@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.0",
"version": "6.0.0",
"rollForward": "latestMinor",
"allowPrerelease": false
}

View File

@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x86</Platforms>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
@ -33,7 +33,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CefSharp.WinForms.NETCore" Version="107.1.90" />
<PackageReference Include="CefSharp.WinForms.NETCore" Version="105.3.330" />
</ItemGroup>
<ItemGroup>

View File

@ -23,7 +23,7 @@ public void AttachTooltip(Control control, bool followCursor, Func<MouseEventArg
string? text = tooltipFunc(args);
if (text == null || control.Parent == null) {
if (text == null) {
Visible = false;
return;
}

View File

@ -28,7 +28,7 @@ protected override void OnPaint(PaintEventArgs e) {
brushFore.Color = ForeColor;
brushHover.Color = Color.FromArgb(128, ForeColor);
brushOverlap.Color = Color.FromArgb(80 + ForeColor.R * 11 / 16, 80 + ForeColor.G * 11 / 16, 80 + ForeColor.B * 11 / 16);
brushBack.Color = Parent?.BackColor ?? Color.Black;
brushBack.Color = Parent.BackColor;
}
Rectangle rect = new Rectangle(0, 0, Width, Height);

View File

@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x86</Platforms>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

View File

@ -95,8 +95,8 @@ public static void Restore(this WindowState state, Form form, bool firstTimeFull
form.WindowState = state.IsMaximized ? FormWindowState.Maximized : FormWindowState.Normal;
}
if (((state.Bounds == Rectangle.Empty && firstTimeFullscreen) || form.IsFullyOutsideView()) && Screen.PrimaryScreen is {} primaryScreen) {
form.DesktopBounds = primaryScreen.WorkingArea;
if ((state.Bounds == Rectangle.Empty && firstTimeFullscreen) || form.IsFullyOutsideView()) {
form.DesktopBounds = Screen.PrimaryScreen.WorkingArea;
form.WindowState = FormWindowState.Maximized;
state.Save(form);
}

View File

@ -28,7 +28,7 @@ public FormAbout() {
}
private void OnLinkClicked(object? sender, LinkLabelLinkClickedEventArgs e) {
App.SystemHandler.OpenBrowser(e.Link?.LinkData as string);
App.SystemHandler.OpenBrowser(e.Link.LinkData as string);
}
private void FormAbout_HelpRequested(object? sender, HelpEventArgs hlpevent) {

View File

@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x86</Platforms>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
@ -36,7 +36,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CefSharp.WinForms.NETCore" Version="107.1.90" />
<PackageReference Include="CefSharp.WinForms.NETCore" Version="105.3.330" />
</ItemGroup>
<ItemGroup>

View File

@ -1,4 +1,3 @@
using System.Diagnostics;
using CefSharp;
using CefSharp.Handler;
using TweetImpl.CefSharp.Adapters;
@ -8,11 +7,11 @@ namespace TweetImpl.CefSharp.Handlers {
sealed class CefRequestHandler : RequestHandler {
public RequestHandlerLogic<IRequest> Logic { get; }
private readonly AutoReloader? autoReloader;
private readonly bool autoReload;
public CefRequestHandler(CefLifeSpanHandler lifeSpanHandler, bool autoReload) {
this.Logic = new RequestHandlerLogic<IRequest>(CefRequestAdapter.Instance, lifeSpanHandler.Logic);
this.autoReloader = autoReload ? new AutoReloader() : null;
this.autoReload = autoReload;
}
protected override bool OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool userGesture, bool isRedirect) {
@ -24,31 +23,9 @@ protected override bool OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser br
}
protected override void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status) {
if (autoReloader?.RequestReload() == true) {
if (autoReload) {
browser.Reload();
}
}
private sealed class AutoReloader {
private readonly Stopwatch lastReload = Stopwatch.StartNew();
private int rapidReloadCount;
public bool RequestReload() {
if (rapidReloadCount >= 2) {
lastReload.Stop();
return false;
}
if (lastReload.ElapsedMilliseconds < 5000) {
++rapidReloadCount;
}
else {
rapidReloadCount = 0;
}
lastReload.Restart();
return true;
}
}
}
}

View File

@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x86</Platforms>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
@ -28,7 +28,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CefSharp.WinForms.NETCore" Version="107.1.90" />
<PackageReference Include="CefSharp.WinForms.NETCore" Version="105.3.330" />
</ItemGroup>
<ItemGroup>

View File

@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<Configurations>Debug;Release</Configurations>
<Platforms>x86</Platforms>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<LangVersion>11</LangVersion>
<LangVersion>10</LangVersion>
<Nullable>disable</Nullable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>