From 02b7956cf7f8ca1f41833d05fb8d01429d460d6a Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 3 May 2019 17:23:25 +0200 Subject: [PATCH 1/3] improve solidity context view --- src/app/editor/contextView.js | 8 ++------ src/app/editor/styles/contextView-styles.js | 12 ++++++------ src/app/panels/editor-panel.js | 6 ++++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/app/editor/contextView.js b/src/app/editor/contextView.js index 0ebbfe9824..ed0a524153 100644 --- a/src/app/editor/contextView.js +++ b/src/app/editor/contextView.js @@ -36,19 +36,17 @@ class ContextView { this.update() }) this.contextualListener.event.register('stopHighlighting', () => { - this.hide() }) } render () { - const view = yo`
+ const view = yo`
${this._renderTarget()}
` if (!this._view) { this._view = view - this.hide() } return view } @@ -68,7 +66,6 @@ class ContextView { update () { if (this._view) { yo.update(this._view, this.render()) - this._view.style.display = this._current ? 'block' : 'none' } } @@ -169,14 +166,13 @@ class ContextView { } } - return yo`
+ return yo`
${showGasEstimation()}
${type}
${node.attributes.name}
${references} - ${showGasEstimation()}
` } } diff --git a/src/app/editor/styles/contextView-styles.js b/src/app/editor/styles/contextView-styles.js index edf59d5609..9ad3095886 100644 --- a/src/app/editor/styles/contextView-styles.js +++ b/src/app/editor/styles/contextView-styles.js @@ -2,7 +2,9 @@ var csjs = require('csjs-inject') var css = csjs` .contextview { - opacity : 1; + opacity : 1; + position : relative; + height : 20px; } .container { padding : 1px 15px; @@ -14,7 +16,7 @@ var css = csjs` text-overflow : ellipsis; overflow : hidden; white-space : nowrap; - font-size : 18px; + font-size : 13px; } .type { font-style : italic; @@ -35,7 +37,7 @@ var css = csjs` margin-left : 15px; } .gasEstimation { - margin-left: 15px; + margin-right: 15px; display: flex; align-items: center; } @@ -44,12 +46,10 @@ var css = csjs` margin-right: 5px; } .contextviewcontainer{ - position : absolute; - top : 35px; z-index : 50; - left : 40%; border-radius : 1px; border : 2px solid var(--secondary); + transition: all 0.3s cubic-bezier(0.86, 0, 0.07, 1); } ` diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 1e8e70d411..f6eccd3a7f 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -71,17 +71,19 @@ class EditorPanel { // we check upstream for "fileChanged" self._view.editor.style.display = 'block' self._view.mainPanel.style.display = 'none' + self._components.contextView.show() }) self.tabProxy.event.on('switchFile', (file) => { self._view.editor.style.display = 'block' self._view.mainPanel.style.display = 'none' + self._components.contextView.show() }) self.tabProxy.event.on('closeFile', (file) => { }) self.tabProxy.event.on('switchApp', showApp) self.tabProxy.event.on('closeApp', (name) => { self._view.editor.style.display = 'block' - self._components.contextView.hide() + self._components.contextView.show() self._view.mainPanel.style.display = 'none' }) self.data = { @@ -181,9 +183,9 @@ class EditorPanel { self._view.content = yo`
${self.tabProxy.renderTabsbar()} - ${self._components.contextView.render()} ${self._view.editor} ${self._view.mainPanel} + ${self._components.contextView.render()} ${self._view.terminal}
` From 7efafc5155c4070c39ed40e4f29b3f1c1f1f0042 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 6 May 2019 14:26:19 +0200 Subject: [PATCH 2/3] Update contextView-styles.js --- src/app/editor/styles/contextView-styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/editor/styles/contextView-styles.js b/src/app/editor/styles/contextView-styles.js index 9ad3095886..4c91e02f5a 100644 --- a/src/app/editor/styles/contextView-styles.js +++ b/src/app/editor/styles/contextView-styles.js @@ -49,7 +49,7 @@ var css = csjs` z-index : 50; border-radius : 1px; border : 2px solid var(--secondary); - transition: all 0.3s cubic-bezier(0.86, 0, 0.07, 1); + transition : all 0.3s cubic-bezier(0.86, 0, 0.07, 1); } ` From 1bba4c02d603423db0e2519f6a4682a653677a2c Mon Sep 17 00:00:00 2001 From: LianaHus Date: Mon, 6 May 2019 14:55:43 +0200 Subject: [PATCH 3/3] not needed anymore --- src/app/editor/styles/contextView-styles.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/editor/styles/contextView-styles.js b/src/app/editor/styles/contextView-styles.js index 4c91e02f5a..e9b3cea422 100644 --- a/src/app/editor/styles/contextView-styles.js +++ b/src/app/editor/styles/contextView-styles.js @@ -49,7 +49,6 @@ var css = csjs` z-index : 50; border-radius : 1px; border : 2px solid var(--secondary); - transition : all 0.3s cubic-bezier(0.86, 0, 0.07, 1); } `