From d4dcb1156672ed8fbc459ddc22949174f432ab49 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Tue, 17 Dec 2019 12:17:15 +0100 Subject: [PATCH] added zoom btns --- src/app.js | 22 ++++++++++---------- src/app/components/vertical-icons.js | 1 + src/app/panels/main-view.js | 22 +++++--------------- src/app/panels/tab-proxy.js | 30 ++++++++++++++++++---------- 4 files changed, 36 insertions(+), 39 deletions(-) diff --git a/src/app.js b/src/app.js index 6183241e59..5dae940db5 100644 --- a/src/app.js +++ b/src/app.js @@ -61,14 +61,14 @@ var css = csjs` pre { overflow-x: auto; } - .browsersolidity { + .remixIDE { width : 100vw; height : 100vh; overflow : hidden; flex-direction : row; display : flex; } - .mainpanel { + .mainpanel { display : flex; flex-direction : column; overflow : hidden; @@ -86,16 +86,16 @@ var css = csjs` flex-direction : row-reverse; width : 320px; } - .highlightcode { - position:absolute; - z-index:20; - background-color: var(--info); + .highlightcode { + position : absolute; + z-index : 20; + background-color : var(--info); } .highlightcode_fullLine { - position:absolute; - z-index:20; - background-color: var(--info); - opacity: 0.5; + position : absolute; + z-index : 20; + background-color : var(--info); + opacity : 0.5; } ` @@ -162,7 +162,7 @@ class App { self._components.resizeFeature = new PanelsResize(self._view.sidepanel) self._view.el = yo` -
+
${self._view.iconpanel} ${self._view.sidepanel} ${self._components.resizeFeature.render()} diff --git a/src/app/components/vertical-icons.js b/src/app/components/vertical-icons.js index 098cc1dece..cef410640d 100644 --- a/src/app/components/vertical-icons.js +++ b/src/app/components/vertical-icons.js @@ -171,6 +171,7 @@ export class VerticalIcons extends Plugin { * @param {string} name Name of profile of the module to activate */ addActive (name) { + if (name === 'home') return const themeType = globalRegistry.get('themeModule').api.currentTheme().quality const invert = themeType === 'dark' ? 1 : 0 const brightness = themeType === 'dark' ? '150' : '0' // should be >100 for icons with color diff --git a/src/app/panels/main-view.js b/src/app/panels/main-view.js index 1640a0279e..8437b7a41e 100644 --- a/src/app/panels/main-view.js +++ b/src/app/panels/main-view.js @@ -11,19 +11,12 @@ var ContextView = require('../editor/contextView') var csjs = require('csjs-inject') var css = csjs` - .mainview { - display : flex; - flex-direction : column; - height : 100%; - } - .content { - position : relative; + .mainview { display : flex; flex-direction : column; height : 100%; width : 100%; } - ` export class MainView { @@ -181,13 +174,13 @@ export class MainView { } render () { var self = this - if (self._view.el) return self._view.el + if (self._view.mainview) return self._view.mainview self._view.editor = self.editor.render() self._view.editor.style.display = 'none' self._view.mainPanel = self.mainPanel.render() self._view.terminal = self._components.terminal.render() - self._view.content = yo` -
+ self._view.mainview = yo` +
${self.tabProxy.renderTabsbar()} ${self._view.editor} ${self._view.mainPanel} @@ -195,11 +188,6 @@ export class MainView { ${self._view.terminal}
` - self._view.el = yo` -
- ${self._view.content} -
- ` // INIT self._adjustLayout('top', self.data._layout.top.offset) @@ -207,7 +195,7 @@ export class MainView { if (e.altKey && e.keyCode === 84) self.tabProxy.switchNextTab() // alt + t }) - return self._view.el + return self._view.mainview } registerCommand (name, command, opts) { var self = this diff --git a/src/app/panels/tab-proxy.js b/src/app/panels/tab-proxy.js index 47f2988553..d3c46f6cc0 100644 --- a/src/app/panels/tab-proxy.js +++ b/src/app/panels/tab-proxy.js @@ -117,10 +117,6 @@ export class TabProxy { } } - showTab (name) { - this._view.filetabs.activateTab(name) - } - addTab (name, title, switchTo, close, icon) { if (this._handlers[name]) return @@ -147,6 +143,14 @@ export class TabProxy { this.handlers[type] = fn } + onZoomOut () { + this.editor.editorFontSize(-1) + } + + onZoomIn () { + this.editor.editorFontSize(1) + } + renderTabsbar () { this._view.filetabs = yo`` this._view.filetabs.addEventListener('tabClosed', (event) => { @@ -160,14 +164,18 @@ export class TabProxy { this._view.filetabs.canAdd = false - this._view.tabs = yo` -
- ${this._view.filetabs} + const zoomBtns = yo` +
+ this.onZoomOut()}> + this.onZoomIn()}>
` - let tabsbar = yo` -
- ${this._view.tabs} + + // @todo(#2492) remove style after the mainPanel layout fix. + this._view.tabs = yo` +
+ ${zoomBtns} + ${this._view.filetabs}
` @@ -191,6 +199,6 @@ export class TabProxy { return false }) - return tabsbar + return this._view.tabs } }