mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-09-14 19:32:10 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
1bf9e7fb56 | |||
ca69554f37 | |||
cf7029037e | |||
418388b0ab | |||
a0f8689d4f | |||
95007bdd26 | |||
ab91540deb | |||
b2ebb984f8 | |||
f7e9ad74d1 | |||
d48da3d51c | |||
76d22554c5 |
3
.github/FUNDING.yml
vendored
3
.github/FUNDING.yml
vendored
@@ -1,4 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: chylex
|
||||
patreon: chylex
|
||||
ko_fi: chylex
|
||||
|
@@ -2,7 +2,7 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Windows.Forms;
|
||||
using TweetDuck.Controls;
|
||||
using TweetLib.Core.Features.Updates;
|
||||
using TweetLib.Core.Systems.Updates;
|
||||
|
||||
namespace TweetDuck.Browser.Bridge{
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
|
@@ -20,7 +20,7 @@ using TweetDuck.Updates;
|
||||
using TweetDuck.Utils;
|
||||
using TweetLib.Core.Features.Plugins;
|
||||
using TweetLib.Core.Features.Plugins.Events;
|
||||
using TweetLib.Core.Features.Updates;
|
||||
using TweetLib.Core.Systems.Updates;
|
||||
|
||||
namespace TweetDuck.Browser{
|
||||
sealed partial class FormBrowser : Form, AnalyticsFile.IProvider{
|
||||
@@ -48,10 +48,13 @@ namespace TweetDuck.Browser{
|
||||
|
||||
public AnalyticsFile AnalyticsFile => analytics?.File ?? AnalyticsFile.Dummy;
|
||||
|
||||
#pragma warning disable IDE0069 // Disposable fields should be disposed
|
||||
private readonly TweetDeckBrowser browser;
|
||||
private readonly FormNotificationTweet notification;
|
||||
#pragma warning restore IDE0069 // Disposable fields should be disposed
|
||||
|
||||
private readonly PluginManager plugins;
|
||||
private readonly UpdateHandler updates;
|
||||
private readonly FormNotificationTweet notification;
|
||||
private readonly ContextMenu contextMenu;
|
||||
private readonly UpdateBridge updateBridge;
|
||||
|
||||
@@ -90,6 +93,7 @@ namespace TweetDuck.Browser{
|
||||
Disposed += (sender, args) => {
|
||||
Config.MuteToggled -= Config_MuteToggled;
|
||||
Config.TrayBehaviorChanged -= Config_TrayBehaviorChanged;
|
||||
browser.Dispose();
|
||||
};
|
||||
|
||||
Config.MuteToggled += Config_MuteToggled;
|
||||
@@ -115,9 +119,7 @@ namespace TweetDuck.Browser{
|
||||
if (disposing){
|
||||
components?.Dispose();
|
||||
|
||||
browser.Dispose();
|
||||
updates.Dispose();
|
||||
notification.Dispose();
|
||||
contextMenu.Dispose();
|
||||
|
||||
notificationScreenshotManager?.Dispose();
|
||||
|
@@ -103,7 +103,10 @@ namespace TweetDuck.Browser.Notification{
|
||||
protected double SizeScale => DpiScale * Config.ZoomLevel / 100.0;
|
||||
|
||||
protected readonly FormBrowser owner;
|
||||
|
||||
#pragma warning disable IDE0069 // Disposable fields should be disposed
|
||||
protected readonly ChromiumWebBrowser browser;
|
||||
#pragma warning restore IDE0069 // Disposable fields should be disposed
|
||||
|
||||
private readonly ResourceHandlerNotification resourceHandler = new ResourceHandlerNotification();
|
||||
|
||||
@@ -144,7 +147,11 @@ namespace TweetDuck.Browser.Notification{
|
||||
this.browser.SetupZoomEvents();
|
||||
|
||||
Controls.Add(browser);
|
||||
Disposed += (sender, args) => this.owner.FormClosed -= owner_FormClosed;
|
||||
|
||||
Disposed += (sender, args) => {
|
||||
this.owner.FormClosed -= owner_FormClosed;
|
||||
this.browser.Dispose();
|
||||
};
|
||||
|
||||
DpiScale = this.GetDPIScale();
|
||||
|
||||
@@ -155,7 +162,6 @@ namespace TweetDuck.Browser.Notification{
|
||||
protected override void Dispose(bool disposing){
|
||||
if (disposing){
|
||||
components?.Dispose();
|
||||
browser.Dispose();
|
||||
resourceHandler.Dispose();
|
||||
}
|
||||
|
||||
|
@@ -25,6 +25,8 @@ namespace TweetDuck.Browser.Notification{
|
||||
private IntPtr mouseHook;
|
||||
private bool blockXButtonUp;
|
||||
|
||||
private int currentOpacity;
|
||||
|
||||
private bool? prevDisplayTimer;
|
||||
private int? prevFontSize;
|
||||
|
||||
@@ -81,6 +83,15 @@ namespace TweetDuck.Browser.Notification{
|
||||
Disposed += (sender, args) => StopMouseHook(true);
|
||||
}
|
||||
|
||||
// helpers
|
||||
|
||||
private void SetOpacity(int opacity){
|
||||
if (currentOpacity != opacity){
|
||||
currentOpacity = opacity;
|
||||
Opacity = opacity / 100.0;
|
||||
}
|
||||
}
|
||||
|
||||
// mouse wheel hook
|
||||
|
||||
private void StartMouseHook(){
|
||||
@@ -170,9 +181,11 @@ namespace TweetDuck.Browser.Notification{
|
||||
|
||||
if (isCursorInside){
|
||||
StartMouseHook();
|
||||
SetOpacity(100);
|
||||
}
|
||||
else{
|
||||
StopMouseHook(false);
|
||||
SetOpacity(Config.NotificationWindowOpacity);
|
||||
}
|
||||
|
||||
if (isCursorInside || FreezeTimer || ContextMenuOpen){
|
||||
@@ -265,6 +278,7 @@ namespace TweetDuck.Browser.Notification{
|
||||
SetNotificationSize(BaseClientWidth, BaseClientHeight);
|
||||
}
|
||||
|
||||
SetOpacity(IsCursorOverBrowser ? 100 : Config.NotificationWindowOpacity);
|
||||
MoveToVisibleLocation();
|
||||
}
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using TweetDuck.Browser.Data;
|
||||
using TweetLib.Core.Features.Configuration;
|
||||
using TweetLib.Core.Features.Plugins.Config;
|
||||
using TweetLib.Core.Serialization.Converters;
|
||||
using TweetLib.Core.Systems.Configuration;
|
||||
using TweetLib.Core.Utils;
|
||||
|
||||
namespace TweetDuck.Configuration{
|
||||
|
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TweetLib.Core.Features.Configuration;
|
||||
using TweetLib.Core.Features.Plugins;
|
||||
using TweetLib.Core.Features.Plugins.Config;
|
||||
using TweetLib.Core.Features.Plugins.Events;
|
||||
using TweetLib.Core.Systems.Configuration;
|
||||
|
||||
namespace TweetDuck.Configuration{
|
||||
sealed class PluginConfig : BaseConfig, IPluginConfig{
|
||||
|
@@ -1,4 +1,4 @@
|
||||
using TweetLib.Core.Features.Configuration;
|
||||
using TweetLib.Core.Systems.Configuration;
|
||||
|
||||
namespace TweetDuck.Configuration{
|
||||
sealed class SystemConfig : BaseConfig{
|
||||
|
@@ -3,9 +3,9 @@ using System.Drawing;
|
||||
using TweetDuck.Browser;
|
||||
using TweetDuck.Browser.Data;
|
||||
using TweetDuck.Controls;
|
||||
using TweetLib.Core.Features.Configuration;
|
||||
using TweetLib.Core.Features.Notifications;
|
||||
using TweetLib.Core.Features.Twitter;
|
||||
using TweetLib.Core.Systems.Configuration;
|
||||
|
||||
namespace TweetDuck.Configuration{
|
||||
sealed class UserConfig : BaseConfig{
|
||||
@@ -65,6 +65,7 @@ namespace TweetDuck.Configuration{
|
||||
public Point CustomNotificationPosition { get; set; } = ControlExtensions.InvisibleLocation;
|
||||
public int NotificationDisplay { get; set; } = 0;
|
||||
public int NotificationEdgeDistance { get; set; } = 8;
|
||||
public int NotificationWindowOpacity { get; set; } = 100;
|
||||
|
||||
public DesktopNotification.Size NotificationSize { get; set; } = DesktopNotification.Size.Auto;
|
||||
public Size CustomNotificationSize { get; set; } = Size.Empty;
|
||||
|
@@ -56,7 +56,10 @@ namespace TweetDuck.Dialogs{
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning disable IDE0069 // Disposable fields should be disposed
|
||||
private readonly ChromiumWebBrowser browser;
|
||||
#pragma warning restore IDE0069 // Disposable fields should be disposed
|
||||
|
||||
private string nextUrl;
|
||||
|
||||
private FormGuide(string url, FormBrowser owner){
|
||||
@@ -87,12 +90,12 @@ namespace TweetDuck.Dialogs{
|
||||
browser.SetupZoomEvents();
|
||||
|
||||
Controls.Add(browser);
|
||||
Disposed += (sender, args) => browser.Dispose();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing){
|
||||
if (disposing){
|
||||
components?.Dispose();
|
||||
browser.Dispose();
|
||||
}
|
||||
|
||||
base.Dispose(disposing);
|
||||
|
@@ -12,7 +12,7 @@ using TweetDuck.Management;
|
||||
using TweetDuck.Management.Analytics;
|
||||
using TweetDuck.Utils;
|
||||
using TweetLib.Core.Features.Plugins;
|
||||
using TweetLib.Core.Features.Updates;
|
||||
using TweetLib.Core.Systems.Updates;
|
||||
|
||||
namespace TweetDuck.Dialogs{
|
||||
sealed partial class FormSettings : Form, FormManager.IAppDialog{
|
||||
|
4
Dialogs/Settings/TabSettingsGeneral.Designer.cs
generated
4
Dialogs/Settings/TabSettingsGeneral.Designer.cs
generated
@@ -115,7 +115,7 @@
|
||||
//
|
||||
this.labelZoomValue.BackColor = System.Drawing.Color.Transparent;
|
||||
this.labelZoomValue.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.labelZoomValue.Location = new System.Drawing.Point(147, 4);
|
||||
this.labelZoomValue.Location = new System.Drawing.Point(176, 4);
|
||||
this.labelZoomValue.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.labelZoomValue.Name = "labelZoomValue";
|
||||
this.labelZoomValue.Size = new System.Drawing.Size(38, 13);
|
||||
@@ -156,7 +156,7 @@
|
||||
this.trackBarZoom.Maximum = 200;
|
||||
this.trackBarZoom.Minimum = 50;
|
||||
this.trackBarZoom.Name = "trackBarZoom";
|
||||
this.trackBarZoom.Size = new System.Drawing.Size(148, 30);
|
||||
this.trackBarZoom.Size = new System.Drawing.Size(177, 30);
|
||||
this.trackBarZoom.SmallChange = 5;
|
||||
this.trackBarZoom.TabIndex = 0;
|
||||
this.trackBarZoom.TickFrequency = 25;
|
||||
|
@@ -5,7 +5,7 @@ using System.Windows.Forms;
|
||||
using TweetDuck.Browser.Handling.General;
|
||||
using TweetDuck.Controls;
|
||||
using TweetDuck.Utils;
|
||||
using TweetLib.Core.Features.Updates;
|
||||
using TweetLib.Core.Systems.Updates;
|
||||
using TweetLib.Core.Utils;
|
||||
|
||||
namespace TweetDuck.Dialogs.Settings{
|
||||
|
@@ -65,6 +65,10 @@
|
||||
this.panelSize = new System.Windows.Forms.Panel();
|
||||
this.durationUpdateTimer = new System.Windows.Forms.Timer(this.components);
|
||||
this.flowPanelLeft = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.labelOpacity = new System.Windows.Forms.Label();
|
||||
this.panelOpacity = new System.Windows.Forms.Panel();
|
||||
this.labelOpacityValue = new System.Windows.Forms.Label();
|
||||
this.trackBarOpacity = new System.Windows.Forms.TrackBar();
|
||||
this.panelScrollSpeed = new System.Windows.Forms.Panel();
|
||||
this.flowPanelRight = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.panelSeparator = new System.Windows.Forms.Panel();
|
||||
@@ -77,6 +81,8 @@
|
||||
this.panelTimer.SuspendLayout();
|
||||
this.panelSize.SuspendLayout();
|
||||
this.flowPanelLeft.SuspendLayout();
|
||||
this.panelOpacity.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBarOpacity)).BeginInit();
|
||||
this.panelScrollSpeed.SuspendLayout();
|
||||
this.flowPanelRight.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@@ -84,7 +90,7 @@
|
||||
// labelEdgeDistanceValue
|
||||
//
|
||||
this.labelEdgeDistanceValue.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.labelEdgeDistanceValue.Location = new System.Drawing.Point(145, 4);
|
||||
this.labelEdgeDistanceValue.Location = new System.Drawing.Point(175, 4);
|
||||
this.labelEdgeDistanceValue.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.labelEdgeDistanceValue.Name = "labelEdgeDistanceValue";
|
||||
this.labelEdgeDistanceValue.Size = new System.Drawing.Size(40, 15);
|
||||
@@ -193,7 +199,7 @@
|
||||
this.trackBarEdgeDistance.Maximum = 40;
|
||||
this.trackBarEdgeDistance.Minimum = 8;
|
||||
this.trackBarEdgeDistance.Name = "trackBarEdgeDistance";
|
||||
this.trackBarEdgeDistance.Size = new System.Drawing.Size(148, 30);
|
||||
this.trackBarEdgeDistance.Size = new System.Drawing.Size(177, 30);
|
||||
this.trackBarEdgeDistance.SmallChange = 2;
|
||||
this.trackBarEdgeDistance.TabIndex = 0;
|
||||
this.trackBarEdgeDistance.TickFrequency = 4;
|
||||
@@ -208,12 +214,12 @@
|
||||
this.tableLayoutDurationButtons.Controls.Add(this.btnDurationMedium, 0, 0);
|
||||
this.tableLayoutDurationButtons.Controls.Add(this.btnDurationLong, 1, 0);
|
||||
this.tableLayoutDurationButtons.Controls.Add(this.btnDurationShort, 0, 0);
|
||||
this.tableLayoutDurationButtons.Location = new System.Drawing.Point(3, 353);
|
||||
this.tableLayoutDurationButtons.Location = new System.Drawing.Point(3, 401);
|
||||
this.tableLayoutDurationButtons.Name = "tableLayoutDurationButtons";
|
||||
this.tableLayoutDurationButtons.RowCount = 1;
|
||||
this.tableLayoutDurationButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutDurationButtons.Size = new System.Drawing.Size(180, 27);
|
||||
this.tableLayoutDurationButtons.TabIndex = 12;
|
||||
this.tableLayoutDurationButtons.TabIndex = 14;
|
||||
//
|
||||
// btnDurationMedium
|
||||
//
|
||||
@@ -267,7 +273,7 @@
|
||||
//
|
||||
this.labelDurationValue.BackColor = System.Drawing.Color.Transparent;
|
||||
this.labelDurationValue.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.labelDurationValue.Location = new System.Drawing.Point(147, 4);
|
||||
this.labelDurationValue.Location = new System.Drawing.Point(177, 4);
|
||||
this.labelDurationValue.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.labelDurationValue.Name = "labelDurationValue";
|
||||
this.labelDurationValue.Size = new System.Drawing.Size(52, 15);
|
||||
@@ -282,7 +288,7 @@
|
||||
this.trackBarDuration.Maximum = 60;
|
||||
this.trackBarDuration.Minimum = 10;
|
||||
this.trackBarDuration.Name = "trackBarDuration";
|
||||
this.trackBarDuration.Size = new System.Drawing.Size(148, 30);
|
||||
this.trackBarDuration.Size = new System.Drawing.Size(177, 30);
|
||||
this.trackBarDuration.TabIndex = 0;
|
||||
this.trackBarDuration.TickFrequency = 5;
|
||||
this.trackBarDuration.Value = 25;
|
||||
@@ -349,11 +355,11 @@
|
||||
//
|
||||
this.checkTimerCountDown.AutoSize = true;
|
||||
this.checkTimerCountDown.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.checkTimerCountDown.Location = new System.Drawing.Point(6, 266);
|
||||
this.checkTimerCountDown.Location = new System.Drawing.Point(6, 314);
|
||||
this.checkTimerCountDown.Margin = new System.Windows.Forms.Padding(6, 3, 3, 2);
|
||||
this.checkTimerCountDown.Name = "checkTimerCountDown";
|
||||
this.checkTimerCountDown.Size = new System.Drawing.Size(132, 19);
|
||||
this.checkTimerCountDown.TabIndex = 9;
|
||||
this.checkTimerCountDown.TabIndex = 11;
|
||||
this.checkTimerCountDown.Text = "Timer Counts Down";
|
||||
this.checkTimerCountDown.UseVisualStyleBackColor = true;
|
||||
//
|
||||
@@ -361,11 +367,11 @@
|
||||
//
|
||||
this.checkNotificationTimer.AutoSize = true;
|
||||
this.checkNotificationTimer.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.checkNotificationTimer.Location = new System.Drawing.Point(6, 242);
|
||||
this.checkNotificationTimer.Location = new System.Drawing.Point(6, 290);
|
||||
this.checkNotificationTimer.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2);
|
||||
this.checkNotificationTimer.Name = "checkNotificationTimer";
|
||||
this.checkNotificationTimer.Size = new System.Drawing.Size(164, 19);
|
||||
this.checkNotificationTimer.TabIndex = 8;
|
||||
this.checkNotificationTimer.TabIndex = 10;
|
||||
this.checkNotificationTimer.Text = "Display Notification Timer";
|
||||
this.checkNotificationTimer.UseVisualStyleBackColor = true;
|
||||
//
|
||||
@@ -429,7 +435,7 @@
|
||||
// labelScrollSpeedValue
|
||||
//
|
||||
this.labelScrollSpeedValue.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.labelScrollSpeedValue.Location = new System.Drawing.Point(145, 4);
|
||||
this.labelScrollSpeedValue.Location = new System.Drawing.Point(176, 4);
|
||||
this.labelScrollSpeedValue.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.labelScrollSpeedValue.Name = "labelScrollSpeedValue";
|
||||
this.labelScrollSpeedValue.Size = new System.Drawing.Size(38, 15);
|
||||
@@ -445,7 +451,7 @@
|
||||
this.trackBarScrollSpeed.Maximum = 200;
|
||||
this.trackBarScrollSpeed.Minimum = 25;
|
||||
this.trackBarScrollSpeed.Name = "trackBarScrollSpeed";
|
||||
this.trackBarScrollSpeed.Size = new System.Drawing.Size(148, 30);
|
||||
this.trackBarScrollSpeed.Size = new System.Drawing.Size(177, 30);
|
||||
this.trackBarScrollSpeed.SmallChange = 5;
|
||||
this.trackBarScrollSpeed.TabIndex = 0;
|
||||
this.trackBarScrollSpeed.TickFrequency = 25;
|
||||
@@ -490,32 +496,32 @@
|
||||
//
|
||||
this.panelTimer.Controls.Add(this.labelDurationValue);
|
||||
this.panelTimer.Controls.Add(this.trackBarDuration);
|
||||
this.panelTimer.Location = new System.Drawing.Point(0, 315);
|
||||
this.panelTimer.Location = new System.Drawing.Point(0, 363);
|
||||
this.panelTimer.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0);
|
||||
this.panelTimer.Name = "panelTimer";
|
||||
this.panelTimer.Size = new System.Drawing.Size(300, 35);
|
||||
this.panelTimer.TabIndex = 11;
|
||||
this.panelTimer.TabIndex = 13;
|
||||
//
|
||||
// labelDuration
|
||||
//
|
||||
this.labelDuration.AutoSize = true;
|
||||
this.labelDuration.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.labelDuration.Location = new System.Drawing.Point(3, 299);
|
||||
this.labelDuration.Location = new System.Drawing.Point(3, 347);
|
||||
this.labelDuration.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
|
||||
this.labelDuration.Name = "labelDuration";
|
||||
this.labelDuration.Size = new System.Drawing.Size(54, 15);
|
||||
this.labelDuration.TabIndex = 10;
|
||||
this.labelDuration.TabIndex = 12;
|
||||
this.labelDuration.Text = "Duration";
|
||||
//
|
||||
// labelTimer
|
||||
//
|
||||
this.labelTimer.AutoSize = true;
|
||||
this.labelTimer.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold);
|
||||
this.labelTimer.Location = new System.Drawing.Point(0, 216);
|
||||
this.labelTimer.Margin = new System.Windows.Forms.Padding(0, 40, 0, 1);
|
||||
this.labelTimer.Location = new System.Drawing.Point(0, 264);
|
||||
this.labelTimer.Margin = new System.Windows.Forms.Padding(0, 25, 0, 1);
|
||||
this.labelTimer.Name = "labelTimer";
|
||||
this.labelTimer.Size = new System.Drawing.Size(50, 19);
|
||||
this.labelTimer.TabIndex = 7;
|
||||
this.labelTimer.TabIndex = 9;
|
||||
this.labelTimer.Text = "TIMER";
|
||||
//
|
||||
// labelSize
|
||||
@@ -555,6 +561,8 @@
|
||||
this.flowPanelLeft.Controls.Add(this.checkNonIntrusive);
|
||||
this.flowPanelLeft.Controls.Add(this.labelIdlePause);
|
||||
this.flowPanelLeft.Controls.Add(this.comboBoxIdlePause);
|
||||
this.flowPanelLeft.Controls.Add(this.labelOpacity);
|
||||
this.flowPanelLeft.Controls.Add(this.panelOpacity);
|
||||
this.flowPanelLeft.Controls.Add(this.labelTimer);
|
||||
this.flowPanelLeft.Controls.Add(this.checkNotificationTimer);
|
||||
this.flowPanelLeft.Controls.Add(this.checkTimerCountDown);
|
||||
@@ -568,6 +576,52 @@
|
||||
this.flowPanelLeft.TabIndex = 0;
|
||||
this.flowPanelLeft.WrapContents = false;
|
||||
//
|
||||
// labelOpacity
|
||||
//
|
||||
this.labelOpacity.AutoSize = true;
|
||||
this.labelOpacity.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.labelOpacity.Location = new System.Drawing.Point(3, 188);
|
||||
this.labelOpacity.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
|
||||
this.labelOpacity.Name = "labelOpacity";
|
||||
this.labelOpacity.Size = new System.Drawing.Size(48, 15);
|
||||
this.labelOpacity.TabIndex = 7;
|
||||
this.labelOpacity.Text = "Opacity";
|
||||
//
|
||||
// panelOpacity
|
||||
//
|
||||
this.panelOpacity.Controls.Add(this.labelOpacityValue);
|
||||
this.panelOpacity.Controls.Add(this.trackBarOpacity);
|
||||
this.panelOpacity.Location = new System.Drawing.Point(0, 204);
|
||||
this.panelOpacity.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0);
|
||||
this.panelOpacity.Name = "panelOpacity";
|
||||
this.panelOpacity.Size = new System.Drawing.Size(300, 35);
|
||||
this.panelOpacity.TabIndex = 8;
|
||||
//
|
||||
// labelOpacityValue
|
||||
//
|
||||
this.labelOpacityValue.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.labelOpacityValue.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.labelOpacityValue.Location = new System.Drawing.Point(176, 4);
|
||||
this.labelOpacityValue.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.labelOpacityValue.Name = "labelOpacityValue";
|
||||
this.labelOpacityValue.Size = new System.Drawing.Size(38, 15);
|
||||
this.labelOpacityValue.TabIndex = 1;
|
||||
this.labelOpacityValue.Text = "100%";
|
||||
this.labelOpacityValue.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// trackBarOpacity
|
||||
//
|
||||
this.trackBarOpacity.AutoSize = false;
|
||||
this.trackBarOpacity.Location = new System.Drawing.Point(3, 3);
|
||||
this.trackBarOpacity.Maximum = 100;
|
||||
this.trackBarOpacity.Minimum = 20;
|
||||
this.trackBarOpacity.Name = "trackBarOpacity";
|
||||
this.trackBarOpacity.Size = new System.Drawing.Size(177, 30);
|
||||
this.trackBarOpacity.SmallChange = 5;
|
||||
this.trackBarOpacity.TabIndex = 0;
|
||||
this.trackBarOpacity.TickFrequency = 10;
|
||||
this.trackBarOpacity.Value = 100;
|
||||
//
|
||||
// panelScrollSpeed
|
||||
//
|
||||
this.panelScrollSpeed.Controls.Add(this.trackBarScrollSpeed);
|
||||
@@ -630,6 +684,8 @@
|
||||
this.panelSize.ResumeLayout(false);
|
||||
this.flowPanelLeft.ResumeLayout(false);
|
||||
this.flowPanelLeft.PerformLayout();
|
||||
this.panelOpacity.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.trackBarOpacity)).EndInit();
|
||||
this.panelScrollSpeed.ResumeLayout(false);
|
||||
this.flowPanelRight.ResumeLayout(false);
|
||||
this.flowPanelRight.PerformLayout();
|
||||
@@ -682,5 +738,9 @@
|
||||
private System.Windows.Forms.Panel panelScrollSpeed;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowPanelRight;
|
||||
private System.Windows.Forms.Panel panelSeparator;
|
||||
private System.Windows.Forms.Label labelOpacity;
|
||||
private System.Windows.Forms.Panel panelOpacity;
|
||||
private System.Windows.Forms.Label labelOpacityValue;
|
||||
private System.Windows.Forms.TrackBar trackBarOpacity;
|
||||
}
|
||||
}
|
||||
|
@@ -48,6 +48,9 @@ namespace TweetDuck.Dialogs.Settings{
|
||||
comboBoxIdlePause.Items.Add("5 minutes");
|
||||
comboBoxIdlePause.SelectedIndex = Math.Max(0, Array.FindIndex(IdlePauseSeconds, val => val == Config.NotificationIdlePauseSeconds));
|
||||
|
||||
trackBarOpacity.SetValueSafe(Config.NotificationWindowOpacity);
|
||||
labelOpacityValue.Text = Config.NotificationWindowOpacity + "%";
|
||||
|
||||
// timer
|
||||
|
||||
toolTip.SetToolTip(checkTimerCountDown, "The notification timer counts down instead of up.");
|
||||
@@ -105,6 +108,7 @@ namespace TweetDuck.Dialogs.Settings{
|
||||
checkSkipOnLinkClick.CheckedChanged += checkSkipOnLinkClick_CheckedChanged;
|
||||
checkNonIntrusive.CheckedChanged += checkNonIntrusive_CheckedChanged;
|
||||
comboBoxIdlePause.SelectedValueChanged += comboBoxIdlePause_SelectedValueChanged;
|
||||
trackBarOpacity.ValueChanged += trackBarOpacity_ValueChanged;
|
||||
|
||||
checkNotificationTimer.CheckedChanged += checkNotificationTimer_CheckedChanged;
|
||||
checkTimerCountDown.CheckedChanged += checkTimerCountDown_CheckedChanged;
|
||||
@@ -176,6 +180,13 @@ namespace TweetDuck.Dialogs.Settings{
|
||||
Config.NotificationIdlePauseSeconds = IdlePauseSeconds[comboBoxIdlePause.SelectedIndex];
|
||||
}
|
||||
|
||||
private void trackBarOpacity_ValueChanged(object sender, EventArgs e){
|
||||
if (trackBarOpacity.AlignValueToTick()){
|
||||
Config.NotificationWindowOpacity = trackBarOpacity.Value;
|
||||
labelOpacityValue.Text = Config.NotificationWindowOpacity + "%";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Timer
|
||||
|
||||
|
4
Dialogs/Settings/TabSettingsSounds.Designer.cs
generated
4
Dialogs/Settings/TabSettingsSounds.Designer.cs
generated
@@ -57,7 +57,7 @@
|
||||
//
|
||||
this.labelVolumeValue.BackColor = System.Drawing.Color.Transparent;
|
||||
this.labelVolumeValue.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||
this.labelVolumeValue.Location = new System.Drawing.Point(147, 4);
|
||||
this.labelVolumeValue.Location = new System.Drawing.Point(176, 4);
|
||||
this.labelVolumeValue.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
|
||||
this.labelVolumeValue.Name = "labelVolumeValue";
|
||||
this.labelVolumeValue.Size = new System.Drawing.Size(38, 15);
|
||||
@@ -144,7 +144,7 @@
|
||||
this.trackBarVolume.Location = new System.Drawing.Point(3, 3);
|
||||
this.trackBarVolume.Maximum = 100;
|
||||
this.trackBarVolume.Name = "trackBarVolume";
|
||||
this.trackBarVolume.Size = new System.Drawing.Size(148, 30);
|
||||
this.trackBarVolume.Size = new System.Drawing.Size(177, 30);
|
||||
this.trackBarVolume.TabIndex = 0;
|
||||
this.trackBarVolume.TickFrequency = 10;
|
||||
this.trackBarVolume.Value = 100;
|
||||
|
@@ -14,8 +14,8 @@ using TweetDuck.Management;
|
||||
using TweetDuck.Resources;
|
||||
using TweetDuck.Utils;
|
||||
using TweetLib.Core;
|
||||
using TweetLib.Core.Application.Helpers;
|
||||
using TweetLib.Core.Collections;
|
||||
using TweetLib.Core.Systems.Startup;
|
||||
using TweetLib.Core.Utils;
|
||||
using Win = System.Windows.Forms;
|
||||
|
||||
|
@@ -871,8 +871,6 @@
|
||||
}
|
||||
|
||||
uploader.addFilesToUpload([ item.getAsFile() ]);
|
||||
|
||||
$(".js-compose-text", ".js-docked-compose").focus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1068,6 +1066,33 @@
|
||||
});
|
||||
});
|
||||
|
||||
//
|
||||
// Block: Fix docked composer not re-focusing after Alt+Tab & image upload.
|
||||
//
|
||||
onAppReady.push(function fixDockedComposerRefocus(){
|
||||
$(document).on("tduckOldComposerActive", function(e){
|
||||
const ele = $$(".js-compose-text", ".js-docked-compose");
|
||||
const node = ele[0];
|
||||
|
||||
let cancelBlur = false;
|
||||
|
||||
ele.on("blur", function(e){
|
||||
cancelBlur = true;
|
||||
setTimeout(function(){ cancelBlur = false; }, 0);
|
||||
});
|
||||
|
||||
window.TDGF_prioritizeNewestEvent(node, "blur");
|
||||
|
||||
node.blur = prependToFunction(node.blur, function(){
|
||||
return cancelBlur;
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on("uiComposeImageAdded", function(){
|
||||
$(".js-compose-text", ".js-docked-compose").focus();
|
||||
});
|
||||
});
|
||||
|
||||
//
|
||||
// Block: Refocus the textbox after switching accounts.
|
||||
//
|
||||
|
@@ -68,22 +68,13 @@ button[type='submit'] {
|
||||
/* General per-page styling */
|
||||
/****************************/
|
||||
|
||||
html[mobile][login] div[tweetduck-login-wrapper] {
|
||||
html[login] div[tweetduck-login-wrapper] {
|
||||
/* vertically center page & fix colors */
|
||||
margin-top: calc(50vh - 200px);
|
||||
padding: 26px 1.1vw;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
html[mobile][login] #tweetduck-helper:hover {
|
||||
html[login] #tweetduck-helper:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
html[desktop][login] #tweetduck-helper {
|
||||
margin-top: 15px !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
html[mobile][logout] div[role="button"] {
|
||||
border: 1px solid rgba(0, 0, 0, 0.3) !important;
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
(function(){
|
||||
const isLogin = location.pathname === "/login";
|
||||
const isLogout = location.pathname === "/logout";
|
||||
const isMobile = location.host === "mobile.twitter.com";
|
||||
|
||||
//
|
||||
// Function: Inject custom CSS into the page.
|
||||
@@ -24,13 +23,6 @@
|
||||
else if (isLogout){
|
||||
document.documentElement.setAttribute("logout", "");
|
||||
}
|
||||
|
||||
if (isMobile){
|
||||
document.documentElement.setAttribute("mobile", "");
|
||||
}
|
||||
else{
|
||||
document.documentElement.setAttribute("desktop", "");
|
||||
}
|
||||
};
|
||||
|
||||
setTimeout(injectCSS, 1);
|
||||
@@ -53,7 +45,6 @@
|
||||
//
|
||||
if (isLogin){
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
if (isMobile){
|
||||
triggerWhenExists("main h1", function(heading){
|
||||
heading.parentNode.setAttribute("tweetduck-login-wrapper", "");
|
||||
return true;
|
||||
@@ -86,37 +77,12 @@
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
const openLinkExternally = function(e){
|
||||
let href = e.currentTarget.getAttribute("href");
|
||||
$TD.openBrowser(href[0] === '/' ? location.origin+href : href);
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
for(let link of document.getElementsByTagName("A")){
|
||||
link.addEventListener("click", openLinkExternally);
|
||||
}
|
||||
|
||||
let texts = document.querySelector(".page-canvas > div:last-child");
|
||||
|
||||
if (texts){
|
||||
texts.insertAdjacentHTML("beforeend", `<p id="tweetduck-helper">Used the TweetDuck app before? <a href="#">Import your profile »</a></p>`);
|
||||
|
||||
texts.querySelector("#tweetduck-helper > a").addEventListener("click", function(){
|
||||
$TD.openProfileImport();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// Block: Hide cookie crap.
|
||||
//
|
||||
if (isMobile){
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
triggerWhenExists("a[href^='https://help.twitter.com/rules-and-policies/twitter-cookies']", function(cookie){
|
||||
while(!!cookie){
|
||||
@@ -132,5 +98,4 @@
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using TweetLib.Core.Features.Updates;
|
||||
using TweetLib.Core.Systems.Updates;
|
||||
|
||||
namespace TweetDuck.Updates{
|
||||
sealed partial class FormUpdateDownload : Form{
|
||||
|
@@ -6,7 +6,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Script.Serialization;
|
||||
using TweetDuck.Utils;
|
||||
using TweetLib.Core.Features.Updates;
|
||||
using TweetLib.Core.Systems.Updates;
|
||||
using TweetLib.Core.Utils;
|
||||
using JsonObject = System.Collections.Generic.IDictionary<string, object>;
|
||||
|
||||
|
@@ -6,6 +6,6 @@ using Version = TweetDuck.Version;
|
||||
|
||||
namespace TweetDuck{
|
||||
internal static class Version{
|
||||
public const string Tag = "1.18.4";
|
||||
public const string Tag = "1.18.6";
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using TweetLib.Core.Features.Configuration;
|
||||
using TweetLib.Core.Systems.Configuration;
|
||||
|
||||
namespace TweetLib.Core.Features.Plugins.Config{
|
||||
public sealed class PluginConfigInstance<T> : IConfigInstance<T> where T : BaseConfig, IPluginConfig{
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TweetLib.Core.Features.Configuration{
|
||||
namespace TweetLib.Core.Systems.Configuration{
|
||||
public abstract class BaseConfig{
|
||||
private readonly IConfigManager configManager;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
using System.IO;
|
||||
using TweetLib.Core.Serialization;
|
||||
|
||||
namespace TweetLib.Core.Features.Configuration{
|
||||
namespace TweetLib.Core.Systems.Configuration{
|
||||
public sealed class FileConfigInstance<T> : IConfigInstance<T> where T : BaseConfig{
|
||||
public T Instance { get; }
|
||||
public FileSerializer<T> Serializer { get; }
|
@@ -1,4 +1,4 @@
|
||||
namespace TweetLib.Core.Features.Configuration{
|
||||
namespace TweetLib.Core.Systems.Configuration{
|
||||
public interface IConfigInstance<out T>{
|
||||
T Instance { get; }
|
||||
|
@@ -1,4 +1,4 @@
|
||||
namespace TweetLib.Core.Features.Configuration{
|
||||
namespace TweetLib.Core.Systems.Configuration{
|
||||
public interface IConfigManager{
|
||||
void TriggerProgramRestartRequested();
|
||||
IConfigInstance<BaseConfig> GetInstanceInfo(BaseConfig instance);
|
@@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace TweetLib.Core.Application.Helpers{
|
||||
namespace TweetLib.Core.Systems.Startup{
|
||||
public sealed class LockManager{
|
||||
private const int RetryDelay = 250;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TweetLib.Core.Features.Updates{
|
||||
namespace TweetLib.Core.Systems.Updates{
|
||||
public interface IUpdateCheckClient{
|
||||
bool CanCheck { get; }
|
||||
Task<UpdateInfo> Check();
|
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using TweetLib.Core.Data;
|
||||
|
||||
namespace TweetLib.Core.Features.Updates{
|
||||
namespace TweetLib.Core.Systems.Updates{
|
||||
public sealed class UpdateCheckEventArgs : EventArgs{
|
||||
public int EventId { get; }
|
||||
public Result<UpdateInfo> Result { get; }
|
@@ -1,4 +1,4 @@
|
||||
namespace TweetLib.Core.Features.Updates{
|
||||
namespace TweetLib.Core.Systems.Updates{
|
||||
public enum UpdateDownloadStatus{
|
||||
None = 0,
|
||||
InProgress,
|
@@ -5,7 +5,7 @@ using System.Timers;
|
||||
using TweetLib.Core.Data;
|
||||
using Timer = System.Timers.Timer;
|
||||
|
||||
namespace TweetLib.Core.Features.Updates{
|
||||
namespace TweetLib.Core.Systems.Updates{
|
||||
public sealed class UpdateHandler : IDisposable{
|
||||
public const int CheckCodeUpdatesDisabled = -1;
|
||||
|
@@ -3,7 +3,7 @@ using System.IO;
|
||||
using System.Net;
|
||||
using TweetLib.Core.Utils;
|
||||
|
||||
namespace TweetLib.Core.Features.Updates{
|
||||
namespace TweetLib.Core.Systems.Updates{
|
||||
public sealed class UpdateInfo{
|
||||
public string VersionTag { get; }
|
||||
public string ReleaseNotes { get; }
|
Reference in New Issue
Block a user