From f7be320575372e4a7aaa44439fb138a3f4045cf1 Mon Sep 17 00:00:00 2001 From: Ruben Daniels Date: Sun, 8 Apr 2012 11:49:45 +0200 Subject: [PATCH] * added gutter shadow as horizontal scrolling indicator --- lib/ace/css/editor.css | 20 +++++++++++++++++++- lib/ace/virtual_renderer.js | 11 +++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index 47bd1b42..cdd98c53 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -1,6 +1,5 @@ @import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono); - .ace_editor { position: absolute; overflow: hidden; @@ -29,12 +28,31 @@ z-index: 4; } +.ace_corner{ + position : absolute; + left : 41px; + top : -5px; + border-radius : 6px 0 0 0; + border-color : #e8e8e8; + border-width : 1px 0 0 1px; + border-style : solid; + box-shadow : 4px 4px 0px #e8e8e8 inset; + width : 10px; + height : 10px; + z-index : 10000; +} + .ace_gutter { position: absolute; overflow : hidden; height: 100%; width: auto; cursor: default; + z-index: 1000; +} + +.ace_gutter.horscroll { + box-shadow: 0px 0px 20px rgba(0,0,0,0.4); } .ace_gutter-cell { diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 7f390afe..9b51ee8f 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -74,6 +74,10 @@ var VirtualRenderer = function(container, theme) { this.$gutter = dom.createElement("div"); this.$gutter.className = "ace_gutter"; this.container.appendChild(this.$gutter); + + this.$corner = dom.createElement("div"); + this.$corner.className = "ace_corner"; + this.container.appendChild(this.$corner); this.scroller = dom.createElement("div"); this.scroller.className = "ace_scroller"; @@ -117,6 +121,13 @@ var VirtualRenderer = function(container, theme) { var scrollLeft = _self.scroller.scrollLeft; _self.scrollLeft = scrollLeft; _self.session.setScrollLeft(scrollLeft); + + if (scrollLeft == 0) { + _self.$gutter.className = "ace_gutter"; + } + else { + _self.$gutter.className = "ace_gutter horscroll"; + } }); this.cursorPos = {