From 31ed278b905b22d6a3434cf34795827420451fbb Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 21 Dec 2017 11:23:37 +0900 Subject: [PATCH 01/17] Fix dock toggle button position --- styles/docks.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/docks.less b/styles/docks.less index 4c72f5d..c91681e 100644 --- a/styles/docks.less +++ b/styles/docks.less @@ -33,10 +33,10 @@ // Make toggle buttons cover ^ border .atom-dock-toggle-button.left { - margin-left: -1px; + margin-left: -2px; } .atom-dock-toggle-button.right { - margin-right: -1px; + margin-right: -2px; } .atom-dock-inner:not(.atom-dock-open) .atom-dock-toggle-button.bottom { margin-bottom: -1px; From 419a143d04508284fb799332934bbe98652a6e5f Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 8 Feb 2018 10:03:09 +0900 Subject: [PATCH 02/17] Switch to sytem-ui font --- styles/ui-variables.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/ui-variables.less b/styles/ui-variables.less index b22e04b..1b65dd1 100644 --- a/styles/ui-variables.less +++ b/styles/ui-variables.less @@ -94,4 +94,4 @@ // Font ----------------- -@font-family: 'BlinkMacSystemFont', 'Lucida Grande', 'Segoe UI', Ubuntu, Cantarell, sans-serif; +@font-family: system-ui; From 6f2582d29ce78aed934c34671cb407c59746eab0 Mon Sep 17 00:00:00 2001 From: Bryant Ung Date: Tue, 13 Feb 2018 17:56:10 -0800 Subject: [PATCH 03/17] Prepare 1.10.11 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d90f5f9..efebd2e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "one-light-ui", "theme": "ui", - "version": "1.10.10", + "version": "1.10.11", "description": "Atom One light UI theme", "keywords": [ "light", From 8f60301140b8414ce2b2de67ded8dcd1d4428827 Mon Sep 17 00:00:00 2001 From: simurai Date: Wed, 14 Feb 2018 16:53:21 +0900 Subject: [PATCH 04/17] Make project folders sticky --- styles/tree-view.less | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/styles/tree-view.less b/styles/tree-view.less index 9063d7d..3b9acb2 100644 --- a/styles/tree-view.less +++ b/styles/tree-view.less @@ -83,3 +83,35 @@ .tree-view .project-root-header.project-root-header.project-root-header.project-root-header::before { line-height: @ui-tab-height; } + + +// Sticky Projects ------------------------------ + +.tree-view { + .project-root-header { + position: sticky; + top: 0; + z-index: 1; + padding-left: 5px; + padding-right: 10px; + border-bottom: 1px solid @base-border-color; + background-color: @tree-view-background-color; + } + .project-root.project-root { + margin-left: -5px; + margin-right: -10px; + + // Disable selection + &::before { + display: none; + } + + // Add selection back + &.selected .project-root-header { + background-color: @background-color-selected; + } + } + &:focus .selected .project-root-header.project-root-header { + background: @button-background-color-selected; + } +} From 7ee1d5cd6c5ce4b8a1f4fe8b07ec5f9776821e47 Mon Sep 17 00:00:00 2001 From: simurai Date: Wed, 28 Feb 2018 19:56:27 +0900 Subject: [PATCH 05/17] Remove margin of icon only status-bar items --- styles/status-bar.less | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/styles/status-bar.less b/styles/status-bar.less index 43aa36b..4acb48d 100644 --- a/styles/status-bar.less +++ b/styles/status-bar.less @@ -82,4 +82,11 @@ cursor: default; } } + + // Remove margin for icon without text + status-bar-launch-mode::before, // Launch mode + .PortalStatusBarIndicator .icon::before, // Teletype + .icon.is-icon-only::before { + margin-right: 0; + } } From 16fab8e93eadf67ff8f2a4ff77d534fe93d4914e Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 8 Mar 2018 12:10:57 +0900 Subject: [PATCH 06/17] Add more icon only status-bar tiles This is a follow-up of https://github.com/atom/one-light-ui/pull/123 --- styles/status-bar.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/styles/status-bar.less b/styles/status-bar.less index 4acb48d..70f3a99 100644 --- a/styles/status-bar.less +++ b/styles/status-bar.less @@ -85,8 +85,12 @@ // Remove margin for icon without text status-bar-launch-mode::before, // Launch mode + .about-release-notes::before, // New release squirrel .PortalStatusBarIndicator .icon::before, // Teletype .icon.is-icon-only::before { margin-right: 0; } + .github-PushPull-label.is-push:empty { // GitHub package when nothing to push + margin-right: -.25em; + } } From be53465365c8b76d44995dbef55de658e0f9d816 Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 8 Mar 2018 12:20:30 +0900 Subject: [PATCH 07/17] Increase transparency of the modal backdrop --- styles/ui-variables-custom.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/ui-variables-custom.less b/styles/ui-variables-custom.less index caecbc6..c43f5aa 100644 --- a/styles/ui-variables-custom.less +++ b/styles/ui-variables-custom.less @@ -76,8 +76,8 @@ @input-selection-color: mix( hsv( @ui-hue, 33%, 95%), hsl( @ui-hue, 100%, 98%), @accent-luma * 2 ); // mix hsv + hsl (favor hsl for dark, hsv for light colors) @input-selection-color-focus: mix( hsv( @ui-hue, 44%, 90%), hsl( @ui-hue, 100%, 94%), @accent-luma * 2 ); // mix hsv + hsl (favor hsl for dark, hsv for light colors) -@overlay-backdrop-color: hsl(@ui-hue, @ui-saturation*0.4, @ui-lightness*0.72); -@overlay-backdrop-opacity: .8; +@overlay-backdrop-color: hsl(@ui-hue, @ui-saturation*0.4, @ui-lightness*0.8); +@overlay-backdrop-opacity: .66; @progress-background-color: @accent-color; From 30e80843af1bebdc8074e1f46486d312b4525bb8 Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 8 Mar 2018 14:02:01 +0900 Subject: [PATCH 08/17] Fix command palette input border --- styles/modal.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/styles/modal.less b/styles/modal.less index c793b8f..7bc0a42 100644 --- a/styles/modal.less +++ b/styles/modal.less @@ -80,6 +80,11 @@ atom-panel.modal { position: relative; // fixes stacking order } + .command-palette { + padding: 1px; // prevents the box-shadow of the input from being cut off + background-color: @overlay-background-color; + } + // Container &:before { From 2f79cbae20254df02f90c6da321285bdc054bc72 Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 8 Mar 2018 16:22:49 +0900 Subject: [PATCH 09/17] Use dropdown as font size picker --- package.json | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index efebd2e..6bb5b55 100644 --- a/package.json +++ b/package.json @@ -20,14 +20,10 @@ "configSchema": { "fontSize": { "title": "Font Size", - "description": "Change the UI font size. Needs to be between 8 and 20. In Auto mode, the Font Size will automatically change based on the window size.", - "type": [ - "integer", - "string" - ], - "minimum": 8, - "maximum": 20, - "default": "Auto", + "description": "Change the font size for the UI.", + "type": "integer", + "default": 12, + "enum": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], "order": 1 }, "tabSizing": { From 82b35492f42386ee32ff5bebd4a58a56aa7cb604 Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 8 Mar 2018 16:45:27 +0900 Subject: [PATCH 10/17] Fix specs --- lib/main.coffee | 5 +---- spec/theme-spec.coffee | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/main.coffee b/lib/main.coffee index cbb21e4..573b09d 100644 --- a/lib/main.coffee +++ b/lib/main.coffee @@ -25,10 +25,7 @@ module.exports = # Font Size ----------------------- setFontSize = (currentFontSize) -> - if Number.isInteger(currentFontSize) - root.style.fontSize = "#{currentFontSize}px" - else if currentFontSize is 'Auto' - unsetFontSize() + root.style.fontSize = "#{currentFontSize}px" unsetFontSize = -> root.style.fontSize = '' diff --git a/spec/theme-spec.coffee b/spec/theme-spec.coffee index af2c4ec..8e1da64 100644 --- a/spec/theme-spec.coffee +++ b/spec/theme-spec.coffee @@ -4,14 +4,11 @@ describe "One Light UI theme", -> atom.packages.activatePackage('one-light-ui') it "allows the font size to be set via config", -> - expect(document.documentElement.style.fontSize).toBe '' + expect(document.documentElement.style.fontSize).toBe '12px' atom.config.set('one-light-ui.fontSize', '10') expect(document.documentElement.style.fontSize).toBe '10px' - atom.config.set('one-light-ui.fontSize', 'Auto') - expect(document.documentElement.style.fontSize).toBe '' - it "allows the tab sizing to be set via config", -> atom.config.set('one-light-ui.tabSizing', 'Maximum') expect(document.documentElement.getAttribute('theme-one-light-ui-tabsizing')).toBe 'maximum' From 3e1d65647f237eb28b8d05ac63b19c712e387178 Mon Sep 17 00:00:00 2001 From: simurai Date: Fri, 9 Mar 2018 19:59:02 +0900 Subject: [PATCH 11/17] Prepare 1.11.0 release --- package.json | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6bb5b55..ccd523e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "one-light-ui", "theme": "ui", - "version": "1.10.11", + "version": "1.11.0", "description": "Atom One light UI theme", "keywords": [ "light", @@ -23,7 +23,19 @@ "description": "Change the font size for the UI.", "type": "integer", "default": 12, - "enum": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], + "enum": [ + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], "order": 1 }, "tabSizing": { From 365c0028bae2ef1b37060ffc03b4054614dcbe9f Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 27 Mar 2018 14:42:59 +0900 Subject: [PATCH 12/17] Fix active pane marker --- styles/tabs.less | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/styles/tabs.less b/styles/tabs.less index a6875b4..be3c099 100644 --- a/styles/tabs.less +++ b/styles/tabs.less @@ -215,16 +215,19 @@ // Active pane marker -------------- -atom-pane.active .tab.active:before { - content: ""; - position: absolute; - pointer-events: none; - z-index: 2; - top: 0; - left: -1px; // cover left border - bottom: 0; - width: 2px; - background: @accent-color; +atom-pane-axis > atom-pane.active, +atom-pane-container > atom-pane.pane { + .tab.active:before { + content: ""; + position: absolute; + pointer-events: none; + z-index: 2; + top: 0; + left: -1px; // cover left border + bottom: 0; + width: 2px; + background: @accent-color; + } } // hide marker in docks From 380e9938d5cef5dc4ac920204cdc7d30ce977b86 Mon Sep 17 00:00:00 2001 From: simurai Date: Wed, 28 Mar 2018 16:11:38 +0900 Subject: [PATCH 13/17] add sticky headers config Co-Authored-By: Tony Brix --- lib/main.coffee | 16 ++++++++++++++++ package.json | 6 ++++++ spec/theme-spec.coffee | 8 ++++++++ styles/config.less | 36 ++++++++++++++++++++++++++++++++++++ styles/tree-view.less | 32 -------------------------------- 5 files changed, 66 insertions(+), 32 deletions(-) diff --git a/lib/main.coffee b/lib/main.coffee index 573b09d..65caba2 100644 --- a/lib/main.coffee +++ b/lib/main.coffee @@ -11,6 +11,9 @@ module.exports = atom.config.observe 'one-light-ui.hideDockButtons', (value) -> setHideDockButtons(value) + atom.config.observe 'one-light-ui.stickyHeaders', (value) -> + setStickyHeaders(value) + # DEPRECATED: This can be removed at some point (added in Atom 1.17/1.18ish) # It removes `layoutMode` if atom.config.get('one-light-ui.layoutMode') @@ -20,6 +23,7 @@ module.exports = unsetFontSize() unsetTabSizing() unsetHideDockButtons() + unsetStickyHeaders() # Font Size ----------------------- @@ -50,3 +54,15 @@ setHideDockButtons = (hideDockButtons) -> unsetHideDockButtons = -> root.removeAttribute('theme-one-light-ui-dock-buttons') + + +# Sticky Headers ----------------------- + +setStickyHeaders = (stickyHeaders) -> + if stickyHeaders + root.setAttribute('theme-one-light-ui-sticky-headers', 'sticky') + else + unsetStickyHeaders() + +unsetStickyHeaders = -> + root.removeAttribute('theme-one-light-ui-sticky-headers') diff --git a/package.json b/package.json index ccd523e..6889052 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,12 @@ "type": "boolean", "default": "false", "order": 3 + }, + "stickyHeaders": { + "title": "Make tree-view project headers sticky", + "type": "boolean", + "default": "true", + "order": 4 } } } diff --git a/spec/theme-spec.coffee b/spec/theme-spec.coffee index 8e1da64..6fcfeae 100644 --- a/spec/theme-spec.coffee +++ b/spec/theme-spec.coffee @@ -20,3 +20,11 @@ describe "One Light UI theme", -> it "allows the dock toggle buttons to be hidden via config", -> atom.config.set('one-light-ui.hideDockButtons', true) expect(document.documentElement.getAttribute('theme-one-light-ui-dock-buttons')).toBe 'hidden' + + it "allows the tree-view headers to be sticky via config", -> + atom.config.set('one-light-ui.stickyHeaders', true) + expect(document.documentElement.getAttribute('theme-one-light-ui-sticky-headers')).toBe 'sticky' + + it "allows the tree-view headers to not be sticky via config", -> + atom.config.set('one-light-ui.stickyHeaders', false) + expect(document.documentElement.getAttribute('theme-one-light-ui-sticky-headers')).toBe null diff --git a/styles/config.less b/styles/config.less index ef859c4..948e8af 100644 --- a/styles/config.less +++ b/styles/config.less @@ -3,6 +3,7 @@ @theme-tabsizing: ~'theme-@{ui-theme-name}-tabsizing'; @theme-dockButtons: ~'theme-@{ui-theme-name}-dock-buttons'; +@theme-stickyHeaders: ~'theme-@{ui-theme-name}-sticky-headers'; @tab-min-width: 7em; // ~ icon + 6 characters @@ -75,3 +76,38 @@ } } + + +// Sticky Projects ------------------------------ + +[@{theme-stickyHeaders}="sticky"] { + + .tree-view { + .project-root-header { + position: sticky; + top: 0; + z-index: 1; + padding-left: 5px; + padding-right: 10px; + border-bottom: 1px solid @base-border-color; + background-color: @tree-view-background-color; + } + .project-root.project-root { + margin-left: -5px; + margin-right: -10px; + + // Disable selection + &::before { + display: none; + } + + // Add selection back + &.selected .project-root-header { + background-color: @background-color-selected; + } + } + &:focus .selected .project-root-header.project-root-header { + background: @button-background-color-selected; + } + } +} diff --git a/styles/tree-view.less b/styles/tree-view.less index 3b9acb2..9063d7d 100644 --- a/styles/tree-view.less +++ b/styles/tree-view.less @@ -83,35 +83,3 @@ .tree-view .project-root-header.project-root-header.project-root-header.project-root-header::before { line-height: @ui-tab-height; } - - -// Sticky Projects ------------------------------ - -.tree-view { - .project-root-header { - position: sticky; - top: 0; - z-index: 1; - padding-left: 5px; - padding-right: 10px; - border-bottom: 1px solid @base-border-color; - background-color: @tree-view-background-color; - } - .project-root.project-root { - margin-left: -5px; - margin-right: -10px; - - // Disable selection - &::before { - display: none; - } - - // Add selection back - &.selected .project-root-header { - background-color: @background-color-selected; - } - } - &:focus .selected .project-root-header.project-root-header { - background: @button-background-color-selected; - } -} From d6e42e9ab87bfb3082a419c6f8a97c5996579dbb Mon Sep 17 00:00:00 2001 From: simurai Date: Wed, 28 Mar 2018 16:19:27 +0900 Subject: [PATCH 14/17] use themeName variable Co-Authored-By: Tony Brix --- lib/main.coffee | 26 ++++++++++++++------------ spec/theme-spec.coffee | 28 +++++++++++++++------------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/lib/main.coffee b/lib/main.coffee index 65caba2..453aec2 100644 --- a/lib/main.coffee +++ b/lib/main.coffee @@ -1,23 +1,25 @@ root = document.documentElement +themeName = 'one-light-ui' + module.exports = activate: (state) -> - atom.config.observe 'one-light-ui.fontSize', (value) -> + atom.config.observe "#{themeName}.fontSize", (value) -> setFontSize(value) - atom.config.observe 'one-light-ui.tabSizing', (value) -> + atom.config.observe "#{themeName}.tabSizing", (value) -> setTabSizing(value) - atom.config.observe 'one-light-ui.hideDockButtons', (value) -> + atom.config.observe "#{themeName}.hideDockButtons", (value) -> setHideDockButtons(value) - atom.config.observe 'one-light-ui.stickyHeaders', (value) -> + atom.config.observe "#{themeName}.stickyHeaders", (value) -> setStickyHeaders(value) # DEPRECATED: This can be removed at some point (added in Atom 1.17/1.18ish) # It removes `layoutMode` - if atom.config.get('one-light-ui.layoutMode') - atom.config.unset('one-light-ui.layoutMode') + if atom.config.get("#{themeName}.layoutMode") + atom.config.unset("#{themeName}.layoutMode") deactivate: -> unsetFontSize() @@ -38,31 +40,31 @@ unsetFontSize = -> # Tab Sizing ----------------------- setTabSizing = (tabSizing) -> - root.setAttribute('theme-one-light-ui-tabsizing', tabSizing.toLowerCase()) + root.setAttribute("theme-#{themeName}-tabsizing", tabSizing.toLowerCase()) unsetTabSizing = -> - root.removeAttribute('theme-one-light-ui-tabsizing') + root.removeAttribute("theme-#{themeName}-tabsizing") # Dock Buttons ----------------------- setHideDockButtons = (hideDockButtons) -> if hideDockButtons - root.setAttribute('theme-one-light-ui-dock-buttons', 'hidden') + root.setAttribute("theme-#{themeName}-dock-buttons", 'hidden') else unsetHideDockButtons() unsetHideDockButtons = -> - root.removeAttribute('theme-one-light-ui-dock-buttons') + root.removeAttribute("theme-#{themeName}-dock-buttons") # Sticky Headers ----------------------- setStickyHeaders = (stickyHeaders) -> if stickyHeaders - root.setAttribute('theme-one-light-ui-sticky-headers', 'sticky') + root.setAttribute("theme-#{themeName}-sticky-headers", 'sticky') else unsetStickyHeaders() unsetStickyHeaders = -> - root.removeAttribute('theme-one-light-ui-sticky-headers') + root.removeAttribute("theme-#{themeName}-sticky-headers") diff --git a/spec/theme-spec.coffee b/spec/theme-spec.coffee index 6fcfeae..77273eb 100644 --- a/spec/theme-spec.coffee +++ b/spec/theme-spec.coffee @@ -1,30 +1,32 @@ -describe "One Light UI theme", -> +themeName = 'one-light-ui' + +describe "#{themeName} theme", -> beforeEach -> waitsForPromise -> - atom.packages.activatePackage('one-light-ui') + atom.packages.activatePackage(themeName) it "allows the font size to be set via config", -> expect(document.documentElement.style.fontSize).toBe '12px' - atom.config.set('one-light-ui.fontSize', '10') + atom.config.set("#{themeName}.fontSize", '10') expect(document.documentElement.style.fontSize).toBe '10px' it "allows the tab sizing to be set via config", -> - atom.config.set('one-light-ui.tabSizing', 'Maximum') - expect(document.documentElement.getAttribute('theme-one-light-ui-tabsizing')).toBe 'maximum' + atom.config.set("#{themeName}.tabSizing", 'Maximum') + expect(document.documentElement.getAttribute("theme-#{themeName}-tabsizing")).toBe 'maximum' it "allows the tab sizing to be set via config", -> - atom.config.set('one-light-ui.tabSizing', 'Minimum') - expect(document.documentElement.getAttribute('theme-one-light-ui-tabsizing')).toBe 'minimum' + atom.config.set("#{themeName}.tabSizing", 'Minimum') + expect(document.documentElement.getAttribute("theme-#{themeName}-tabsizing")).toBe 'minimum' it "allows the dock toggle buttons to be hidden via config", -> - atom.config.set('one-light-ui.hideDockButtons', true) - expect(document.documentElement.getAttribute('theme-one-light-ui-dock-buttons')).toBe 'hidden' + atom.config.set("#{themeName}.hideDockButtons", true) + expect(document.documentElement.getAttribute("theme-#{themeName}-dock-buttons")).toBe 'hidden' it "allows the tree-view headers to be sticky via config", -> - atom.config.set('one-light-ui.stickyHeaders', true) - expect(document.documentElement.getAttribute('theme-one-light-ui-sticky-headers')).toBe 'sticky' + atom.config.set("#{themeName}.stickyHeaders", true) + expect(document.documentElement.getAttribute("theme-#{themeName}-sticky-headers")).toBe 'sticky' it "allows the tree-view headers to not be sticky via config", -> - atom.config.set('one-light-ui.stickyHeaders', false) - expect(document.documentElement.getAttribute('theme-one-light-ui-sticky-headers')).toBe null + atom.config.set("#{themeName}.stickyHeaders", false) + expect(document.documentElement.getAttribute("theme-#{themeName}-sticky-headers")).toBe null From fac0c8229b3ef3722544d9f5d3dc0b1025903967 Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 29 Mar 2018 10:37:23 +0900 Subject: [PATCH 15/17] Fix sticky header from covering auto-revealed items --- styles/config.less | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/styles/config.less b/styles/config.less index 948e8af..200a565 100644 --- a/styles/config.less +++ b/styles/config.less @@ -109,5 +109,11 @@ &:focus .selected .project-root-header.project-root-header { background: @button-background-color-selected; } + + // Fix sticky header from covering auto-revealed items + .list-item.selected { + padding-top: @ui-tab-height; + margin-top: -@ui-tab-height; + } } } From 06ac532e07eb2742924357a84f508b72185c02c1 Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 29 Mar 2018 11:46:35 +0900 Subject: [PATCH 16/17] Add option for left tab close buttons --- lib/main.coffee | 16 ++++++++++++++++ package.json | 15 +++++++++++++-- spec/theme-spec.coffee | 4 ++++ styles/config.less | 27 ++++++++++++++++++++++----- 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/lib/main.coffee b/lib/main.coffee index 453aec2..815691a 100644 --- a/lib/main.coffee +++ b/lib/main.coffee @@ -10,6 +10,9 @@ module.exports = atom.config.observe "#{themeName}.tabSizing", (value) -> setTabSizing(value) + atom.config.observe "#{themeName}.tabCloseButton", (value) -> + setTabCloseButton(value) + atom.config.observe "#{themeName}.hideDockButtons", (value) -> setHideDockButtons(value) @@ -24,6 +27,7 @@ module.exports = deactivate: -> unsetFontSize() unsetTabSizing() + unsetTabCloseButton() unsetHideDockButtons() unsetStickyHeaders() @@ -46,6 +50,18 @@ unsetTabSizing = -> root.removeAttribute("theme-#{themeName}-tabsizing") +# Tab Close Button ----------------------- + +setTabCloseButton = (tabCloseButton) -> + if tabCloseButton is 'Left' + root.setAttribute("theme-#{themeName}-tab-close-button", 'left') + else + unsetTabCloseButton() + +unsetTabCloseButton = -> + root.removeAttribute("theme-#{themeName}-tab-close-button") + + # Dock Buttons ----------------------- setHideDockButtons = (hideDockButtons) -> diff --git a/package.json b/package.json index 6889052..dd69a86 100644 --- a/package.json +++ b/package.json @@ -50,18 +50,29 @@ ], "order": 2 }, + "tabCloseButton": { + "title": "Tab Close Button", + "description": "Choose the position of the close button shown in tabs.", + "type": "string", + "default": "Right", + "enum": [ + "Left", + "Right" + ], + "order": 3 + }, "hideDockButtons": { "title": "Hide dock toggle buttons", "description": "Note: When hiding the toggle buttons, opening a dock needs to be done by using the keyboard or other alternatives.", "type": "boolean", "default": "false", - "order": 3 + "order": 4 }, "stickyHeaders": { "title": "Make tree-view project headers sticky", "type": "boolean", "default": "true", - "order": 4 + "order": 5 } } } diff --git a/spec/theme-spec.coffee b/spec/theme-spec.coffee index 77273eb..909939f 100644 --- a/spec/theme-spec.coffee +++ b/spec/theme-spec.coffee @@ -19,6 +19,10 @@ describe "#{themeName} theme", -> atom.config.set("#{themeName}.tabSizing", 'Minimum') expect(document.documentElement.getAttribute("theme-#{themeName}-tabsizing")).toBe 'minimum' + it "allows the tab close button to be shown on the left via config", -> + atom.config.set("#{themeName}.tabCloseButton", 'Left') + expect(document.documentElement.getAttribute("theme-#{themeName}-tab-close-button")).toBe 'left' + it "allows the dock toggle buttons to be hidden via config", -> atom.config.set("#{themeName}.hideDockButtons", true) expect(document.documentElement.getAttribute("theme-#{themeName}-dock-buttons")).toBe 'hidden' diff --git a/styles/config.less b/styles/config.less index 200a565..06f5e3f 100644 --- a/styles/config.less +++ b/styles/config.less @@ -1,14 +1,18 @@ -// Tabs ---------------------------------------------- +// Theme config +// This gets changed from the theme settings @theme-tabsizing: ~'theme-@{ui-theme-name}-tabsizing'; @theme-dockButtons: ~'theme-@{ui-theme-name}-dock-buttons'; @theme-stickyHeaders: ~'theme-@{ui-theme-name}-sticky-headers'; +@theme-closeButton: ~'theme-@{ui-theme-name}-tab-close-button'; -@tab-min-width: 7em; // ~ icon + 6 characters +// Tabs ---------------------------------------------- + +@tab-min-width: 7em; // ~ icon + 6 characters -// Even (default) --------------- +// Even (default) .tab-bar { .tab, @@ -32,7 +36,7 @@ } -// Maximum (full width) --------------- +// Maximum (full width) [@{theme-tabsizing}="maximum"] .tab-bar { .tab, @@ -42,7 +46,7 @@ } -// Minimum (show long paths) --------------- +// Minimum (show long paths) [@{theme-tabsizing}="minimum"] .tab-bar { .tab, @@ -60,6 +64,19 @@ } +// Tabs: close button position ------------------------------ + +[@{theme-closeButton}="left"] { + + .tab-bar .tab { + .close-icon { + right: auto; + left: @icon-padding-right; + } + } + +} + // Hide docks toggle buttons ------------------------------ From 4d9379fea95c7ee213d17964cfc4bd091d88b66f Mon Sep 17 00:00:00 2001 From: simurai Date: Mon, 9 Apr 2018 12:35:36 +0900 Subject: [PATCH 17/17] Prepare 1.12.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd69a86..473d62f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "one-light-ui", "theme": "ui", - "version": "1.11.0", + "version": "1.12.0", "description": "Atom One light UI theme", "keywords": [ "light",