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

Compare commits

..

4 Commits

Author SHA1 Message Date
b2ebb984f8 Release 1.18.5 2020-05-04 16:20:44 +02:00
f7e9ad74d1 Fix stuck processes after closing the app
Closes #294
2020-05-04 13:45:56 +02:00
d48da3d51c Add option for notification window opacity 2020-04-27 10:20:07 +02:00
76d22554c5 Make trackbars in settings wider 2020-04-27 10:03:51 +02:00
10 changed files with 129 additions and 32 deletions

View File

@@ -48,10 +48,13 @@ namespace TweetDuck.Browser{
public AnalyticsFile AnalyticsFile => analytics?.File ?? AnalyticsFile.Dummy; public AnalyticsFile AnalyticsFile => analytics?.File ?? AnalyticsFile.Dummy;
#pragma warning disable IDE0069 // Disposable fields should be disposed
private readonly TweetDeckBrowser browser; private readonly TweetDeckBrowser browser;
private readonly FormNotificationTweet notification;
#pragma warning restore IDE0069 // Disposable fields should be disposed
private readonly PluginManager plugins; private readonly PluginManager plugins;
private readonly UpdateHandler updates; private readonly UpdateHandler updates;
private readonly FormNotificationTweet notification;
private readonly ContextMenu contextMenu; private readonly ContextMenu contextMenu;
private readonly UpdateBridge updateBridge; private readonly UpdateBridge updateBridge;
@@ -90,6 +93,7 @@ namespace TweetDuck.Browser{
Disposed += (sender, args) => { Disposed += (sender, args) => {
Config.MuteToggled -= Config_MuteToggled; Config.MuteToggled -= Config_MuteToggled;
Config.TrayBehaviorChanged -= Config_TrayBehaviorChanged; Config.TrayBehaviorChanged -= Config_TrayBehaviorChanged;
browser.Dispose();
}; };
Config.MuteToggled += Config_MuteToggled; Config.MuteToggled += Config_MuteToggled;
@@ -115,9 +119,7 @@ namespace TweetDuck.Browser{
if (disposing){ if (disposing){
components?.Dispose(); components?.Dispose();
browser.Dispose();
updates.Dispose(); updates.Dispose();
notification.Dispose();
contextMenu.Dispose(); contextMenu.Dispose();
notificationScreenshotManager?.Dispose(); notificationScreenshotManager?.Dispose();

View File

@@ -103,7 +103,10 @@ namespace TweetDuck.Browser.Notification{
protected double SizeScale => DpiScale * Config.ZoomLevel / 100.0; protected double SizeScale => DpiScale * Config.ZoomLevel / 100.0;
protected readonly FormBrowser owner; protected readonly FormBrowser owner;
#pragma warning disable IDE0069 // Disposable fields should be disposed
protected readonly ChromiumWebBrowser browser; protected readonly ChromiumWebBrowser browser;
#pragma warning restore IDE0069 // Disposable fields should be disposed
private readonly ResourceHandlerNotification resourceHandler = new ResourceHandlerNotification(); private readonly ResourceHandlerNotification resourceHandler = new ResourceHandlerNotification();
@@ -144,7 +147,11 @@ namespace TweetDuck.Browser.Notification{
this.browser.SetupZoomEvents(); this.browser.SetupZoomEvents();
Controls.Add(browser); 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(); DpiScale = this.GetDPIScale();
@@ -155,7 +162,6 @@ namespace TweetDuck.Browser.Notification{
protected override void Dispose(bool disposing){ protected override void Dispose(bool disposing){
if (disposing){ if (disposing){
components?.Dispose(); components?.Dispose();
browser.Dispose();
resourceHandler.Dispose(); resourceHandler.Dispose();
} }

View File

@@ -25,6 +25,8 @@ namespace TweetDuck.Browser.Notification{
private IntPtr mouseHook; private IntPtr mouseHook;
private bool blockXButtonUp; private bool blockXButtonUp;
private int currentOpacity;
private bool? prevDisplayTimer; private bool? prevDisplayTimer;
private int? prevFontSize; private int? prevFontSize;
@@ -81,6 +83,15 @@ namespace TweetDuck.Browser.Notification{
Disposed += (sender, args) => StopMouseHook(true); Disposed += (sender, args) => StopMouseHook(true);
} }
// helpers
private void SetOpacity(int opacity){
if (currentOpacity != opacity){
currentOpacity = opacity;
Opacity = opacity / 100.0;
}
}
// mouse wheel hook // mouse wheel hook
private void StartMouseHook(){ private void StartMouseHook(){
@@ -170,9 +181,11 @@ namespace TweetDuck.Browser.Notification{
if (isCursorInside){ if (isCursorInside){
StartMouseHook(); StartMouseHook();
SetOpacity(100);
} }
else{ else{
StopMouseHook(false); StopMouseHook(false);
SetOpacity(Config.NotificationWindowOpacity);
} }
if (isCursorInside || FreezeTimer || ContextMenuOpen){ if (isCursorInside || FreezeTimer || ContextMenuOpen){
@@ -265,6 +278,7 @@ namespace TweetDuck.Browser.Notification{
SetNotificationSize(BaseClientWidth, BaseClientHeight); SetNotificationSize(BaseClientWidth, BaseClientHeight);
} }
SetOpacity(IsCursorOverBrowser ? 100 : Config.NotificationWindowOpacity);
MoveToVisibleLocation(); MoveToVisibleLocation();
} }

View File

@@ -65,6 +65,7 @@ namespace TweetDuck.Configuration{
public Point CustomNotificationPosition { get; set; } = ControlExtensions.InvisibleLocation; public Point CustomNotificationPosition { get; set; } = ControlExtensions.InvisibleLocation;
public int NotificationDisplay { get; set; } = 0; public int NotificationDisplay { get; set; } = 0;
public int NotificationEdgeDistance { get; set; } = 8; public int NotificationEdgeDistance { get; set; } = 8;
public int NotificationWindowOpacity { get; set; } = 100;
public DesktopNotification.Size NotificationSize { get; set; } = DesktopNotification.Size.Auto; public DesktopNotification.Size NotificationSize { get; set; } = DesktopNotification.Size.Auto;
public Size CustomNotificationSize { get; set; } = Size.Empty; public Size CustomNotificationSize { get; set; } = Size.Empty;

View File

@@ -56,7 +56,10 @@ namespace TweetDuck.Dialogs{
} }
} }
#pragma warning disable IDE0069 // Disposable fields should be disposed
private readonly ChromiumWebBrowser browser; private readonly ChromiumWebBrowser browser;
#pragma warning restore IDE0069 // Disposable fields should be disposed
private string nextUrl; private string nextUrl;
private FormGuide(string url, FormBrowser owner){ private FormGuide(string url, FormBrowser owner){
@@ -87,12 +90,12 @@ namespace TweetDuck.Dialogs{
browser.SetupZoomEvents(); browser.SetupZoomEvents();
Controls.Add(browser); Controls.Add(browser);
Disposed += (sender, args) => browser.Dispose();
} }
protected override void Dispose(bool disposing){ protected override void Dispose(bool disposing){
if (disposing){ if (disposing){
components?.Dispose(); components?.Dispose();
browser.Dispose();
} }
base.Dispose(disposing); base.Dispose(disposing);

View File

@@ -115,7 +115,7 @@
// //
this.labelZoomValue.BackColor = System.Drawing.Color.Transparent; this.labelZoomValue.BackColor = System.Drawing.Color.Transparent;
this.labelZoomValue.Font = new System.Drawing.Font("Segoe UI", 9F); 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.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.labelZoomValue.Name = "labelZoomValue"; this.labelZoomValue.Name = "labelZoomValue";
this.labelZoomValue.Size = new System.Drawing.Size(38, 13); this.labelZoomValue.Size = new System.Drawing.Size(38, 13);
@@ -156,7 +156,7 @@
this.trackBarZoom.Maximum = 200; this.trackBarZoom.Maximum = 200;
this.trackBarZoom.Minimum = 50; this.trackBarZoom.Minimum = 50;
this.trackBarZoom.Name = "trackBarZoom"; 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.SmallChange = 5;
this.trackBarZoom.TabIndex = 0; this.trackBarZoom.TabIndex = 0;
this.trackBarZoom.TickFrequency = 25; this.trackBarZoom.TickFrequency = 25;

View File

@@ -65,6 +65,10 @@
this.panelSize = new System.Windows.Forms.Panel(); this.panelSize = new System.Windows.Forms.Panel();
this.durationUpdateTimer = new System.Windows.Forms.Timer(this.components); this.durationUpdateTimer = new System.Windows.Forms.Timer(this.components);
this.flowPanelLeft = new System.Windows.Forms.FlowLayoutPanel(); 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.panelScrollSpeed = new System.Windows.Forms.Panel();
this.flowPanelRight = new System.Windows.Forms.FlowLayoutPanel(); this.flowPanelRight = new System.Windows.Forms.FlowLayoutPanel();
this.panelSeparator = new System.Windows.Forms.Panel(); this.panelSeparator = new System.Windows.Forms.Panel();
@@ -77,6 +81,8 @@
this.panelTimer.SuspendLayout(); this.panelTimer.SuspendLayout();
this.panelSize.SuspendLayout(); this.panelSize.SuspendLayout();
this.flowPanelLeft.SuspendLayout(); this.flowPanelLeft.SuspendLayout();
this.panelOpacity.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trackBarOpacity)).BeginInit();
this.panelScrollSpeed.SuspendLayout(); this.panelScrollSpeed.SuspendLayout();
this.flowPanelRight.SuspendLayout(); this.flowPanelRight.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@@ -84,7 +90,7 @@
// labelEdgeDistanceValue // labelEdgeDistanceValue
// //
this.labelEdgeDistanceValue.Font = new System.Drawing.Font("Segoe UI", 9F); 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.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.labelEdgeDistanceValue.Name = "labelEdgeDistanceValue"; this.labelEdgeDistanceValue.Name = "labelEdgeDistanceValue";
this.labelEdgeDistanceValue.Size = new System.Drawing.Size(40, 15); this.labelEdgeDistanceValue.Size = new System.Drawing.Size(40, 15);
@@ -193,7 +199,7 @@
this.trackBarEdgeDistance.Maximum = 40; this.trackBarEdgeDistance.Maximum = 40;
this.trackBarEdgeDistance.Minimum = 8; this.trackBarEdgeDistance.Minimum = 8;
this.trackBarEdgeDistance.Name = "trackBarEdgeDistance"; 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.SmallChange = 2;
this.trackBarEdgeDistance.TabIndex = 0; this.trackBarEdgeDistance.TabIndex = 0;
this.trackBarEdgeDistance.TickFrequency = 4; this.trackBarEdgeDistance.TickFrequency = 4;
@@ -208,12 +214,12 @@
this.tableLayoutDurationButtons.Controls.Add(this.btnDurationMedium, 0, 0); this.tableLayoutDurationButtons.Controls.Add(this.btnDurationMedium, 0, 0);
this.tableLayoutDurationButtons.Controls.Add(this.btnDurationLong, 1, 0); this.tableLayoutDurationButtons.Controls.Add(this.btnDurationLong, 1, 0);
this.tableLayoutDurationButtons.Controls.Add(this.btnDurationShort, 0, 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.Name = "tableLayoutDurationButtons";
this.tableLayoutDurationButtons.RowCount = 1; this.tableLayoutDurationButtons.RowCount = 1;
this.tableLayoutDurationButtons.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 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.Size = new System.Drawing.Size(180, 27);
this.tableLayoutDurationButtons.TabIndex = 12; this.tableLayoutDurationButtons.TabIndex = 14;
// //
// btnDurationMedium // btnDurationMedium
// //
@@ -267,7 +273,7 @@
// //
this.labelDurationValue.BackColor = System.Drawing.Color.Transparent; this.labelDurationValue.BackColor = System.Drawing.Color.Transparent;
this.labelDurationValue.Font = new System.Drawing.Font("Segoe UI", 9F); 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.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.labelDurationValue.Name = "labelDurationValue"; this.labelDurationValue.Name = "labelDurationValue";
this.labelDurationValue.Size = new System.Drawing.Size(52, 15); this.labelDurationValue.Size = new System.Drawing.Size(52, 15);
@@ -282,7 +288,7 @@
this.trackBarDuration.Maximum = 60; this.trackBarDuration.Maximum = 60;
this.trackBarDuration.Minimum = 10; this.trackBarDuration.Minimum = 10;
this.trackBarDuration.Name = "trackBarDuration"; 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.TabIndex = 0;
this.trackBarDuration.TickFrequency = 5; this.trackBarDuration.TickFrequency = 5;
this.trackBarDuration.Value = 25; this.trackBarDuration.Value = 25;
@@ -349,11 +355,11 @@
// //
this.checkTimerCountDown.AutoSize = true; this.checkTimerCountDown.AutoSize = true;
this.checkTimerCountDown.Font = new System.Drawing.Font("Segoe UI", 9F); 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.Margin = new System.Windows.Forms.Padding(6, 3, 3, 2);
this.checkTimerCountDown.Name = "checkTimerCountDown"; this.checkTimerCountDown.Name = "checkTimerCountDown";
this.checkTimerCountDown.Size = new System.Drawing.Size(132, 19); 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.Text = "Timer Counts Down";
this.checkTimerCountDown.UseVisualStyleBackColor = true; this.checkTimerCountDown.UseVisualStyleBackColor = true;
// //
@@ -361,11 +367,11 @@
// //
this.checkNotificationTimer.AutoSize = true; this.checkNotificationTimer.AutoSize = true;
this.checkNotificationTimer.Font = new System.Drawing.Font("Segoe UI", 9F); 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.Margin = new System.Windows.Forms.Padding(6, 6, 3, 2);
this.checkNotificationTimer.Name = "checkNotificationTimer"; this.checkNotificationTimer.Name = "checkNotificationTimer";
this.checkNotificationTimer.Size = new System.Drawing.Size(164, 19); 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.Text = "Display Notification Timer";
this.checkNotificationTimer.UseVisualStyleBackColor = true; this.checkNotificationTimer.UseVisualStyleBackColor = true;
// //
@@ -429,7 +435,7 @@
// labelScrollSpeedValue // labelScrollSpeedValue
// //
this.labelScrollSpeedValue.Font = new System.Drawing.Font("Segoe UI", 9F); 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.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.labelScrollSpeedValue.Name = "labelScrollSpeedValue"; this.labelScrollSpeedValue.Name = "labelScrollSpeedValue";
this.labelScrollSpeedValue.Size = new System.Drawing.Size(38, 15); this.labelScrollSpeedValue.Size = new System.Drawing.Size(38, 15);
@@ -445,7 +451,7 @@
this.trackBarScrollSpeed.Maximum = 200; this.trackBarScrollSpeed.Maximum = 200;
this.trackBarScrollSpeed.Minimum = 25; this.trackBarScrollSpeed.Minimum = 25;
this.trackBarScrollSpeed.Name = "trackBarScrollSpeed"; 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.SmallChange = 5;
this.trackBarScrollSpeed.TabIndex = 0; this.trackBarScrollSpeed.TabIndex = 0;
this.trackBarScrollSpeed.TickFrequency = 25; this.trackBarScrollSpeed.TickFrequency = 25;
@@ -490,32 +496,32 @@
// //
this.panelTimer.Controls.Add(this.labelDurationValue); this.panelTimer.Controls.Add(this.labelDurationValue);
this.panelTimer.Controls.Add(this.trackBarDuration); 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.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0);
this.panelTimer.Name = "panelTimer"; this.panelTimer.Name = "panelTimer";
this.panelTimer.Size = new System.Drawing.Size(300, 35); this.panelTimer.Size = new System.Drawing.Size(300, 35);
this.panelTimer.TabIndex = 11; this.panelTimer.TabIndex = 13;
// //
// labelDuration // labelDuration
// //
this.labelDuration.AutoSize = true; this.labelDuration.AutoSize = true;
this.labelDuration.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold); 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.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
this.labelDuration.Name = "labelDuration"; this.labelDuration.Name = "labelDuration";
this.labelDuration.Size = new System.Drawing.Size(54, 15); this.labelDuration.Size = new System.Drawing.Size(54, 15);
this.labelDuration.TabIndex = 10; this.labelDuration.TabIndex = 12;
this.labelDuration.Text = "Duration"; this.labelDuration.Text = "Duration";
// //
// labelTimer // labelTimer
// //
this.labelTimer.AutoSize = true; this.labelTimer.AutoSize = true;
this.labelTimer.Font = new System.Drawing.Font("Segoe UI Semibold", 10.5F, System.Drawing.FontStyle.Bold); 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.Location = new System.Drawing.Point(0, 264);
this.labelTimer.Margin = new System.Windows.Forms.Padding(0, 40, 0, 1); this.labelTimer.Margin = new System.Windows.Forms.Padding(0, 25, 0, 1);
this.labelTimer.Name = "labelTimer"; this.labelTimer.Name = "labelTimer";
this.labelTimer.Size = new System.Drawing.Size(50, 19); this.labelTimer.Size = new System.Drawing.Size(50, 19);
this.labelTimer.TabIndex = 7; this.labelTimer.TabIndex = 9;
this.labelTimer.Text = "TIMER"; this.labelTimer.Text = "TIMER";
// //
// labelSize // labelSize
@@ -555,6 +561,8 @@
this.flowPanelLeft.Controls.Add(this.checkNonIntrusive); this.flowPanelLeft.Controls.Add(this.checkNonIntrusive);
this.flowPanelLeft.Controls.Add(this.labelIdlePause); this.flowPanelLeft.Controls.Add(this.labelIdlePause);
this.flowPanelLeft.Controls.Add(this.comboBoxIdlePause); 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.labelTimer);
this.flowPanelLeft.Controls.Add(this.checkNotificationTimer); this.flowPanelLeft.Controls.Add(this.checkNotificationTimer);
this.flowPanelLeft.Controls.Add(this.checkTimerCountDown); this.flowPanelLeft.Controls.Add(this.checkTimerCountDown);
@@ -568,6 +576,52 @@
this.flowPanelLeft.TabIndex = 0; this.flowPanelLeft.TabIndex = 0;
this.flowPanelLeft.WrapContents = false; 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 // panelScrollSpeed
// //
this.panelScrollSpeed.Controls.Add(this.trackBarScrollSpeed); this.panelScrollSpeed.Controls.Add(this.trackBarScrollSpeed);
@@ -630,6 +684,8 @@
this.panelSize.ResumeLayout(false); this.panelSize.ResumeLayout(false);
this.flowPanelLeft.ResumeLayout(false); this.flowPanelLeft.ResumeLayout(false);
this.flowPanelLeft.PerformLayout(); this.flowPanelLeft.PerformLayout();
this.panelOpacity.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.trackBarOpacity)).EndInit();
this.panelScrollSpeed.ResumeLayout(false); this.panelScrollSpeed.ResumeLayout(false);
this.flowPanelRight.ResumeLayout(false); this.flowPanelRight.ResumeLayout(false);
this.flowPanelRight.PerformLayout(); this.flowPanelRight.PerformLayout();
@@ -682,5 +738,9 @@
private System.Windows.Forms.Panel panelScrollSpeed; private System.Windows.Forms.Panel panelScrollSpeed;
private System.Windows.Forms.FlowLayoutPanel flowPanelRight; private System.Windows.Forms.FlowLayoutPanel flowPanelRight;
private System.Windows.Forms.Panel panelSeparator; 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;
} }
} }

View File

@@ -48,6 +48,9 @@ namespace TweetDuck.Dialogs.Settings{
comboBoxIdlePause.Items.Add("5 minutes"); comboBoxIdlePause.Items.Add("5 minutes");
comboBoxIdlePause.SelectedIndex = Math.Max(0, Array.FindIndex(IdlePauseSeconds, val => val == Config.NotificationIdlePauseSeconds)); comboBoxIdlePause.SelectedIndex = Math.Max(0, Array.FindIndex(IdlePauseSeconds, val => val == Config.NotificationIdlePauseSeconds));
trackBarOpacity.SetValueSafe(Config.NotificationWindowOpacity);
labelOpacityValue.Text = Config.NotificationWindowOpacity + "%";
// timer // timer
toolTip.SetToolTip(checkTimerCountDown, "The notification timer counts down instead of up."); toolTip.SetToolTip(checkTimerCountDown, "The notification timer counts down instead of up.");
@@ -105,6 +108,7 @@ namespace TweetDuck.Dialogs.Settings{
checkSkipOnLinkClick.CheckedChanged += checkSkipOnLinkClick_CheckedChanged; checkSkipOnLinkClick.CheckedChanged += checkSkipOnLinkClick_CheckedChanged;
checkNonIntrusive.CheckedChanged += checkNonIntrusive_CheckedChanged; checkNonIntrusive.CheckedChanged += checkNonIntrusive_CheckedChanged;
comboBoxIdlePause.SelectedValueChanged += comboBoxIdlePause_SelectedValueChanged; comboBoxIdlePause.SelectedValueChanged += comboBoxIdlePause_SelectedValueChanged;
trackBarOpacity.ValueChanged += trackBarOpacity_ValueChanged;
checkNotificationTimer.CheckedChanged += checkNotificationTimer_CheckedChanged; checkNotificationTimer.CheckedChanged += checkNotificationTimer_CheckedChanged;
checkTimerCountDown.CheckedChanged += checkTimerCountDown_CheckedChanged; checkTimerCountDown.CheckedChanged += checkTimerCountDown_CheckedChanged;
@@ -176,6 +180,13 @@ namespace TweetDuck.Dialogs.Settings{
Config.NotificationIdlePauseSeconds = IdlePauseSeconds[comboBoxIdlePause.SelectedIndex]; 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 #endregion
#region Timer #region Timer

View File

@@ -57,7 +57,7 @@
// //
this.labelVolumeValue.BackColor = System.Drawing.Color.Transparent; this.labelVolumeValue.BackColor = System.Drawing.Color.Transparent;
this.labelVolumeValue.Font = new System.Drawing.Font("Segoe UI", 9F); 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.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.labelVolumeValue.Name = "labelVolumeValue"; this.labelVolumeValue.Name = "labelVolumeValue";
this.labelVolumeValue.Size = new System.Drawing.Size(38, 15); this.labelVolumeValue.Size = new System.Drawing.Size(38, 15);
@@ -144,7 +144,7 @@
this.trackBarVolume.Location = new System.Drawing.Point(3, 3); this.trackBarVolume.Location = new System.Drawing.Point(3, 3);
this.trackBarVolume.Maximum = 100; this.trackBarVolume.Maximum = 100;
this.trackBarVolume.Name = "trackBarVolume"; 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.TabIndex = 0;
this.trackBarVolume.TickFrequency = 10; this.trackBarVolume.TickFrequency = 10;
this.trackBarVolume.Value = 100; this.trackBarVolume.Value = 100;

View File

@@ -6,6 +6,6 @@ using Version = TweetDuck.Version;
namespace TweetDuck{ namespace TweetDuck{
internal static class Version{ internal static class Version{
public const string Tag = "1.18.4"; public const string Tag = "1.18.5";
} }
} }