1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-08-02 07:59:02 +02:00

Add a parameter to toggle custom CSS in TweetNotification.GenerateHtml

This commit is contained in:
chylex 2016-11-16 18:33:30 +01:00
parent 04a78a02d3
commit 7a1e7637ff

View File

@ -99,15 +99,19 @@ public int GetDisplayDuration(int value){
return 2000+Math.Max(1000, value*characters); return 2000+Math.Max(1000, value*characters);
} }
public string GenerateHtml(){ public string GenerateHtml(bool enableCustomCSS = true){
StringBuilder build = new StringBuilder(); StringBuilder build = new StringBuilder();
build.Append("<!DOCTYPE html>"); build.Append("<!DOCTYPE html>");
build.Append("<html class='os-windows txt-base-").Append(FontSizeClass ?? DefaultFontSizeClass).Append("'>"); build.Append("<html class='os-windows txt-base-").Append(FontSizeClass ?? DefaultFontSizeClass).Append("'>");
build.Append("<head>").Append(HeadTag ?? DefaultHeadTag).Append("<style type='text/css'>").Append(CustomCSS).Append("</style>"); build.Append("<head>").Append(HeadTag ?? DefaultHeadTag);
if (enableCustomCSS){
build.Append("<style type='text/css'>").Append(CustomCSS).Append("</style>");
if (!string.IsNullOrEmpty(Program.UserConfig.CustomNotificationCSS)){ if (!string.IsNullOrEmpty(Program.UserConfig.CustomNotificationCSS)){
build.Append("<style type='text/css'>").Append(Program.UserConfig.CustomNotificationCSS).Append("</style>"); build.Append("<style type='text/css'>").Append(Program.UserConfig.CustomNotificationCSS).Append("</style>");
} }
}
build.Append("</head>"); build.Append("</head>");
build.Append("<body class='hearty'").Append(isExample ? " td-example-notification" : "").Append("><div class='app-columns-container'><div class='column scroll-styled-v' style='width:100%;overflow-y:auto'>"); build.Append("<body class='hearty'").Append(isExample ? " td-example-notification" : "").Append("><div class='app-columns-container'><div class='column scroll-styled-v' style='width:100%;overflow-y:auto'>");