From b4e936c53030f950fd5608f149106c53b1f04707 Mon Sep 17 00:00:00 2001 From: chylex <contact@chylex.com> Date: Tue, 14 Nov 2017 19:06:05 +0100 Subject: [PATCH] Minor refactoring of notification classes & remove no longer needed CSS --- Core/Notification/FormNotificationBase.cs | 5 +++-- Core/Notification/FormNotificationMain.cs | 4 ++-- Resources/Scripts/styles/browser.css | 5 ----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Core/Notification/FormNotificationBase.cs b/Core/Notification/FormNotificationBase.cs index 57c8c4e3..67e48d39 100644 --- a/Core/Notification/FormNotificationBase.cs +++ b/Core/Notification/FormNotificationBase.cs @@ -109,6 +109,8 @@ protected virtual FormBorderStyle NotificationBorderStyle{ public bool CanViewDetail => currentNotification != null && !string.IsNullOrEmpty(currentNotification.ColumnId) && !string.IsNullOrEmpty(currentNotification.ChirpId); public bool IsPaused => pauseCounter > 0; + + protected bool IsCursorOverBrowser => browser.Bounds.Contains(PointToClient(Cursor.Position)); public bool FreezeTimer { get; set; } public bool ContextMenuOpen { get; set; } @@ -201,8 +203,7 @@ public virtual void ResumeNotification(){ } protected virtual string GetTweetHTML(TweetNotification tweet){ - string bodyClasses = browser.Bounds.Contains(PointToClient(Cursor.Position)) ? "td-hover" : string.Empty; - return tweet.GenerateHtml(bodyClasses); + return tweet.GenerateHtml(IsCursorOverBrowser ? "td-hover" : string.Empty); } protected virtual void LoadTweet(TweetNotification tweet){ diff --git a/Core/Notification/FormNotificationMain.cs b/Core/Notification/FormNotificationMain.cs index 613c5015..7e712fed 100644 --- a/Core/Notification/FormNotificationMain.cs +++ b/Core/Notification/FormNotificationMain.cs @@ -113,8 +113,8 @@ private IntPtr MouseHookProc(int nCode, IntPtr wParam, IntPtr lParam){ if (nCode == 0){ int eventType = wParam.ToInt32(); - if (eventType == NativeMethods.WM_MOUSEWHEEL && browser.Bounds.Contains(PointToClient(Cursor.Position))){ - browser.SendMouseWheelEvent(0, 0, 0, BrowserUtils.Scale(NativeMethods.GetMouseHookData(lParam), Program.UserConfig.NotificationScrollSpeed/100.0), CefEventFlags.None); + if (eventType == NativeMethods.WM_MOUSEWHEEL && IsCursorOverBrowser){ + browser.SendMouseWheelEvent(0, 0, 0, BrowserUtils.Scale(NativeMethods.GetMouseHookData(lParam), Program.UserConfig.NotificationScrollSpeed*0.01), CefEventFlags.None); return NativeMethods.HOOK_HANDLED; } else if (eventType == NativeMethods.WM_XBUTTONDOWN && DesktopBounds.Contains(Cursor.Position)){ diff --git a/Resources/Scripts/styles/browser.css b/Resources/Scripts/styles/browser.css index ec54d2b7..90dd1221 100644 --- a/Resources/Scripts/styles/browser.css +++ b/Resources/Scripts/styles/browser.css @@ -204,11 +204,6 @@ html[data-td-font='smallest'] .tweet-detail-wrapper .badge-verified:before { cursor: pointer; } -.is-inverted-dark .inline-reply .btn:hover { - /* Reply buttons in modals are bork */ - background-color: transparent !important; -} - /***************************************************************/ /* Fix glaring visual issues that twitter hasn't fixed yet smh */ /***************************************************************/