mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-09-14 10:32:10 +02:00
Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
0f6a93ae8f | |||
25eae334b0 | |||
74377d01ce | |||
6e78ba1e7b | |||
39e0dedf27 | |||
bbe2c88802 | |||
586b31b63e | |||
041abe6d7e | |||
a69b3cd05f | |||
b48213e79e | |||
5bbc14aca5 | |||
8ccbf502e8 | |||
c426ca97e2 | |||
d9eef86a8b | |||
3fed921748 | |||
02827d53a2 | |||
1ad5fde9ae | |||
909d5ed99c |
@@ -14,7 +14,7 @@ namespace TweetDck.Configuration{
|
|||||||
sealed class UserConfig{
|
sealed class UserConfig{
|
||||||
private static readonly IFormatter Formatter = new BinaryFormatter();
|
private static readonly IFormatter Formatter = new BinaryFormatter();
|
||||||
|
|
||||||
private const int CurrentFileVersion = 7;
|
private const int CurrentFileVersion = 8;
|
||||||
|
|
||||||
// START OF CONFIGURATION
|
// START OF CONFIGURATION
|
||||||
|
|
||||||
@@ -68,6 +68,28 @@ namespace TweetDck.Configuration{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int ZoomLevel{
|
||||||
|
get{
|
||||||
|
return zoomLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
set{
|
||||||
|
if (zoomLevel == value)return;
|
||||||
|
|
||||||
|
zoomLevel = value;
|
||||||
|
|
||||||
|
if (ZoomLevelChanged != null){
|
||||||
|
ZoomLevelChanged(this, new EventArgs());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public double ZoomMultiplier{
|
||||||
|
get{
|
||||||
|
return zoomLevel/100.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string NotificationSoundPath{
|
public string NotificationSoundPath{
|
||||||
get{
|
get{
|
||||||
return string.IsNullOrEmpty(notificationSoundPath) ? string.Empty : notificationSoundPath;
|
return string.IsNullOrEmpty(notificationSoundPath) ? string.Empty : notificationSoundPath;
|
||||||
@@ -99,6 +121,9 @@ namespace TweetDck.Configuration{
|
|||||||
[field:NonSerialized]
|
[field:NonSerialized]
|
||||||
public event EventHandler MuteToggled;
|
public event EventHandler MuteToggled;
|
||||||
|
|
||||||
|
[field:NonSerialized]
|
||||||
|
public event EventHandler ZoomLevelChanged;
|
||||||
|
|
||||||
[field:NonSerialized]
|
[field:NonSerialized]
|
||||||
public event EventHandler TrayBehaviorChanged;
|
public event EventHandler TrayBehaviorChanged;
|
||||||
|
|
||||||
@@ -107,6 +132,7 @@ namespace TweetDck.Configuration{
|
|||||||
|
|
||||||
private int fileVersion;
|
private int fileVersion;
|
||||||
private bool muteNotifications;
|
private bool muteNotifications;
|
||||||
|
private int zoomLevel;
|
||||||
private string notificationSoundPath;
|
private string notificationSoundPath;
|
||||||
private TrayIcon.Behavior trayBehavior;
|
private TrayIcon.Behavior trayBehavior;
|
||||||
|
|
||||||
@@ -114,6 +140,7 @@ namespace TweetDck.Configuration{
|
|||||||
this.file = file;
|
this.file = file;
|
||||||
|
|
||||||
BrowserWindow = new WindowState();
|
BrowserWindow = new WindowState();
|
||||||
|
ZoomLevel = 100;
|
||||||
DisplayNotificationTimer = true;
|
DisplayNotificationTimer = true;
|
||||||
NotificationNonIntrusiveMode = true;
|
NotificationNonIntrusiveMode = true;
|
||||||
NotificationPosition = TweetNotification.Position.TopRight;
|
NotificationPosition = TweetNotification.Position.TopRight;
|
||||||
@@ -175,6 +202,11 @@ namespace TweetDck.Configuration{
|
|||||||
++fileVersion;
|
++fileVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fileVersion == 7){
|
||||||
|
ZoomLevel = 100;
|
||||||
|
++fileVersion;
|
||||||
|
}
|
||||||
|
|
||||||
// update the version
|
// update the version
|
||||||
fileVersion = CurrentFileVersion;
|
fileVersion = CurrentFileVersion;
|
||||||
Save();
|
Save();
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using TweetDck.Core.Utils;
|
using TweetDck.Core.Utils;
|
||||||
|
|
||||||
@@ -20,6 +21,10 @@ namespace TweetDck.Core.Controls{
|
|||||||
control.BeginInvoke(func);
|
control.BeginInvoke(func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsFullyOutsideView(this Form form){
|
||||||
|
return !Screen.AllScreens.Any(screen => screen.WorkingArea.IntersectsWith(form.Bounds));
|
||||||
|
}
|
||||||
|
|
||||||
public static void MoveToCenter(this Form targetForm, Form parentForm){
|
public static void MoveToCenter(this Form targetForm, Form parentForm){
|
||||||
targetForm.Location = new Point(parentForm.Location.X+parentForm.Width/2-targetForm.Width/2, parentForm.Location.Y+parentForm.Height/2-targetForm.Height/2);
|
targetForm.Location = new Point(parentForm.Location.X+parentForm.Width/2-targetForm.Width/2, parentForm.Location.Y+parentForm.Height/2-targetForm.Height/2);
|
||||||
}
|
}
|
||||||
|
@@ -109,6 +109,7 @@ namespace TweetDck.Core{
|
|||||||
UpdateTrayIcon();
|
UpdateTrayIcon();
|
||||||
|
|
||||||
Config.MuteToggled += Config_MuteToggled;
|
Config.MuteToggled += Config_MuteToggled;
|
||||||
|
Config.ZoomLevelChanged += Config_ZoomLevelChanged;
|
||||||
|
|
||||||
this.updates = new UpdateHandler(browser, this, updaterSettings);
|
this.updates = new UpdateHandler(browser, this, updaterSettings);
|
||||||
this.updates.UpdateAccepted += updates_UpdateAccepted;
|
this.updates.UpdateAccepted += updates_UpdateAccepted;
|
||||||
@@ -171,8 +172,14 @@ namespace TweetDck.Core{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e){
|
private void browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e){
|
||||||
if (e.Frame.IsMain && BrowserUtils.IsTwitterWebsite(e.Frame)){
|
if (e.Frame.IsMain){
|
||||||
ScriptLoader.ExecuteFile(e.Frame, "twitter.js");
|
if (Config.ZoomLevel != 100){
|
||||||
|
BrowserUtils.SetZoomLevel(browser.GetBrowser(), Config.ZoomLevel);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BrowserUtils.IsTwitterWebsite(e.Frame)){
|
||||||
|
ScriptLoader.ExecuteFile(e.Frame, "twitter.js");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,6 +260,10 @@ namespace TweetDck.Core{
|
|||||||
UpdateProperties(PropertyBridge.Properties.MuteNotifications);
|
UpdateProperties(PropertyBridge.Properties.MuteNotifications);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Config_ZoomLevelChanged(object sender, EventArgs e){
|
||||||
|
BrowserUtils.SetZoomLevel(browser.GetBrowser(), Config.ZoomLevel);
|
||||||
|
}
|
||||||
|
|
||||||
private void Config_TrayBehaviorChanged(object sender, EventArgs e){
|
private void Config_TrayBehaviorChanged(object sender, EventArgs e){
|
||||||
UpdateTrayIcon();
|
UpdateTrayIcon();
|
||||||
}
|
}
|
||||||
@@ -329,7 +340,7 @@ namespace TweetDck.Core{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isBrowserReady && m.Msg == 0x210 && (m.WParam.ToInt32() & 0xFFFF) == 0x020B){ // WM_PARENTNOTIFY, WM_XBUTTONDOWN
|
if (isBrowserReady && m.Msg == NativeMethods.WM_PARENTNOTIFY && (m.WParam.ToInt32() & 0xFFFF) == NativeMethods.WM_XBUTTONDOWN){
|
||||||
browser.ExecuteScriptAsync("TDGF_onMouseClickExtra", (m.WParam.ToInt32() >> 16) & 0xFFFF);
|
browser.ExecuteScriptAsync("TDGF_onMouseClickExtra", (m.WParam.ToInt32() >> 16) & 0xFFFF);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -188,16 +188,7 @@ namespace TweetDck.Core.Notification{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void SetNotificationSize(int width, int height){
|
protected virtual void SetNotificationSize(int width, int height){
|
||||||
browser.ClientSize = ClientSize = new Size(width, height);
|
browser.ClientSize = ClientSize = new Size((int)Math.Round(width*Program.UserConfig.ZoomMultiplier), (int)Math.Round(height*Program.UserConfig.ZoomMultiplier));
|
||||||
}
|
|
||||||
|
|
||||||
protected void MoveToVisibleLocation(){
|
|
||||||
bool needsReactivating = Location == ControlExtensions.InvisibleLocation;
|
|
||||||
Location = PrimaryLocation;
|
|
||||||
|
|
||||||
if (needsReactivating){
|
|
||||||
NativeMethods.SetFormPos(this, NativeMethods.HWND_TOPMOST, NativeMethods.SWP_NOACTIVATE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnNotificationReady(){
|
protected virtual void OnNotificationReady(){
|
||||||
@@ -208,6 +199,15 @@ namespace TweetDck.Core.Notification{
|
|||||||
Text = string.IsNullOrEmpty(currentColumn) || !Program.UserConfig.DisplayNotificationColumn ? Program.BrandName : Program.BrandName+" - "+currentColumn;
|
Text = string.IsNullOrEmpty(currentColumn) || !Program.UserConfig.DisplayNotificationColumn ? Program.BrandName : Program.BrandName+" - "+currentColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void MoveToVisibleLocation(){
|
||||||
|
bool needsReactivating = Location == ControlExtensions.InvisibleLocation;
|
||||||
|
Location = PrimaryLocation;
|
||||||
|
|
||||||
|
if (needsReactivating){
|
||||||
|
NativeMethods.SetFormPos(this, NativeMethods.HWND_TOPMOST, NativeMethods.SWP_NOACTIVATE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void DisplayTooltip(string text){
|
public void DisplayTooltip(string text){
|
||||||
if (string.IsNullOrEmpty(text)){
|
if (string.IsNullOrEmpty(text)){
|
||||||
toolTip.Hide(this);
|
toolTip.Hide(this);
|
||||||
|
@@ -26,14 +26,16 @@ namespace TweetDck.Core.Notification{
|
|||||||
private static int BaseClientWidth{
|
private static int BaseClientWidth{
|
||||||
get{
|
get{
|
||||||
int level = TweetNotification.FontSizeLevel;
|
int level = TweetNotification.FontSizeLevel;
|
||||||
return level == 0 ? 284 : (int)Math.Round(284.0*(1.0+0.05*level));
|
int width = level == 0 ? 284 : (int)Math.Round(284.0*(1.0+0.05*level));
|
||||||
|
return (int)Math.Round(width*Program.UserConfig.ZoomMultiplier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int BaseClientHeight{
|
private static int BaseClientHeight{
|
||||||
get{
|
get{
|
||||||
int level = TweetNotification.FontSizeLevel;
|
int level = TweetNotification.FontSizeLevel;
|
||||||
return level == 0 ? 118 : (int)Math.Round(118.0*(1.0+0.075*level));
|
int height = level == 0 ? 118 : (int)Math.Round(118.0*(1.0+0.075*level));
|
||||||
|
return (int)Math.Round(height*Program.UserConfig.ZoomMultiplier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,6 +46,7 @@ namespace TweetDck.Core.Notification{
|
|||||||
|
|
||||||
private readonly NativeMethods.HookProc mouseHookDelegate;
|
private readonly NativeMethods.HookProc mouseHookDelegate;
|
||||||
private IntPtr mouseHook;
|
private IntPtr mouseHook;
|
||||||
|
private bool blockXButtonUp;
|
||||||
|
|
||||||
private bool? prevDisplayTimer;
|
private bool? prevDisplayTimer;
|
||||||
private int? prevFontSize;
|
private int? prevFontSize;
|
||||||
@@ -77,7 +80,7 @@ namespace TweetDck.Core.Notification{
|
|||||||
browser.FrameLoadEnd += Browser_FrameLoadEnd;
|
browser.FrameLoadEnd += Browser_FrameLoadEnd;
|
||||||
|
|
||||||
mouseHookDelegate = MouseHookProc;
|
mouseHookDelegate = MouseHookProc;
|
||||||
Disposed += (sender, args) => StopMouseHook();
|
Disposed += (sender, args) => StopMouseHook(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// mouse wheel hook
|
// mouse wheel hook
|
||||||
@@ -88,17 +91,44 @@ namespace TweetDck.Core.Notification{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StopMouseHook(){
|
private void StopMouseHook(bool force){
|
||||||
if (mouseHook != IntPtr.Zero){
|
if (mouseHook != IntPtr.Zero && (force || !blockXButtonUp)){
|
||||||
NativeMethods.UnhookWindowsHookEx(mouseHook);
|
NativeMethods.UnhookWindowsHookEx(mouseHook);
|
||||||
mouseHook = IntPtr.Zero;
|
mouseHook = IntPtr.Zero;
|
||||||
|
blockXButtonUp = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IntPtr MouseHookProc(int nCode, IntPtr wParam, IntPtr lParam){
|
private IntPtr MouseHookProc(int nCode, IntPtr wParam, IntPtr lParam){
|
||||||
if (nCode == 0 && wParam.ToInt32() == NativeMethods.WM_MOUSEWHEEL && browser.Bounds.Contains(PointToClient(Cursor.Position)) && !ContainsFocus && !owner.ContainsFocus){
|
if (nCode == 0){
|
||||||
browser.SendMouseWheelEvent(0, 0, 0, NativeMethods.GetHookWheelDelta(lParam), CefEventFlags.None);
|
int eventType = wParam.ToInt32();
|
||||||
return NativeMethods.HOOK_HANDLED;
|
|
||||||
|
if (eventType == NativeMethods.WM_MOUSEWHEEL && browser.Bounds.Contains(PointToClient(Cursor.Position)) && !ContainsFocus && !owner.ContainsFocus){
|
||||||
|
browser.SendMouseWheelEvent(0, 0, 0, NativeMethods.GetMouseHookData(lParam), CefEventFlags.None);
|
||||||
|
return NativeMethods.HOOK_HANDLED;
|
||||||
|
}
|
||||||
|
else if (eventType == NativeMethods.WM_XBUTTONDOWN && DesktopBounds.Contains(Cursor.Position)){
|
||||||
|
int extraButton = NativeMethods.GetMouseHookData(lParam);
|
||||||
|
|
||||||
|
if (extraButton == 2){ // forward button
|
||||||
|
this.InvokeAsyncSafe(FinishCurrentNotification);
|
||||||
|
}
|
||||||
|
else if (extraButton == 1){ // back button
|
||||||
|
this.InvokeAsyncSafe(Close);
|
||||||
|
}
|
||||||
|
|
||||||
|
blockXButtonUp = true;
|
||||||
|
return NativeMethods.HOOK_HANDLED;
|
||||||
|
}
|
||||||
|
else if (eventType == NativeMethods.WM_XBUTTONUP && blockXButtonUp){
|
||||||
|
blockXButtonUp = false;
|
||||||
|
|
||||||
|
if (!Visible){
|
||||||
|
StopMouseHook(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NativeMethods.HOOK_HANDLED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NativeMethods.CallNextHookEx(mouseHook, nCode, wParam, lParam);
|
return NativeMethods.CallNextHookEx(mouseHook, nCode, wParam, lParam);
|
||||||
@@ -177,7 +207,7 @@ namespace TweetDck.Core.Notification{
|
|||||||
timerProgress.Stop();
|
timerProgress.Stop();
|
||||||
totalTime = 0;
|
totalTime = 0;
|
||||||
|
|
||||||
StopMouseHook();
|
StopMouseHook(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void FinishCurrentNotification(){
|
public override void FinishCurrentNotification(){
|
||||||
@@ -188,7 +218,7 @@ namespace TweetDck.Core.Notification{
|
|||||||
if (!IsPaused){
|
if (!IsPaused){
|
||||||
pausedDuringNotification = IsNotificationVisible;
|
pausedDuringNotification = IsNotificationVisible;
|
||||||
timerProgress.Stop();
|
timerProgress.Stop();
|
||||||
StopMouseHook();
|
StopMouseHook(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
base.PauseNotification();
|
base.PauseNotification();
|
||||||
|
@@ -16,7 +16,7 @@ namespace TweetDck.Core.Notification.Screenshot{
|
|||||||
public TweetScreenshotManager(Form owner){
|
public TweetScreenshotManager(Form owner){
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
|
|
||||||
this.timeout = new Timer{ Interval = 5000 };
|
this.timeout = new Timer{ Interval = 8000 };
|
||||||
this.timeout.Tick += timeout_Tick;
|
this.timeout.Tick += timeout_Tick;
|
||||||
|
|
||||||
this.disposer = new Timer{ Interval = 1 };
|
this.disposer = new Timer{ Interval = 1 };
|
||||||
@@ -61,6 +61,7 @@ namespace TweetDck.Core.Notification.Screenshot{
|
|||||||
screenshot.Location = ControlExtensions.InvisibleLocation;
|
screenshot.Location = ControlExtensions.InvisibleLocation;
|
||||||
disposer.Start();
|
disposer.Start();
|
||||||
#else
|
#else
|
||||||
|
screenshot.MoveToVisibleLocation();
|
||||||
screenshot.FormClosed += (sender, args) => disposer.Start();
|
screenshot.FormClosed += (sender, args) => disposer.Start();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -36,20 +36,28 @@ namespace TweetDck.Core.Notification.Sound{
|
|||||||
void ISoundNotificationPlayer.Play(string file){
|
void ISoundNotificationPlayer.Play(string file){
|
||||||
wasTryingToPlay = true;
|
wasTryingToPlay = true;
|
||||||
|
|
||||||
if (player.URL != file){
|
try{
|
||||||
player.close();
|
if (player.URL != file){
|
||||||
player.URL = file;
|
player.close();
|
||||||
ignorePlaybackError = false;
|
player.URL = file;
|
||||||
}
|
ignorePlaybackError = false;
|
||||||
else{
|
}
|
||||||
player.controls.stop();
|
else{
|
||||||
}
|
player.controls.stop();
|
||||||
|
}
|
||||||
|
|
||||||
player.controls.play();
|
player.controls.play();
|
||||||
|
}catch(Exception e){
|
||||||
|
OnNotificationSoundError("An error occurred in Windows Media Player: "+e.Message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ISoundNotificationPlayer.Stop(){
|
void ISoundNotificationPlayer.Stop(){
|
||||||
player.controls.stop();
|
try{
|
||||||
|
player.controls.stop();
|
||||||
|
}catch{
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IDisposable.Dispose(){
|
void IDisposable.Dispose(){
|
||||||
|
61
Core/Other/Settings/TabSettingsGeneral.Designer.cs
generated
61
Core/Other/Settings/TabSettingsGeneral.Designer.cs
generated
@@ -34,9 +34,14 @@
|
|||||||
this.groupTray = new System.Windows.Forms.GroupBox();
|
this.groupTray = new System.Windows.Forms.GroupBox();
|
||||||
this.labelTrayIcon = new System.Windows.Forms.Label();
|
this.labelTrayIcon = new System.Windows.Forms.Label();
|
||||||
this.groupInterface = new System.Windows.Forms.GroupBox();
|
this.groupInterface = new System.Windows.Forms.GroupBox();
|
||||||
|
this.labelZoomValue = new System.Windows.Forms.Label();
|
||||||
|
this.trackBarZoom = new System.Windows.Forms.TrackBar();
|
||||||
|
this.labelZoom = new System.Windows.Forms.Label();
|
||||||
this.groupUpdates = new System.Windows.Forms.GroupBox();
|
this.groupUpdates = new System.Windows.Forms.GroupBox();
|
||||||
|
this.zoomUpdateTimer = new System.Windows.Forms.Timer(this.components);
|
||||||
this.groupTray.SuspendLayout();
|
this.groupTray.SuspendLayout();
|
||||||
this.groupInterface.SuspendLayout();
|
this.groupInterface.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.trackBarZoom)).BeginInit();
|
||||||
this.groupUpdates.SuspendLayout();
|
this.groupUpdates.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
@@ -116,7 +121,7 @@
|
|||||||
this.groupTray.Controls.Add(this.checkTrayHighlight);
|
this.groupTray.Controls.Add(this.checkTrayHighlight);
|
||||||
this.groupTray.Controls.Add(this.labelTrayIcon);
|
this.groupTray.Controls.Add(this.labelTrayIcon);
|
||||||
this.groupTray.Controls.Add(this.comboBoxTrayType);
|
this.groupTray.Controls.Add(this.comboBoxTrayType);
|
||||||
this.groupTray.Location = new System.Drawing.Point(9, 82);
|
this.groupTray.Location = new System.Drawing.Point(9, 145);
|
||||||
this.groupTray.Name = "groupTray";
|
this.groupTray.Name = "groupTray";
|
||||||
this.groupTray.Size = new System.Drawing.Size(183, 93);
|
this.groupTray.Size = new System.Drawing.Size(183, 93);
|
||||||
this.groupTray.TabIndex = 1;
|
this.groupTray.TabIndex = 1;
|
||||||
@@ -135,15 +140,57 @@
|
|||||||
//
|
//
|
||||||
// groupInterface
|
// groupInterface
|
||||||
//
|
//
|
||||||
|
this.groupInterface.Controls.Add(this.labelZoomValue);
|
||||||
|
this.groupInterface.Controls.Add(this.trackBarZoom);
|
||||||
|
this.groupInterface.Controls.Add(this.labelZoom);
|
||||||
this.groupInterface.Controls.Add(this.checkSpellCheck);
|
this.groupInterface.Controls.Add(this.checkSpellCheck);
|
||||||
this.groupInterface.Controls.Add(this.checkExpandLinks);
|
this.groupInterface.Controls.Add(this.checkExpandLinks);
|
||||||
this.groupInterface.Location = new System.Drawing.Point(9, 9);
|
this.groupInterface.Location = new System.Drawing.Point(9, 9);
|
||||||
this.groupInterface.Name = "groupInterface";
|
this.groupInterface.Name = "groupInterface";
|
||||||
this.groupInterface.Size = new System.Drawing.Size(183, 67);
|
this.groupInterface.Size = new System.Drawing.Size(183, 130);
|
||||||
this.groupInterface.TabIndex = 0;
|
this.groupInterface.TabIndex = 0;
|
||||||
this.groupInterface.TabStop = false;
|
this.groupInterface.TabStop = false;
|
||||||
this.groupInterface.Text = "User Interface";
|
this.groupInterface.Text = "User Interface";
|
||||||
//
|
//
|
||||||
|
// labelZoomValue
|
||||||
|
//
|
||||||
|
this.labelZoomValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.labelZoomValue.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.labelZoomValue.Location = new System.Drawing.Point(139, 93);
|
||||||
|
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);
|
||||||
|
this.labelZoomValue.TabIndex = 4;
|
||||||
|
this.labelZoomValue.Text = "100%";
|
||||||
|
this.labelZoomValue.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||||
|
this.toolTip.SetToolTip(this.labelZoomValue, "Changes the zoom level.\r\nAlso affects notifications and screenshots.");
|
||||||
|
//
|
||||||
|
// trackBarZoom
|
||||||
|
//
|
||||||
|
this.trackBarZoom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.trackBarZoom.AutoSize = false;
|
||||||
|
this.trackBarZoom.LargeChange = 25;
|
||||||
|
this.trackBarZoom.Location = new System.Drawing.Point(6, 92);
|
||||||
|
this.trackBarZoom.Maximum = 200;
|
||||||
|
this.trackBarZoom.Minimum = 50;
|
||||||
|
this.trackBarZoom.Name = "trackBarZoom";
|
||||||
|
this.trackBarZoom.Size = new System.Drawing.Size(141, 30);
|
||||||
|
this.trackBarZoom.SmallChange = 5;
|
||||||
|
this.trackBarZoom.TabIndex = 3;
|
||||||
|
this.trackBarZoom.TickFrequency = 25;
|
||||||
|
this.trackBarZoom.Value = 100;
|
||||||
|
//
|
||||||
|
// labelZoom
|
||||||
|
//
|
||||||
|
this.labelZoom.AutoSize = true;
|
||||||
|
this.labelZoom.Location = new System.Drawing.Point(5, 76);
|
||||||
|
this.labelZoom.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
|
||||||
|
this.labelZoom.Name = "labelZoom";
|
||||||
|
this.labelZoom.Size = new System.Drawing.Size(34, 13);
|
||||||
|
this.labelZoom.TabIndex = 2;
|
||||||
|
this.labelZoom.Text = "Zoom";
|
||||||
|
//
|
||||||
// groupUpdates
|
// groupUpdates
|
||||||
//
|
//
|
||||||
this.groupUpdates.Controls.Add(this.checkUpdateNotifications);
|
this.groupUpdates.Controls.Add(this.checkUpdateNotifications);
|
||||||
@@ -155,6 +202,11 @@
|
|||||||
this.groupUpdates.TabStop = false;
|
this.groupUpdates.TabStop = false;
|
||||||
this.groupUpdates.Text = "Updates";
|
this.groupUpdates.Text = "Updates";
|
||||||
//
|
//
|
||||||
|
// zoomUpdateTimer
|
||||||
|
//
|
||||||
|
this.zoomUpdateTimer.Interval = 250;
|
||||||
|
this.zoomUpdateTimer.Tick += new System.EventHandler(this.zoomUpdateTimer_Tick);
|
||||||
|
//
|
||||||
// TabSettingsGeneral
|
// TabSettingsGeneral
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@@ -168,6 +220,7 @@
|
|||||||
this.groupTray.PerformLayout();
|
this.groupTray.PerformLayout();
|
||||||
this.groupInterface.ResumeLayout(false);
|
this.groupInterface.ResumeLayout(false);
|
||||||
this.groupInterface.PerformLayout();
|
this.groupInterface.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.trackBarZoom)).EndInit();
|
||||||
this.groupUpdates.ResumeLayout(false);
|
this.groupUpdates.ResumeLayout(false);
|
||||||
this.groupUpdates.PerformLayout();
|
this.groupUpdates.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
@@ -187,5 +240,9 @@
|
|||||||
private System.Windows.Forms.GroupBox groupUpdates;
|
private System.Windows.Forms.GroupBox groupUpdates;
|
||||||
private System.Windows.Forms.CheckBox checkUpdateNotifications;
|
private System.Windows.Forms.CheckBox checkUpdateNotifications;
|
||||||
private System.Windows.Forms.Button btnCheckUpdates;
|
private System.Windows.Forms.Button btnCheckUpdates;
|
||||||
|
private System.Windows.Forms.Label labelZoom;
|
||||||
|
private System.Windows.Forms.Label labelZoomValue;
|
||||||
|
private System.Windows.Forms.TrackBar trackBarZoom;
|
||||||
|
private System.Windows.Forms.Timer zoomUpdateTimer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using TweetDck.Core.Controls;
|
||||||
using TweetDck.Updates;
|
using TweetDck.Updates;
|
||||||
using TweetDck.Updates.Events;
|
using TweetDck.Updates.Events;
|
||||||
|
|
||||||
@@ -21,6 +22,10 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
comboBoxTrayType.Items.Add("Close to Tray");
|
comboBoxTrayType.Items.Add("Close to Tray");
|
||||||
comboBoxTrayType.Items.Add("Combined");
|
comboBoxTrayType.Items.Add("Combined");
|
||||||
comboBoxTrayType.SelectedIndex = Math.Min(Math.Max((int)Config.TrayBehavior, 0), comboBoxTrayType.Items.Count-1);
|
comboBoxTrayType.SelectedIndex = Math.Min(Math.Max((int)Config.TrayBehavior, 0), comboBoxTrayType.Items.Count-1);
|
||||||
|
|
||||||
|
toolTip.SetToolTip(trackBarZoom, toolTip.GetToolTip(labelZoomValue));
|
||||||
|
trackBarZoom.SetValueSafe(Config.ZoomLevel);
|
||||||
|
labelZoomValue.Text = trackBarZoom.Value+"%";
|
||||||
|
|
||||||
checkExpandLinks.Checked = Config.ExpandLinksOnHover;
|
checkExpandLinks.Checked = Config.ExpandLinksOnHover;
|
||||||
checkSpellCheck.Checked = Config.EnableSpellCheck;
|
checkSpellCheck.Checked = Config.EnableSpellCheck;
|
||||||
@@ -32,6 +37,7 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
public override void OnReady(){
|
public override void OnReady(){
|
||||||
checkExpandLinks.CheckedChanged += checkExpandLinks_CheckedChanged;
|
checkExpandLinks.CheckedChanged += checkExpandLinks_CheckedChanged;
|
||||||
checkSpellCheck.CheckedChanged += checkSpellCheck_CheckedChanged;
|
checkSpellCheck.CheckedChanged += checkSpellCheck_CheckedChanged;
|
||||||
|
trackBarZoom.ValueChanged += trackBarZoom_ValueChanged;
|
||||||
|
|
||||||
comboBoxTrayType.SelectedIndexChanged += comboBoxTrayType_SelectedIndexChanged;
|
comboBoxTrayType.SelectedIndexChanged += comboBoxTrayType_SelectedIndexChanged;
|
||||||
checkTrayHighlight.CheckedChanged += checkTrayHighlight_CheckedChanged;
|
checkTrayHighlight.CheckedChanged += checkTrayHighlight_CheckedChanged;
|
||||||
@@ -40,6 +46,10 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
btnCheckUpdates.Click += btnCheckUpdates_Click;
|
btnCheckUpdates.Click += btnCheckUpdates_Click;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnClosing(){
|
||||||
|
Config.ZoomLevel = trackBarZoom.Value;
|
||||||
|
}
|
||||||
|
|
||||||
private void checkExpandLinks_CheckedChanged(object sender, EventArgs e){
|
private void checkExpandLinks_CheckedChanged(object sender, EventArgs e){
|
||||||
Config.ExpandLinksOnHover = checkExpandLinks.Checked;
|
Config.ExpandLinksOnHover = checkExpandLinks.Checked;
|
||||||
}
|
}
|
||||||
@@ -49,6 +59,17 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
PromptRestart();
|
PromptRestart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void trackBarZoom_ValueChanged(object sender, EventArgs e){
|
||||||
|
if (trackBarZoom.Value % trackBarZoom.SmallChange != 0){
|
||||||
|
trackBarZoom.Value = trackBarZoom.SmallChange*(int)Math.Floor(((double)trackBarZoom.Value/trackBarZoom.SmallChange)+0.5);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
zoomUpdateTimer.Stop();
|
||||||
|
zoomUpdateTimer.Start();
|
||||||
|
labelZoomValue.Text = trackBarZoom.Value+"%";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void comboBoxTrayType_SelectedIndexChanged(object sender, EventArgs e){
|
private void comboBoxTrayType_SelectedIndexChanged(object sender, EventArgs e){
|
||||||
Config.TrayBehavior = (TrayIcon.Behavior)comboBoxTrayType.SelectedIndex;
|
Config.TrayBehavior = (TrayIcon.Behavior)comboBoxTrayType.SelectedIndex;
|
||||||
}
|
}
|
||||||
@@ -82,5 +103,10 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void zoomUpdateTimer_Tick(object sender, EventArgs e){
|
||||||
|
Config.ZoomLevel = trackBarZoom.Value;
|
||||||
|
zoomUpdateTimer.Stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -48,9 +48,9 @@
|
|||||||
this.labelIdlePause = new System.Windows.Forms.Label();
|
this.labelIdlePause = new System.Windows.Forms.Label();
|
||||||
this.comboBoxIdlePause = new System.Windows.Forms.ComboBox();
|
this.comboBoxIdlePause = new System.Windows.Forms.ComboBox();
|
||||||
this.checkNonIntrusive = new System.Windows.Forms.CheckBox();
|
this.checkNonIntrusive = new System.Windows.Forms.CheckBox();
|
||||||
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
|
|
||||||
this.checkNotificationTimer = new System.Windows.Forms.CheckBox();
|
|
||||||
this.checkTimerCountDown = new System.Windows.Forms.CheckBox();
|
this.checkTimerCountDown = new System.Windows.Forms.CheckBox();
|
||||||
|
this.checkNotificationTimer = new System.Windows.Forms.CheckBox();
|
||||||
|
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
|
||||||
this.groupNotificationLocation.SuspendLayout();
|
this.groupNotificationLocation.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.trackBarEdgeDistance)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.trackBarEdgeDistance)).BeginInit();
|
||||||
this.groupNotificationDuration.SuspendLayout();
|
this.groupNotificationDuration.SuspendLayout();
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.comboBoxDisplay.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.comboBoxDisplay.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.comboBoxDisplay.FormattingEnabled = true;
|
this.comboBoxDisplay.FormattingEnabled = true;
|
||||||
this.comboBoxDisplay.Location = new System.Drawing.Point(8, 160);
|
this.comboBoxDisplay.Location = new System.Drawing.Point(6, 160);
|
||||||
this.comboBoxDisplay.Name = "comboBoxDisplay";
|
this.comboBoxDisplay.Name = "comboBoxDisplay";
|
||||||
this.comboBoxDisplay.Size = new System.Drawing.Size(171, 21);
|
this.comboBoxDisplay.Size = new System.Drawing.Size(171, 21);
|
||||||
this.comboBoxDisplay.TabIndex = 6;
|
this.comboBoxDisplay.TabIndex = 6;
|
||||||
@@ -185,12 +185,13 @@
|
|||||||
//
|
//
|
||||||
this.trackBarEdgeDistance.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
this.trackBarEdgeDistance.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.trackBarEdgeDistance.AutoSize = false;
|
||||||
this.trackBarEdgeDistance.LargeChange = 8;
|
this.trackBarEdgeDistance.LargeChange = 8;
|
||||||
this.trackBarEdgeDistance.Location = new System.Drawing.Point(8, 212);
|
this.trackBarEdgeDistance.Location = new System.Drawing.Point(8, 212);
|
||||||
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(141, 45);
|
this.trackBarEdgeDistance.Size = new System.Drawing.Size(141, 30);
|
||||||
this.trackBarEdgeDistance.SmallChange = 2;
|
this.trackBarEdgeDistance.SmallChange = 2;
|
||||||
this.trackBarEdgeDistance.TabIndex = 8;
|
this.trackBarEdgeDistance.TabIndex = 8;
|
||||||
this.trackBarEdgeDistance.TickFrequency = 4;
|
this.trackBarEdgeDistance.TickFrequency = 4;
|
||||||
@@ -288,11 +289,12 @@
|
|||||||
//
|
//
|
||||||
this.trackBarDuration.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
this.trackBarDuration.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.trackBarDuration.AutoSize = false;
|
||||||
this.trackBarDuration.Location = new System.Drawing.Point(6, 19);
|
this.trackBarDuration.Location = new System.Drawing.Point(6, 19);
|
||||||
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(128, 45);
|
this.trackBarDuration.Size = new System.Drawing.Size(128, 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;
|
||||||
@@ -342,7 +344,7 @@
|
|||||||
//
|
//
|
||||||
this.labelIdlePause.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
this.labelIdlePause.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.labelIdlePause.AutoSize = true;
|
this.labelIdlePause.AutoSize = true;
|
||||||
this.labelIdlePause.Location = new System.Drawing.Point(3, 141);
|
this.labelIdlePause.Location = new System.Drawing.Point(5, 141);
|
||||||
this.labelIdlePause.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
|
this.labelIdlePause.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
|
||||||
this.labelIdlePause.Name = "labelIdlePause";
|
this.labelIdlePause.Name = "labelIdlePause";
|
||||||
this.labelIdlePause.Size = new System.Drawing.Size(89, 13);
|
this.labelIdlePause.Size = new System.Drawing.Size(89, 13);
|
||||||
@@ -374,17 +376,6 @@
|
|||||||
"delayed until the cursor moves away to prevent accidental clicks.");
|
"delayed until the cursor moves away to prevent accidental clicks.");
|
||||||
this.checkNonIntrusive.UseVisualStyleBackColor = true;
|
this.checkNonIntrusive.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// checkNotificationTimer
|
|
||||||
//
|
|
||||||
this.checkNotificationTimer.AutoSize = true;
|
|
||||||
this.checkNotificationTimer.Location = new System.Drawing.Point(9, 44);
|
|
||||||
this.checkNotificationTimer.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
|
|
||||||
this.checkNotificationTimer.Name = "checkNotificationTimer";
|
|
||||||
this.checkNotificationTimer.Size = new System.Drawing.Size(145, 17);
|
|
||||||
this.checkNotificationTimer.TabIndex = 1;
|
|
||||||
this.checkNotificationTimer.Text = "Display Notification Timer";
|
|
||||||
this.checkNotificationTimer.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// checkTimerCountDown
|
// checkTimerCountDown
|
||||||
//
|
//
|
||||||
this.checkTimerCountDown.AutoSize = true;
|
this.checkTimerCountDown.AutoSize = true;
|
||||||
@@ -397,6 +388,17 @@
|
|||||||
this.toolTip.SetToolTip(this.checkTimerCountDown, "The notification timer counts down instead of up.");
|
this.toolTip.SetToolTip(this.checkTimerCountDown, "The notification timer counts down instead of up.");
|
||||||
this.checkTimerCountDown.UseVisualStyleBackColor = true;
|
this.checkTimerCountDown.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// checkNotificationTimer
|
||||||
|
//
|
||||||
|
this.checkNotificationTimer.AutoSize = true;
|
||||||
|
this.checkNotificationTimer.Location = new System.Drawing.Point(9, 44);
|
||||||
|
this.checkNotificationTimer.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
|
||||||
|
this.checkNotificationTimer.Name = "checkNotificationTimer";
|
||||||
|
this.checkNotificationTimer.Size = new System.Drawing.Size(145, 17);
|
||||||
|
this.checkNotificationTimer.TabIndex = 1;
|
||||||
|
this.checkNotificationTimer.Text = "Display Notification Timer";
|
||||||
|
this.checkNotificationTimer.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
// TabSettingsNotifications
|
// TabSettingsNotifications
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@@ -411,7 +413,6 @@
|
|||||||
this.groupNotificationLocation.PerformLayout();
|
this.groupNotificationLocation.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.trackBarEdgeDistance)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.trackBarEdgeDistance)).EndInit();
|
||||||
this.groupNotificationDuration.ResumeLayout(false);
|
this.groupNotificationDuration.ResumeLayout(false);
|
||||||
this.groupNotificationDuration.PerformLayout();
|
|
||||||
this.tableLayoutDurationButtons.ResumeLayout(false);
|
this.tableLayoutDurationButtons.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)(this.trackBarDuration)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.trackBarDuration)).EndInit();
|
||||||
this.groupUserInterface.ResumeLayout(false);
|
this.groupUserInterface.ResumeLayout(false);
|
||||||
|
@@ -17,7 +17,7 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
this.notification.CanMoveWindow = () => radioLocCustom.Checked;
|
this.notification.CanMoveWindow = () => radioLocCustom.Checked;
|
||||||
|
|
||||||
this.notification.Move += (sender, args) => {
|
this.notification.Move += (sender, args) => {
|
||||||
if (radioLocCustom.Checked){
|
if (radioLocCustom.Checked && this.notification.Location != ControlExtensions.InvisibleLocation){
|
||||||
Config.CustomNotificationPosition = this.notification.Location;
|
Config.CustomNotificationPosition = this.notification.Location;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -37,6 +37,9 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
case TweetNotification.Position.Custom: radioLocCustom.Checked = true; break;
|
case TweetNotification.Position.Custom: radioLocCustom.Checked = true; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
comboBoxDisplay.Enabled = trackBarEdgeDistance.Enabled = !radioLocCustom.Checked;
|
||||||
|
|
||||||
|
toolTip.SetToolTip(trackBarDuration, toolTip.GetToolTip(labelDurationValue));
|
||||||
trackBarDuration.SetValueSafe(Config.NotificationDurationValue);
|
trackBarDuration.SetValueSafe(Config.NotificationDurationValue);
|
||||||
labelDurationValue.Text = Config.NotificationDurationValue+" ms/c";
|
labelDurationValue.Text = Config.NotificationDurationValue+" ms/c";
|
||||||
|
|
||||||
@@ -73,7 +76,7 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
radioLocTR.CheckedChanged += radioLoc_CheckedChanged;
|
radioLocTR.CheckedChanged += radioLoc_CheckedChanged;
|
||||||
radioLocBL.CheckedChanged += radioLoc_CheckedChanged;
|
radioLocBL.CheckedChanged += radioLoc_CheckedChanged;
|
||||||
radioLocBR.CheckedChanged += radioLoc_CheckedChanged;
|
radioLocBR.CheckedChanged += radioLoc_CheckedChanged;
|
||||||
radioLocCustom.CheckedChanged += radioLoc_CheckedChanged;
|
radioLocCustom.Click += radioLocCustom_Click;
|
||||||
|
|
||||||
trackBarDuration.ValueChanged += trackBarDuration_ValueChanged;
|
trackBarDuration.ValueChanged += trackBarDuration_ValueChanged;
|
||||||
btnDurationShort.Click += btnDurationShort_Click;
|
btnDurationShort.Click += btnDurationShort_Click;
|
||||||
@@ -111,16 +114,30 @@ namespace TweetDck.Core.Other.Settings{
|
|||||||
else if (radioLocTR.Checked)Config.NotificationPosition = TweetNotification.Position.TopRight;
|
else if (radioLocTR.Checked)Config.NotificationPosition = TweetNotification.Position.TopRight;
|
||||||
else if (radioLocBL.Checked)Config.NotificationPosition = TweetNotification.Position.BottomLeft;
|
else if (radioLocBL.Checked)Config.NotificationPosition = TweetNotification.Position.BottomLeft;
|
||||||
else if (radioLocBR.Checked)Config.NotificationPosition = TweetNotification.Position.BottomRight;
|
else if (radioLocBR.Checked)Config.NotificationPosition = TweetNotification.Position.BottomRight;
|
||||||
else if (radioLocCustom.Checked){
|
|
||||||
if (!Config.IsCustomNotificationPositionSet){
|
|
||||||
Config.CustomNotificationPosition = notification.Location;
|
|
||||||
}
|
|
||||||
|
|
||||||
Config.NotificationPosition = TweetNotification.Position.Custom;
|
comboBoxDisplay.Enabled = trackBarEdgeDistance.Enabled = true;
|
||||||
|
notification.ShowNotificationForSettings(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void radioLocCustom_Click(object sender, EventArgs e){
|
||||||
|
if (!Config.IsCustomNotificationPositionSet){
|
||||||
|
Config.CustomNotificationPosition = notification.Location;
|
||||||
}
|
}
|
||||||
|
|
||||||
comboBoxDisplay.Enabled = trackBarEdgeDistance.Enabled = !radioLocCustom.Checked;
|
Config.NotificationPosition = TweetNotification.Position.Custom;
|
||||||
|
|
||||||
|
comboBoxDisplay.Enabled = trackBarEdgeDistance.Enabled = false;
|
||||||
notification.ShowNotificationForSettings(false);
|
notification.ShowNotificationForSettings(false);
|
||||||
|
|
||||||
|
if (notification.IsFullyOutsideView() && MessageBox.Show("The notification seems to be outside of view, would you like to reset its position?", "Notification is outside view", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes){
|
||||||
|
Config.NotificationPosition = TweetNotification.Position.TopRight;
|
||||||
|
notification.MoveToVisibleLocation();
|
||||||
|
|
||||||
|
Config.CustomNotificationPosition = notification.Location;
|
||||||
|
|
||||||
|
Config.NotificationPosition = TweetNotification.Position.Custom;
|
||||||
|
notification.MoveToVisibleLocation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void trackBarDuration_ValueChanged(object sender, EventArgs e){
|
private void trackBarDuration_ValueChanged(object sender, EventArgs e){
|
||||||
|
@@ -88,6 +88,10 @@ namespace TweetDck.Core.Utils{
|
|||||||
client.DownloadFileAsync(new Uri(url), target);
|
client.DownloadFileAsync(new Uri(url), target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SetZoomLevel(IBrowser browser, int percentage){
|
||||||
|
browser.GetHost().SetZoomLevel(Math.Log(percentage/100.0, 1.2));
|
||||||
|
}
|
||||||
|
|
||||||
public static bool IsTweetDeckWebsite(IFrame frame){
|
public static bool IsTweetDeckWebsite(IFrame frame){
|
||||||
return frame.Url.Contains("//tweetdeck.twitter.com/");
|
return frame.Url.Contains("//tweetdeck.twitter.com/");
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,9 @@ namespace TweetDck.Core.Utils{
|
|||||||
|
|
||||||
public const int WM_MOUSE_LL = 14;
|
public const int WM_MOUSE_LL = 14;
|
||||||
public const int WM_MOUSEWHEEL = 0x020A;
|
public const int WM_MOUSEWHEEL = 0x020A;
|
||||||
|
public const int WM_XBUTTONDOWN = 0x020B;
|
||||||
|
public const int WM_XBUTTONUP = 0x020C;
|
||||||
|
public const int WM_PARENTNOTIFY = 0x0210;
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
private struct LASTINPUTINFO{
|
private struct LASTINPUTINFO{
|
||||||
@@ -84,7 +87,7 @@ namespace TweetDck.Core.Utils{
|
|||||||
SetWindowPos(form.Handle.ToInt32(), hWndOrder, form.Left, form.Top, form.Width, form.Height, flags);
|
SetWindowPos(form.Handle.ToInt32(), hWndOrder, form.Left, form.Top, form.Width, form.Height, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetHookWheelDelta(IntPtr ptr){
|
public static int GetMouseHookData(IntPtr ptr){
|
||||||
return Marshal.PtrToStructure<MSLLHOOKSTRUCT>(ptr).mouseData >> 16;
|
return Marshal.PtrToStructure<MSLLHOOKSTRUCT>(ptr).mouseData >> 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using TweetDck.Core.Controls;
|
||||||
|
|
||||||
namespace TweetDck.Core.Utils{
|
namespace TweetDck.Core.Utils{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -20,7 +20,7 @@ namespace TweetDck.Core.Utils{
|
|||||||
form.WindowState = isMaximized ? FormWindowState.Maximized : FormWindowState.Normal;
|
form.WindowState = isMaximized ? FormWindowState.Maximized : FormWindowState.Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rect == Rectangle.Empty && firstTimeFullscreen) || !Screen.AllScreens.Any(screen => screen.WorkingArea.IntersectsWith(form.Bounds))){
|
if ((rect == Rectangle.Empty && firstTimeFullscreen) || form.IsFullyOutsideView()){
|
||||||
form.DesktopBounds = Screen.PrimaryScreen.WorkingArea;
|
form.DesktopBounds = Screen.PrimaryScreen.WorkingArea;
|
||||||
form.WindowState = FormWindowState.Maximized;
|
form.WindowState = FormWindowState.Maximized;
|
||||||
Save(form);
|
Save(form);
|
||||||
|
@@ -350,7 +350,7 @@
|
|||||||
|
|
||||||
window.TDGF_triggerScreenshot = function(){
|
window.TDGF_triggerScreenshot = function(){
|
||||||
if (selectedTweet){
|
if (selectedTweet){
|
||||||
var tweetWidth = selectedTweet.width();
|
var tweetWidth = Math.floor(selectedTweet.width());
|
||||||
var parent = selectedTweet.parent();
|
var parent = selectedTweet.parent();
|
||||||
|
|
||||||
var isDetail = parent.hasClass("js-tweet-detail");
|
var isDetail = parent.hasClass("js-tweet-detail");
|
||||||
@@ -394,7 +394,7 @@
|
|||||||
width: tweetWidth+"px"
|
width: tweetWidth+"px"
|
||||||
}).appendTo(document.body);
|
}).appendTo(document.body);
|
||||||
|
|
||||||
var realHeight = testTweet.height();
|
var realHeight = Math.floor(testTweet.height());
|
||||||
testTweet.remove();
|
testTweet.remove();
|
||||||
|
|
||||||
$TD.screenshotTweet(selectedTweet.html(), tweetWidth, realHeight);
|
$TD.screenshotTweet(selectedTweet.html(), tweetWidth, realHeight);
|
||||||
@@ -544,8 +544,15 @@
|
|||||||
|
|
||||||
styleOfficial.sheet.insertRule("a[data-full-url] { word-break: break-all; }", 0); // break long urls
|
styleOfficial.sheet.insertRule("a[data-full-url] { word-break: break-all; }", 0); // break long urls
|
||||||
styleOfficial.sheet.insertRule(".column-nav-link .attribution { position: absolute; }", 0); // fix cut off account names
|
styleOfficial.sheet.insertRule(".column-nav-link .attribution { position: absolute; }", 0); // fix cut off account names
|
||||||
styleOfficial.sheet.insertRule(".txt-base-smallest .badge-verified:before { height: 13px !important; }", 0); // fix cut off badge icon
|
styleOfficial.sheet.insertRule(".txt-base-smallest .sprite-verified-mini { width: 13px !important; height: 13px !important; background-position: -223px -99px !important; }", 0); // fix cut off badge icon when zoomed in
|
||||||
styleOfficial.sheet.insertRule(".keyboard-shortcut-list { vertical-align: top; }", 0); // fix keyboard navigation alignment
|
styleOfficial.sheet.insertRule(".keyboard-shortcut-list { vertical-align: top; }", 0); // fix keyboard navigation alignment
|
||||||
|
styleOfficial.sheet.insertRule(".sprite-logo { background-position: -5px -46px !important; }", 0); // fix TweetDeck logo on certain zoom levels
|
||||||
|
styleOfficial.sheet.insertRule(".app-columns-container::-webkit-scrollbar-track { border-left: 0 }", 0); // remove weird border in the column container scrollbar
|
||||||
|
styleOfficial.sheet.insertRule(".app-navigator .tooltip { display: none !important }", 0); // hide broken tooltips in the menu
|
||||||
|
styleOfficial.sheet.insertRule(".account-inline .username { vertical-align: 10% }", 0); // move usernames a bit higher
|
||||||
|
|
||||||
|
styleOfficial.sheet.insertRule(".js-accounts-column-holder { bottom: 4px; }", 0); // fix white bar on the bottom
|
||||||
|
styleOfficial.sheet.insertRule(".drawer[data-drawer='accountSettings'] { background-color: #ccd6dd; }", 0); // fix white bar on the bottom
|
||||||
|
|
||||||
styleOfficial.sheet.insertRule(".is-video a:not([href*='youtu']), .is-gif .js-media-gif-container { cursor: alias; }", 0); // change cursor on unsupported videos
|
styleOfficial.sheet.insertRule(".is-video a:not([href*='youtu']), .is-gif .js-media-gif-container { cursor: alias; }", 0); // change cursor on unsupported videos
|
||||||
styleOfficial.sheet.insertRule(".is-video a:not([href*='youtu']) .icon-bg-dot, .is-gif .icon-bg-dot { color: #bd3d37; }", 0); // change play icon color on unsupported videos
|
styleOfficial.sheet.insertRule(".is-video a:not([href*='youtu']) .icon-bg-dot, .is-gif .icon-bg-dot { color: #bd3d37; }", 0); // change play icon color on unsupported videos
|
||||||
|
Reference in New Issue
Block a user