From 7b8e398891a85d82fdf12cff2d0c132c9f61d55d Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Fri, 22 Dec 2023 22:58:13 -0600 Subject: [PATCH 1/4] improve simple styling on theme selector. nest inside toggle. --- .../homebrew/editor/snippetbar/snippetbar.jsx | 3 +- .../editor/snippetbar/snippetbar.less | 28 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index d60e51388..d4de1d2f5 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -176,8 +176,9 @@ const Snippetbar = createClass({
+ {this.state.themeSelector && this.renderThemeSelector()}
- {this.state.themeSelector && this.renderThemeSelector()} +
this.props.onViewChange('text')}> diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 8dc6a8b9d..aca598025 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -61,13 +61,14 @@ color : black; } } - &.editorTheme{ + &.editorTheme { .tooltipLeft('Editor Themes'); font-size : 0.75em; color : black; - &.active{ - color : white; - background-color: black; + &.active { + position : relative; + color : white; + background-color : black; } } &.divider { @@ -78,14 +79,17 @@ } } } - .themeSelector{ - position: absolute; - left: -65px; - top: 30px; - z-index: 999; - width: 170px; - background-color: black; - border-radius: 5px; + .themeSelector { + position : absolute; + top : 25px; + right : 0; + z-index : 1; + display : flex; + align-items : center; + justify-content : center; + width : 170px; + height : inherit; + background-color : inherit; } } .snippetBarButton{ From 8575d72f6e188e0ee3dbd27d643e8312a6f732ed Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Fri, 22 Dec 2023 23:36:46 -0600 Subject: [PATCH 2/4] add e.target check to prevent dismissal of select menu --- client/homebrew/editor/snippetbar/snippetbar.jsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index d4de1d2f5..ddcb02f7c 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -74,6 +74,7 @@ const Snippetbar = createClass({ } }, + mergeCustomizer : function(valueA, valueB, key) { if(key == 'snippets') { const result = _.reverse(_.unionBy(_.reverse(valueB), _.reverse(valueA), 'name')); // Join snippets together, with preference for the current theme over the base theme @@ -102,10 +103,12 @@ const Snippetbar = createClass({ this.props.onInject(injectedText); }, - toggleThemeSelector : function(){ - this.setState({ - themeSelector : !this.state.themeSelector - }); + toggleThemeSelector : function(e){ + if(e.target.tagName != 'SELECT'){ + this.setState({ + themeSelector : !this.state.themeSelector + }); + } }, changeTheme : function(e){ @@ -119,7 +122,7 @@ const Snippetbar = createClass({ renderThemeSelector : function(){ return
- {EditorThemes.map((theme, key)=>{ return ; })} From 407c35d9f73f9acdd8777564408e09745b8807f5 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Fri, 22 Dec 2023 23:40:29 -0600 Subject: [PATCH 3/4] switch to gray 'active' color --- client/homebrew/editor/snippetbar/snippetbar.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index aca598025..ee390aac4 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -67,8 +67,7 @@ color : black; &.active { position : relative; - color : white; - background-color : black; + background-color : gray; } } &.divider { From 8674bc9da2cf83479b1ba7f0c96b1838875ba494 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Sat, 23 Dec 2023 20:49:59 -0600 Subject: [PATCH 4/4] change gray to #999 --- client/homebrew/editor/snippetbar/snippetbar.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index ee390aac4..ec83c3fc5 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -67,7 +67,7 @@ color : black; &.active { position : relative; - background-color : gray; + background-color : #999; } } &.divider {