From 0eb7f4cf77357da41908846b328c998833e98af7 Mon Sep 17 00:00:00 2001 From: redFrik Date: Fri, 12 Jan 2018 19:32:36 +0100 Subject: [PATCH 1/3] scide: adding solarizedLight and solarizedDark themes --- editors/sc-ide/core/settings/theme.cpp | 68 ++++++++++++++++++++++++++ editors/sc-ide/core/settings/theme.hpp | 2 + 2 files changed, 70 insertions(+) diff --git a/editors/sc-ide/core/settings/theme.cpp b/editors/sc-ide/core/settings/theme.cpp index cfdb9683162..e6baaddf852 100644 --- a/editors/sc-ide/core/settings/theme.cpp +++ b/editors/sc-ide/core/settings/theme.cpp @@ -176,6 +176,62 @@ void Theme::fillDark() addToTheme(mFormats, "postwindowsuccess", QColor("#b0d206")); addToTheme(mFormats, "postwindowemphasis", QColor("#e4e4e4"), Qt::transparent, true); } + +void Theme::fillSolarizedLight() +{ + addToTheme(mFormats, "text", QColor("#657b83"), QColor("#fdf6e3")); + addToTheme(mFormats, "currentLine", Qt::transparent, QColor("#eee8d5")); + addToTheme(mFormats, "searchResult", QColor("#93a1a1"), QColor("#073642")); + addToTheme(mFormats, "matchingBrackets", QColor("#002b36"), QColor("#eee8d5"), true); + addToTheme(mFormats, "mismatchedBrackets", QColor("#eee8d5"), QColor("#586e75")); + addToTheme(mFormats, "evaluatedCode", QColor("#586e75"), QColor("#eee8d5")); + addToTheme(mFormats, "whitespace", Qt::transparent); + addToTheme(mFormats, "keyword", QColor("#dc322f"), Qt::transparent, true); + addToTheme(mFormats, "built-in", QColor("#b58900")); + addToTheme(mFormats, "env-var", QColor("#d33682")); + addToTheme(mFormats, "class", QColor("#268bd2")); + addToTheme(mFormats, "number", QColor("#6c71c4")); + addToTheme(mFormats, "symbol", QColor("#b58900")); + addToTheme(mFormats, "string", QColor("#93a1a1")); + addToTheme(mFormats, "char", QColor("#cb4b16")); + addToTheme(mFormats, "comment", QColor("#586e75"), Qt::transparent, false, true); + addToTheme(mFormats, "primitive", QColor("#2aa198")); + addToTheme(mFormats, "lineNumbers", QColor("#839496"), QColor("#eee8d5")); + addToTheme(mFormats, "selection", QColor("#fdf6e3"), QColor("#657b83")); + addToTheme(mFormats, "postwindowtext", QColor("#657b83")); + addToTheme(mFormats, "postwindowerror", QColor("#dc322f")); + addToTheme(mFormats, "postwindowwarning", QColor("#cb4b16")); + addToTheme(mFormats, "postwindowsuccess", QColor("#859900")); + addToTheme(mFormats, "postwindowemphasis", QColor("#b58900"), Qt::transparent, true); +} + +void Theme::fillSolarizedDark() +{ + addToTheme(mFormats, "text", QColor("#839496"), QColor("#002b36")); + addToTheme(mFormats, "currentLine", Qt::transparent, QColor("#073642")); + addToTheme(mFormats, "searchResult", QColor("#586e75"), QColor("#eee8d5")); + addToTheme(mFormats, "matchingBrackets", QColor("#fdf6e3"), QColor("#073642"), true); + addToTheme(mFormats, "mismatchedBrackets", QColor("#073642"), QColor("#93a1a1")); + addToTheme(mFormats, "evaluatedCode", QColor("#93a1a1"), QColor("#073642")); + addToTheme(mFormats, "whitespace", Qt::transparent); + addToTheme(mFormats, "keyword", QColor("#dc322f"), Qt::transparent, true); + addToTheme(mFormats, "built-in", QColor("#b58900")); + addToTheme(mFormats, "env-var", QColor("#d33682")); + addToTheme(mFormats, "class", QColor("#268bd2")); + addToTheme(mFormats, "number", QColor("#6c71c4")); + addToTheme(mFormats, "symbol", QColor("#b58900")); + addToTheme(mFormats, "string", QColor("#586e75")); + addToTheme(mFormats, "char", QColor("#cb4b16")); + addToTheme(mFormats, "comment", QColor("#93a1a1"), Qt::transparent, false, true); + addToTheme(mFormats, "primitive", QColor("#2aa198")); + addToTheme(mFormats, "lineNumbers", QColor("#657b83"), QColor("#073642")); + addToTheme(mFormats, "selection", QColor("#002b36"), QColor("#839496")); + addToTheme(mFormats, "postwindowtext", QColor("#839496")); + addToTheme(mFormats, "postwindowerror", QColor("#dc322f")); + addToTheme(mFormats, "postwindowwarning", QColor("#cb4b16")); + addToTheme(mFormats, "postwindowsuccess", QColor("#859900")); + addToTheme(mFormats, "postwindowemphasis", QColor("#b58900"), Qt::transparent, true); +} void Theme::fillUser(const QString & name, const Manager *settings) { @@ -214,6 +270,12 @@ Theme::Theme(const QString & _name, Manager * settings) } else if (mName == "dark") { fillDark(); mLocked = true; + } else if (mName == "solarizedLight") { + fillSolarizedLight(); + mLocked = true; + } else if (mName == "solarizedDark") { + fillSolarizedDark(); + mLocked = true; } else { fillUser(mName, settings); mLocked = false; @@ -231,6 +293,10 @@ Theme::Theme(const QString & _name, const QString & _source, Manager * settings) fillDefault(); } else if (_source == "dark") { fillDark(); + } else if (_source == "solarizedLight") { + fillSolarizedLight(); + } else if (_source == "solarizedDark") { + fillSolarizedDark(); } else { fillUser(_source, settings); } @@ -283,6 +349,8 @@ QList Theme::availableThemes() themes.append("default"); themes.append("dark"); + themes.append("solarizedLight"); + themes.append("solarizedDark"); mSettings->beginGroup("IDE/editor/themes"); themes.append(mSettings->childGroups()); diff --git a/editors/sc-ide/core/settings/theme.hpp b/editors/sc-ide/core/settings/theme.hpp index 43cf9424ef1..21cd3caaff0 100644 --- a/editors/sc-ide/core/settings/theme.hpp +++ b/editors/sc-ide/core/settings/theme.hpp @@ -53,6 +53,8 @@ class Theme void fillUser(const QString & theme, const Manager *settings); void fillDefault(); void fillDark(); + void fillSolarizedLight(); + void fillSolarizedDark(); bool mLocked; QMap mFormats; From 6d76d584d2025625f7ae6a9c3731fca3372bd50e Mon Sep 17 00:00:00 2001 From: patrickdupuis Date: Mon, 22 Jan 2018 01:24:35 -0500 Subject: [PATCH 2/3] add license text --- editors/sc-ide/core/settings/theme.cpp | 30 +++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/editors/sc-ide/core/settings/theme.cpp b/editors/sc-ide/core/settings/theme.cpp index e6baaddf852..2386daeed78 100644 --- a/editors/sc-ide/core/settings/theme.cpp +++ b/editors/sc-ide/core/settings/theme.cpp @@ -176,7 +176,33 @@ void Theme::fillDark() addToTheme(mFormats, "postwindowsuccess", QColor("#b0d206")); addToTheme(mFormats, "postwindowemphasis", QColor("#e4e4e4"), Qt::transparent, true); } - + +/* +The MIT license (MIT) + +Copyright (c) 2011 Ethan Schoonover + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +https://github.com/altercation/solarized +*/ + void Theme::fillSolarizedLight() { addToTheme(mFormats, "text", QColor("#657b83"), QColor("#fdf6e3")); @@ -233,6 +259,8 @@ void Theme::fillSolarizedDark() addToTheme(mFormats, "postwindowemphasis", QColor("#b58900"), Qt::transparent, true); } +/* END MIT LICENSED COSE */ + void Theme::fillUser(const QString & name, const Manager *settings) { QString group = QStringLiteral("IDE/editor/themes/%1/").arg(name); From 4a52260377bb3c86fbe1930b0ad5938e8ddf6255 Mon Sep 17 00:00:00 2001 From: redFrik Date: Fri, 26 Jan 2018 15:50:19 +0100 Subject: [PATCH 3/3] added missing mLocked = true; sorry, must have happened when i resolved conflicts --- editors/sc-ide/core/settings/theme.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editors/sc-ide/core/settings/theme.cpp b/editors/sc-ide/core/settings/theme.cpp index 603098d95a7..75b2a8c17f2 100644 --- a/editors/sc-ide/core/settings/theme.cpp +++ b/editors/sc-ide/core/settings/theme.cpp @@ -355,6 +355,7 @@ Theme::Theme(const QString & _name, Manager * settings) mLocked = true; } else if (mName == "dracula") { fillDracula(); + mLocked = true; } else if (mName == "solarizedLight") { fillSolarizedLight(); mLocked = true;