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

Desktop: No longer crash if certain theme properties are not set

This commit is contained in:
Laurent Cozic 2019-07-29 12:05:58 +02:00
parent 6fbeb35951
commit 44fa099a77
2 changed files with 12 additions and 12 deletions

View File

@ -119,7 +119,7 @@ class SideBarComponent extends React.Component {
display: "flex", display: "flex",
alignItems: "stretch", alignItems: "stretch",
// Allow 3 levels of color depth // Allow 3 levels of color depth
backgroundColor: !theme.depthColor ? '#00000000' : theme.depthColor.replace('OPACITY', Math.min(depth * 0.1, 0.3)), backgroundColor: theme.depthColor.replace('OPACITY', Math.min(depth * 0.1, 0.3)),
}, },
listItem: { listItem: {
fontFamily: theme.fontFamily, fontFamily: theme.fontFamily,

View File

@ -345,17 +345,17 @@ function themeStyle(theme) {
let output = {}; let output = {};
output.zoomRatio = zoomRatio; output.zoomRatio = zoomRatio;
output.editorFontSize = editorFontSize; output.editorFontSize = editorFontSize;
if (theme == Setting.THEME_LIGHT) {
output = Object.assign({}, globalStyle, fontSizes, lightStyle); // All theme are based on the light style, and just override the
} // relevant properties
else if (theme == Setting.THEME_DARK) { output = Object.assign({}, globalStyle, fontSizes, lightStyle);
output = Object.assign({}, globalStyle, fontSizes, darkStyle);
} if (theme == Setting.THEME_DARK) {
else if (theme == Setting.THEME_SOLARIZED_LIGHT) { output = Object.assign({}, output, darkStyle);
output = Object.assign({}, globalStyle, fontSizes, solarizedLightStyle); } else if (theme == Setting.THEME_SOLARIZED_LIGHT) {
} output = Object.assign({}, output, solarizedLightStyle);
else if (theme == Setting.THEME_SOLARIZED_DARK) { } else if (theme == Setting.THEME_SOLARIZED_DARK) {
output = Object.assign({}, globalStyle, fontSizes, solarizedDarkStyle); output = Object.assign({}, output, solarizedDarkStyle);
} }
// Note: All the theme specific things should go in addExtraStyles // Note: All the theme specific things should go in addExtraStyles