From bbd1f545bbdc527b7bc32a31c40bbe2944dedcca Mon Sep 17 00:00:00 2001 From: 511V41 Date: Fri, 29 Nov 2019 16:50:47 +0900 Subject: [PATCH 1/3] Enable unibody when multi tabs is exist --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 970231d..6ff3029 100644 --- a/index.js +++ b/index.js @@ -87,7 +87,7 @@ exports.decorateConfig = config => { const transparent = color(secondary).alpha(0).string(); const header = color(background).isDark() ? '#FAFAFA' : '#010101'; const isSecondaryDark = color(secondary).isDark(); - const activeTab = isSecondaryDark ? '#FAFAFA' : '#383A42'; + const activeTab = options.unibody ? background : isSecondaryDark ? '#FAFAFA' : '#383A42'; const highlight = isSecondaryDark ? '#FFFFFF' : '#000000'; const secondHighlight = isSecondaryDark ? '#C7C7C7' : '#686868'; const tab = color(activeTab).darken(0.1); From 9972280abbcef5c6dc2c0a0e14fc3b82b7c6801f Mon Sep 17 00:00:00 2001 From: 511V41 Date: Fri, 29 Nov 2019 17:01:42 +0900 Subject: [PATCH 2/3] fixed lint errors --- index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6ff3029..63cc190 100644 --- a/index.js +++ b/index.js @@ -21,6 +21,7 @@ function getUserOptions(configObj) { if (Array.isArray(configObj.pokemon)) { return configObj.pokemon[Math.floor(Math.random() * configObj.pokemon.length)]; } + return configObj.pokemon || 'pikachu'; }, get poketab() { @@ -52,14 +53,17 @@ function getThemeColors(theme) { if (name === 'random') { return getRandomTheme(themes.pokemon); } + if (Object.prototype.hasOwnProperty.call(themes, name)) { // Choose a random theme from the given category -- i.e. `fire` return getRandomTheme(themes[name]); } + if (Object.prototype.hasOwnProperty.call(themes.pokemon, name)) { // Return the requested pokemon theme -- i.e. `lapras` return [name, themes.pokemon[name]]; } + // Got non-existent theme name thus resolve to default return ['pikachu', themes.pokemon.pikachu]; } @@ -71,6 +75,7 @@ function getMediaPaths(theme) { if (process.platform === 'win32') { return [imagePath, gifPath].map(item => item.join('').replace(/\\/g, '/')); } + return [imagePath.join(''), gifPath.join('')]; } @@ -87,7 +92,13 @@ exports.decorateConfig = config => { const transparent = color(secondary).alpha(0).string(); const header = color(background).isDark() ? '#FAFAFA' : '#010101'; const isSecondaryDark = color(secondary).isDark(); - const activeTab = options.unibody ? background : isSecondaryDark ? '#FAFAFA' : '#383A42'; + const activeTab = (() => { + if (options.unibody) { + return background; + } + + return isSecondaryDark ? '#FAFAFA' : '#383A42'; + })(); const highlight = isSecondaryDark ? '#FFFFFF' : '#000000'; const secondHighlight = isSecondaryDark ? '#C7C7C7' : '#686868'; const tab = color(activeTab).darken(0.1); From 555083a8ba320dded215acb681d518fc9bafd0fb Mon Sep 17 00:00:00 2001 From: 511V41 Date: Fri, 29 Nov 2019 22:20:03 +0900 Subject: [PATCH 3/3] Change tab style --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 63cc190..24f6f0b 100644 --- a/index.js +++ b/index.js @@ -101,7 +101,7 @@ exports.decorateConfig = config => { })(); const highlight = isSecondaryDark ? '#FFFFFF' : '#000000'; const secondHighlight = isSecondaryDark ? '#C7C7C7' : '#686868'; - const tab = color(activeTab).darken(0.1); + const tab = unibody ? activeTab : color(activeTab).darken(0.1); // Set poketab const tabContent = options.poketab ? gifPath : '';