From e9de789b79d9de4051dde8959b1f2e0e0a005a20 Mon Sep 17 00:00:00 2001 From: chylex <contact@chylex.com> Date: Tue, 3 Apr 2018 20:49:21 +0200 Subject: [PATCH] Minor refactoring, including removal of unnecessary enableCustomCSS parameter --- Core/Handling/General/JavaScriptDialogHandler.cs | 3 +-- Core/Notification/TweetNotification.cs | 11 ++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Core/Handling/General/JavaScriptDialogHandler.cs b/Core/Handling/General/JavaScriptDialogHandler.cs index fc6c3fff..3744899e 100644 --- a/Core/Handling/General/JavaScriptDialogHandler.cs +++ b/Core/Handling/General/JavaScriptDialogHandler.cs @@ -1,7 +1,6 @@ using System.Drawing; using System.Windows.Forms; using CefSharp; -using CefSharp.WinForms; using TweetDuck.Core.Controls; using TweetDuck.Core.Other; using TweetDuck.Core.Utils; @@ -28,7 +27,7 @@ private static FormMessage CreateMessageForm(string caption, string text){ } bool IJsDialogHandler.OnJSDialog(IWebBrowser browserControl, IBrowser browser, string originUrl, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage){ - ((ChromiumWebBrowser)browserControl).InvokeSafe(() => { + browserControl.AsControl().InvokeSafe(() => { FormMessage form; TextBox input = null; diff --git a/Core/Notification/TweetNotification.cs b/Core/Notification/TweetNotification.cs index 3869af73..f226d92f 100644 --- a/Core/Notification/TweetNotification.cs +++ b/Core/Notification/TweetNotification.cs @@ -53,17 +53,14 @@ public int GetDisplayDuration(int value){ return 2000+Math.Max(1000, value*characters); } - public string GenerateHtml(string bodyClasses = null, bool enableCustomCSS = true){ + public string GenerateHtml(string bodyClasses){ StringBuilder build = new StringBuilder(); build.Append("<!DOCTYPE html>"); build.Append(TweetDeckBridge.NotificationHeadLayout ?? DefaultHeadLayout); - - if (enableCustomCSS){ - build.Append("<style type='text/css'>").Append(CustomCSS).Append("</style>"); + build.Append("<style type='text/css'>").Append(CustomCSS).Append("</style>"); - if (!string.IsNullOrEmpty(Program.UserConfig.CustomNotificationCSS)){ - build.Append("<style type='text/css'>").Append(Program.UserConfig.CustomNotificationCSS).Append("</style>"); - } + if (!string.IsNullOrEmpty(Program.UserConfig.CustomNotificationCSS)){ + build.Append("<style type='text/css'>").Append(Program.UserConfig.CustomNotificationCSS).Append("</style>"); } build.Append("</head>");