1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-09-14 19:32:10 +02:00

Compare commits

...

10 Commits

17 changed files with 109 additions and 40 deletions

View File

@@ -6,6 +6,7 @@ namespace TweetDuck.Configuration{
// public args
public const string ArgDataFolder = "-datafolder";
public const string ArgLogging = "-log";
public const string ArgIgnoreGDPR = "-nogdpr";
// internal args
public const string ArgRestart = "-restart";

View File

@@ -65,7 +65,7 @@ namespace TweetDuck.Core.Notification{
get{
switch(Program.UserConfig.NotificationSize){
default:
return BrowserUtils.Scale(122, SizeScale*(1.0+0.075*FontSizeLevel));
return BrowserUtils.Scale(122, SizeScale*(1.0+0.08*FontSizeLevel));
case TweetNotification.Size.Custom:
return Program.UserConfig.CustomNotificationSize.Height;

View File

@@ -35,7 +35,7 @@ namespace TweetDuck.Core.Notification.Screenshot{
}
using(IFrame frame = args.Browser.MainFrame){
ScriptLoader.ExecuteScript(frame, script.Replace("{width}", BrowserUtils.Scale(width, DpiScale).ToString()), "screenshot");
ScriptLoader.ExecuteScript(frame, script.Replace("{width}", BrowserUtils.Scale(width, DpiScale).ToString()).Replace("{frames}", TweetScreenshotManager.WaitFrames.ToString()), "gen:screenshot");
}
};
@@ -69,6 +69,10 @@ namespace TweetDuck.Core.Notification.Screenshot{
}
}
if (!WindowsUtils.IsAeroEnabled){
MoveToVisibleLocation(); // TODO make this look nicer I guess
}
IntPtr context = NativeMethods.GetDC(this.Handle);
if (context == IntPtr.Zero){

View File

@@ -27,6 +27,10 @@ namespace TweetDuck.Core.Notification.Screenshot{
#if GEN_SCREENSHOT_FRAMES
private readonly Timer debugger;
private int frameCounter;
public const int WaitFrames = 60;
#else
public const int WaitFrames = 5;
#endif
private FormNotificationScreenshotable screenshot;

View File

@@ -4,6 +4,7 @@ using System.Text;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
using TweetDuck.Configuration;
using TweetDuck.Core.Bridge;
using TweetDuck.Core.Controls;
using TweetDuck.Core.Handling;
@@ -154,6 +155,10 @@ namespace TweetDuck.Core{
TweetDeckBridge.ResetStaticProperties();
if (Arguments.HasFlag(Arguments.ArgIgnoreGDPR)){
ScriptLoader.ExecuteScript(frame, @"TD.storage.Account.prototype.requiresConsent = function(){ return false; }", "gen:gdpr");
}
if (Program.UserConfig.FirstRun){
ScriptLoader.ExecuteFile(frame, "introduction.js", browser);
}

View File

@@ -71,6 +71,9 @@ namespace TweetDuck.Core.Utils{
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool BitBlt(IntPtr hdc, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, uint dwRop);
[DllImport("dwmapi.dll")]
public static extern int DwmIsCompositionEnabled(out bool enabled);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool ShowScrollBar(IntPtr hWnd, int wBar, bool bShow);

View File

@@ -15,10 +15,12 @@ namespace TweetDuck.Core.Utils{
private static readonly Lazy<Regex> RegexStripHtmlStyles = new Lazy<Regex>(() => new Regex(@"\s?(?:style|class)="".*?"""), false);
private static readonly Lazy<Regex> RegexOffsetClipboardHtml = new Lazy<Regex>(() => new Regex(@"(?<=EndHTML:|EndFragment:)(\d+)"), false);
private static readonly bool IsWindows8OrNewer;
private static bool HasMicrosoftBeenBroughtTo2008Yet;
public static int CurrentProcessID { get; }
public static bool ShouldAvoidToolWindow { get; }
private static bool HasMicrosoftBeenBroughtTo2008Yet;
public static bool IsAeroEnabled => IsWindows8OrNewer || (NativeMethods.DwmIsCompositionEnabled(out bool isCompositionEnabled) == 0 && isCompositionEnabled);
static WindowsUtils(){
using(Process me = Process.GetCurrentProcess()){
@@ -26,7 +28,9 @@ namespace TweetDuck.Core.Utils{
}
Version ver = Environment.OSVersion.Version;
ShouldAvoidToolWindow = ver.Major == 6 && ver.Minor == 2; // windows 8/10
IsWindows8OrNewer = ver.Major == 6 && ver.Minor == 2; // windows 8/10
ShouldAvoidToolWindow = IsWindows8OrNewer;
}
public static void EnsureTLS12(){

View File

@@ -19,7 +19,7 @@ namespace TweetDuck{
public const string BrandName = "TweetDuck";
public const string Website = "https://tweetduck.chylex.com";
public const string VersionTag = "1.14.1";
public const string VersionTag = "1.14.2";
public static readonly string ProgramPath = AppDomain.CurrentDomain.BaseDirectory;
public static readonly bool IsPortable = File.Exists(Path.Combine(ProgramPath, "makeportable"));

View File

@@ -14,7 +14,7 @@ The program was built using Visual Studio 2017. Before opening the solution, ple
After opening the solution, right-click the solution and select **Restore NuGet Packages**, or manually run this command in the **Package Manager Console**:
```
PM> Install-Package CefSharp.WinForms -Version 66.0.0-CI2615 -Source https://www.myget.org/F/cefsharp/api/v3/index.json
PM> Install-Package CefSharp.WinForms -Version 66.0.0-CI2629 -Source https://www.myget.org/F/cefsharp/api/v3/index.json
```
Note that some pre-release builds of CefSharp are not available on NuGet. To correctly restore packages in that case, open **Package Manager Settings**, and add `https://www.myget.org/F/cefsharp/api/v3/index.json` to the list of package sources.

View File

@@ -99,6 +99,8 @@ enabled(){
// load custom style
var css = window.TDPF_createCustomStyle(this);
css.insert(".js-app-add-column.is-hidden + .clear-columns-btn-all-parent { display: none; }");
css.insert(".column-header-links { min-width: 51px !important; }");
css.insert("[data-td-icon='icon-message'] .column-header-links { min-width: 110px !important; }");
css.insert(".column-navigator-overflow .clear-columns-btn-all-parent { display: none !important; }");
css.insert(".column-navigator-overflow { bottom: 224px !important; }");
css.insert("[data-action='td-clearcolumns-dosingle'] { padding: 3px 0 !important; }");

View File

@@ -23,25 +23,34 @@ enabled(){
return;
}
var section = data.element.closest("section.js-column");
let section = data.element.closest("section.js-column");
let column = TD.controller.columnManager.get(section.attr("data-column"));
var column = TD.controller.columnManager.get(section.attr("data-column"));
var header = $(".column-title", section);
var title = header.children(".column-head-title");
let feeds = column.getFeeds();
let accountText = "";
var columnTitle, columnAccount;
if (feeds.length === 1){
let metadata = feeds[0].getMetadata();
let id = metadata.ownerId || metadata.id;
if (title.length){
columnTitle = title.text();
columnAccount = header.children(".attribution").text();
if (id){
accountText = TD.cache.names.getScreenName(id);
}
else{
columnTitle = header.children(".column-title-edit-box").val();
columnAccount = "";
let account = TD.storage.accountController.get(feeds[0].getAccountKey());
if (account){
accountText = "@"+account.getUsername();
}
}
}
let header = $(".column-header-title", section);
let title = header.children(".column-heading");
let titleText = title.length ? title.text() : header.children(".column-title-edit-box").val();
try{
query = configuration.customSelector(columnTitle, columnAccount, column, section.hasClass("column-temp"));
query = configuration.customSelector(titleText, accountText, column, section.hasClass("column-temp"));
}catch(e){
$TD.alert("warning", "Plugin reply-account has invalid configuration: customSelector threw an error: "+e.message);
return;

View File

@@ -707,6 +707,12 @@
}
}
let gif = html.find(".js-media-gif-container");
if (gif.length){
gif.css("background-image", 'url("'+chirp.getMedia()[0].small()+'")');
}
let type = chirp.getChirpType();
if ((type.startsWith("favorite") || type.startsWith("retweet")) && chirp.isAboutYou()){
@@ -1368,11 +1374,19 @@
}
//
// Block: Remove column mouse wheel handler, which allows smooth scrolling inside columns, and horizontally scrolling column container when holding Shift.
// Block: Fix broken horizontal scrolling of column container when holding Shift. TODO Fix broken smooth scrolling.
//
if (ensurePropertyExists(TD, "ui", "columns", "setupColumnScrollListeners")){
TD.ui.columns.setupColumnScrollListeners = appendToFunction(TD.ui.columns.setupColumnScrollListeners, function(e){
$(".js-column[data-column='"+e.model.getKey()+"']").off("mousewheel onmousewheel");
TD.ui.columns.setupColumnScrollListeners = appendToFunction(TD.ui.columns.setupColumnScrollListeners, function(column){
let ele = $(".js-column[data-column='"+column.model.getKey()+"']");
ele.off("onmousewheel").on("mousewheel", ".scroll-v", function(e){
if (e.shiftKey){
e.stopImmediatePropagation();
}
});
window.TDGF_prioritizeNewestEvent(ele[0], "mousewheel");
});
}

View File

@@ -10,7 +10,7 @@
let avatarBottom = avatar ? avatar.getBoundingClientRect().bottom : 0;
$TD.setHeight(Math.floor(Math.max(contentHeight, avatarBottom+9))).then(() => {
let framesLeft = 5; // basic render is done in 1 frame, large media take longer
let framesLeft = {frames}; // basic render is done in 1 frame, large media take longer
let onNextFrame = function(){
if (--framesLeft < 0){

View File

@@ -221,6 +221,29 @@ a[data-full-url] {
bottom: 0 !important;
}
/**********************************************************/
/* Prevent column icons from being hidden by column title */
/**********************************************************/
.column-header-title {
overflow: hidden !important;
}
.column-heading {
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.column-header-links {
max-width: 100% !important;
}
[data-td-icon="icon-message"] .column-header-links {
min-width: 86px;
}
/*******************************************/
/* Fix general visual issues or annoyances */
/*******************************************/

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\CefSharp.WinForms.66.0.0-CI2615\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.66.0.0-CI2615\build\CefSharp.WinForms.props')" />
<Import Project="packages\CefSharp.Common.66.0.0-CI2615\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.66.0.0-CI2615\build\CefSharp.Common.props')" />
<Import Project="packages\cef.redist.x86.3.3359.1769\build\cef.redist.x86.props" Condition="Exists('packages\cef.redist.x86.3.3359.1769\build\cef.redist.x86.props')" />
<Import Project="packages\cef.redist.x64.3.3359.1769\build\cef.redist.x64.props" Condition="Exists('packages\cef.redist.x64.3.3359.1769\build\cef.redist.x64.props')" />
<Import Project="packages\CefSharp.WinForms.66.0.0-CI2629\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.66.0.0-CI2629\build\CefSharp.WinForms.props')" />
<Import Project="packages\CefSharp.Common.66.0.0-CI2629\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.66.0.0-CI2629\build\CefSharp.Common.props')" />
<Import Project="packages\cef.redist.x86.3.3359.1772\build\cef.redist.x86.props" Condition="Exists('packages\cef.redist.x86.3.3359.1772\build\cef.redist.x86.props')" />
<Import Project="packages\cef.redist.x64.3.3359.1772\build\cef.redist.x64.props" Condition="Exists('packages\cef.redist.x64.3.3359.1772\build\cef.redist.x64.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -446,11 +446,11 @@ powershell -ExecutionPolicy Unrestricted -File "$(ProjectDir)Resources\PostBuild
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\cef.redist.x64.3.3359.1769\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x64.3.3359.1769\build\cef.redist.x64.props'))" />
<Error Condition="!Exists('packages\cef.redist.x86.3.3359.1769\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x86.3.3359.1769\build\cef.redist.x86.props'))" />
<Error Condition="!Exists('packages\CefSharp.Common.66.0.0-CI2615\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.66.0.0-CI2615\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('packages\CefSharp.Common.66.0.0-CI2615\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.66.0.0-CI2615\build\CefSharp.Common.targets'))" />
<Error Condition="!Exists('packages\CefSharp.WinForms.66.0.0-CI2615\build\CefSharp.WinForms.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.WinForms.66.0.0-CI2615\build\CefSharp.WinForms.props'))" />
<Error Condition="!Exists('packages\cef.redist.x64.3.3359.1772\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x64.3.3359.1772\build\cef.redist.x64.props'))" />
<Error Condition="!Exists('packages\cef.redist.x86.3.3359.1772\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\cef.redist.x86.3.3359.1772\build\cef.redist.x86.props'))" />
<Error Condition="!Exists('packages\CefSharp.Common.66.0.0-CI2629\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.66.0.0-CI2629\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('packages\CefSharp.Common.66.0.0-CI2629\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.Common.66.0.0-CI2629\build\CefSharp.Common.targets'))" />
<Error Condition="!Exists('packages\CefSharp.WinForms.66.0.0-CI2629\build\CefSharp.WinForms.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\CefSharp.WinForms.66.0.0-CI2629\build\CefSharp.WinForms.props'))" />
</Target>
<Import Project="packages\CefSharp.Common.66.0.0-CI2615\build\CefSharp.Common.targets" Condition="Exists('packages\CefSharp.Common.66.0.0-CI2615\build\CefSharp.Common.targets')" />
<Import Project="packages\CefSharp.Common.66.0.0-CI2629\build\CefSharp.Common.targets" Condition="Exists('packages\CefSharp.Common.66.0.0-CI2629\build\CefSharp.Common.targets')" />
</Project>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.redist.x64" version="3.3359.1769" targetFramework="net452" />
<package id="cef.redist.x86" version="3.3359.1769" targetFramework="net452" />
<package id="CefSharp.Common" version="66.0.0-CI2615" targetFramework="net452" />
<package id="CefSharp.WinForms" version="66.0.0-CI2615" targetFramework="net452" />
<package id="cef.redist.x64" version="3.3359.1772" targetFramework="net452" />
<package id="cef.redist.x86" version="3.3359.1772" targetFramework="net452" />
<package id="CefSharp.Common" version="66.0.0-CI2629" targetFramework="net452" />
<package id="CefSharp.WinForms" version="66.0.0-CI2629" targetFramework="net452" />
</packages>

View File

@@ -28,7 +28,7 @@
<ItemGroup>
<Reference Include="CefSharp.BrowserSubprocess.Core, Version=66.0.0.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\CefSharp.Common.66.0.0-CI2615\CefSharp\x86\CefSharp.BrowserSubprocess.Core.dll</HintPath>
<HintPath>..\packages\CefSharp.Common.66.0.0-CI2629\CefSharp\x86\CefSharp.BrowserSubprocess.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>