1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Add solarized themes to desktop client (#1733)

This commit is contained in:
Shane Kilkelly 2019-07-21 17:27:42 +01:00 committed by Laurent Cozic
parent 45ad201132
commit 3d498e7a75
3 changed files with 85 additions and 0 deletions

View File

@ -46,6 +46,8 @@ require('brace/mode/markdown');
// https://ace.c9.io/build/kitchen-sink.html
// https://highlightjs.org/static/demo/
require('brace/theme/chrome');
require('brace/theme/solarized_light');
require('brace/theme/solarized_dark');
require('brace/theme/twilight');
const NOTE_TAG_BAR_FEATURE_ENABLED = false;

View File

@ -143,6 +143,79 @@ const darkStyle = {
codeThemeCss: "atom-one-dark-reasonable.css",
};
// Solarized Styles
const solarizedLightStyle = {
backgroundColor: "#fdf6e3",
backgroundColorTransparent: "rgba(253, 246, 227, 0.9)",
oddBackgroundColor: "#eee8d5",
color: "#657b83", // For regular text
colorError: "#dc322f",
colorWarn: "#cb4b16",
colorFaded: "#839496", // For less important text;
colorBright: "#073642", // For important text;
dividerColor: "#eee8d5",
selectedColor: "#eee8d5",
urlColor: "#268bd2",
backgroundColor2: "#002b36",
color2: "#eee8d5",
selectedColor2: "#6c71c4",
colorError2: "#cb4b16",
raisedBackgroundColor: "#eee8d5",
raisedColor: "#073642",
warningBackgroundColor: "#b58900",
htmlColor: "#657b83",
htmlBackgroundColor: "#fdf6e3",
htmlDividerColor: "#eee8d5",
htmlLinkColor: "#268bd2",
htmlTableBackgroundColor: "#fdf6e3",
htmlCodeBackgroundColor: "#fdf6e3",
htmlCodeBorderColor: "#eee8d5",
htmlCodeColor: "#002b36",
editorTheme: "solarized_light",
codeThemeCss: "atom-one-light.css",
};
const solarizedDarkStyle = {
backgroundColor: "#002b36",
backgroundColorTransparent: "rgba(0, 43, 54, 0.9)",
oddBackgroundColor: "#073642",
color: "#93a1a1", // For regular text
colorError: "#dc322f",
colorWarn: "#cb4b16",
colorFaded: "#657b83", // For less important text;
colorBright: "#eee8d5", // For important text;
dividerColor: "#586e75",
selectedColor: "#073642",
urlColor: "#268bd2",
backgroundColor2: "#073642",
color2: "#eee8d5",
selectedColor2: "#6c71c4",
colorError2: "#cb4b16",
raisedBackgroundColor: "#073642",
raisedColor: "#839496",
warningBackgroundColor: "#b58900",
htmlColor: "#93a1a1",
htmlBackgroundColor: "#002b36",
htmlDividerColor: "#073642",
htmlLinkColor: "#268bd2",
htmlTableBackgroundColor: "#002b36",
htmlCodeBackgroundColor: "#002b36",
htmlCodeBorderColor: "#073642",
htmlCodeColor: "#fdf6e3",
editorTheme: 'solarized_dark',
codeThemeCss: "atom-one-dark-reasonable.css",
};
function addExtraStyles(style) {
style.tagStyle = {
fontSize: style.fontSize,
@ -278,6 +351,12 @@ function themeStyle(theme) {
else if (theme == Setting.THEME_DARK) {
output = Object.assign({}, globalStyle, fontSizes, darkStyle);
}
else if (theme == Setting.THEME_SOLARIZED_LIGHT) {
output = Object.assign({}, globalStyle, fontSizes, solarizedLightStyle);
}
else if (theme == Setting.THEME_SOLARIZED_DARK) {
output = Object.assign({}, globalStyle, fontSizes, solarizedDarkStyle);
}
// Note: All the theme specific things should go in addExtraStyles
// so that their definition is not split between here and the

View File

@ -103,6 +103,8 @@ class Setting extends BaseModel {
let output = {};
output[Setting.THEME_LIGHT] = _('Light');
output[Setting.THEME_DARK] = _('Dark');
output[Setting.THEME_SOLARIZED_LIGHT] = _('Solarized Light');
output[Setting.THEME_SOLARIZED_DARK] = _('Solarized Dark');
return output;
}},
'uncompletedTodosOnTop': { value: true, type: Setting.TYPE_BOOL, section: 'note', public: true, appTypes: ['cli'], label: () => _('Uncompleted to-dos on top') },
@ -626,6 +628,8 @@ Setting.TYPE_OBJECT = 5;
Setting.THEME_LIGHT = 1;
Setting.THEME_DARK = 2;
Setting.THEME_SOLARIZED_LIGHT = 3;
Setting.THEME_SOLARIZED_DARK = 4;
Setting.DATE_FORMAT_1 = 'DD/MM/YYYY'
Setting.DATE_FORMAT_2 = 'DD/MM/YY';