From 8077a91ff746c7cad3347413eca0f39aac11eac0 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Fri, 29 Sep 2023 09:30:19 -0500 Subject: [PATCH 1/5] add foldAll and unfoldAll buttons to snippet bar. --- client/homebrew/editor/editor.jsx | 10 +++++++++ .../homebrew/editor/snippetbar/snippetbar.jsx | 21 ++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index d6502e985..ee2853865 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -330,6 +330,14 @@ const Editor = createClass({ return this.refs.codeEditor?.undo(); }, + foldCode : function(){ + return this.refs.codeEditor?.foldAllCode(); + }, + + unfoldCode : function(){ + return this.refs.codeEditor?.unfoldAllCode(); + }, + render : function(){ return (
@@ -343,6 +351,8 @@ const Editor = createClass({ theme={this.props.brew.theme} undo={this.undo} redo={this.redo} + foldCode={this.foldCode} + unfoldCode={this.unfoldCode} historySize={this.historySize()} currentEditorTheme={this.state.editorTheme} updateEditorTheme={this.updateEditorTheme} diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 246d534a9..23f15c2b3 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -37,6 +37,8 @@ const Snippetbar = createClass({ undo : ()=>{}, redo : ()=>{}, historySize : ()=>{}, + foldCode : ()=>{}, + unfoldCode : ()=>{}, updateEditorTheme : ()=>{}, cursorPos : {} }; @@ -46,7 +48,7 @@ const Snippetbar = createClass({ return { renderer : this.props.renderer, themeSelector : false, - snippets : [] + snippets : [], }; }, @@ -144,6 +146,22 @@ const Snippetbar = createClass({ renderEditorButtons : function(){ if(!this.props.showEditButtons) return; + let foldButtons; + if(this.props.view == 'text'){ + foldButtons = + <> +
+ +
+
+ +
+ + + } + return
@@ -154,6 +172,7 @@ const Snippetbar = createClass({
+ {foldButtons}
From 3cf6691e6747d31183fa1f2c5a7a2e22a00a3267 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Fri, 29 Sep 2023 09:30:44 -0500 Subject: [PATCH 2/5] remove width constraint on editors in snippet bar. --- client/homebrew/editor/snippetbar/snippetbar.less | 1 - 1 file changed, 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index ed2dcebce..b4712838a 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -10,7 +10,6 @@ top : 0px; right : 0px; height : @menuHeight; - width : 125px; justify-content : space-between; &>div{ height : @menuHeight; From cacfc788fb92325e571c4b11a6617392261bab1d Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 8 Nov 2023 17:38:42 -0500 Subject: [PATCH 3/5] Change Expand Icon for consistency with collapse icon --- client/homebrew/editor/snippetbar/snippetbar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 23f15c2b3..1daae91eb 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -156,7 +156,7 @@ const Snippetbar = createClass({
- +
From 3f19b2975cb55440a82a981ea5e47fe0d4c989ac Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 8 Nov 2023 17:48:32 -0500 Subject: [PATCH 4/5] Add tooltips --- .../homebrew/editor/snippetbar/snippetbar.less | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index b4712838a..8dc6a8b9d 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -45,6 +45,22 @@ color : black; } } + &.foldAll{ + .tooltipLeft('Fold All'); + font-size : 0.75em; + color : grey; + &.active{ + color : black; + } + } + &.unfoldAll{ + .tooltipLeft('Unfold All'); + font-size : 0.75em; + color : grey; + &.active{ + color : black; + } + } &.editorTheme{ .tooltipLeft('Editor Themes'); font-size : 0.75em; From ad455f652cf896d03c533b9a0bec028381fc0bbb Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 9 Nov 2023 10:03:14 -0500 Subject: [PATCH 5/5] Remove extra comma --- client/homebrew/editor/snippetbar/snippetbar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 1daae91eb..d60e51388 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -48,7 +48,7 @@ const Snippetbar = createClass({ return { renderer : this.props.renderer, themeSelector : false, - snippets : [], + snippets : [] }; },