Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Right scroll shadow #949

Closed
wants to merge 2 commits into from

2 participants

@danyaPostfactum

No description provided.

@danyaPostfactum

We also have to overwrite shadow in dark themes (some themes requires black shadow, but some of them has deep black background, so these requires white shadows)

@danyaPostfactum

Browsers draw it slowly, unfortunatly. I'l try to make it better...

@nightwing
Owner

Browsers draw it slowly, unfortunatly. I'l try to make it better...

Too bad:(. Please reopen if you find a faster way of doing this.
Also this should be optional feature, off by default.

@nightwing nightwing closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 3 deletions.
  1. +7 −1 lib/ace/css/editor.css
  2. +13 −2 lib/ace/virtual_renderer.js
View
8 lib/ace/css/editor.css
@@ -33,9 +33,15 @@
right: 0;
}
-.ace_scroller.horscroll {
+.ace_scroller.ace_scroll-left {
box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
}
+.ace_scroller.ace_scroll-right {
+ box-shadow: -17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
+}
+.ace_scroller.ace_scroll-left.ace_scroll-right {
+ box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset, -17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
+}
.ace_gutter-cell {
padding-left: 19px;
View
15 lib/ace/virtual_renderer.js
@@ -686,7 +686,13 @@ var VirtualRenderer = function(container, theme) {
this.scrollLeft = scrollLeft;
this.session.setScrollLeft(scrollLeft);
- this.scroller.className = this.scrollLeft == 0 ? "ace_scroller" : "ace_scroller horscroll";
+ this.scroller.className = "ace_scroller" ;
+ if (this.scroller.scrollLeft > 0){
+ this.scroller.className += " ace_scroll-left";
+ }
+ if (this.scroller.scrollWidth > this.scroller.scrollLeft + this.scroller.offsetWidth){
+ this.scroller.className += " ace_scroll-right";
+ }
}
// full
@@ -753,6 +759,11 @@ var VirtualRenderer = function(container, theme) {
if (changes & this.CHANGE_SIZE)
this.$updateScrollBar();
+ if (this.scroller.scrollWidth > this.scroller.scrollLeft + this.scroller.offsetWidth){
+ dom.addCssClass(this.scroller, "ace_scroll-right");
+ } else {
+ dom.removeCssClass(this.scroller, "ace_scroll-right");
+ }
};
this.$computeLayerConfig = function() {
@@ -763,7 +774,7 @@ var VirtualRenderer = function(container, theme) {
var longestLine = this.$getLongestLine();
- var horizScroll = this.$horizScrollAlwaysVisible || this.$size.scrollerWidth - longestLine < 0;
+ var horizScroll = this.$horizScrollAlwaysVisible || this.$size.scrollerWidth - this.$textLayer.$padding * 2 - longestLine < 0;
var horizScrollChanged = this.$horizScroll !== horizScroll;
this.$horizScroll = horizScroll;
if (horizScrollChanged) {
Something went wrong with that request. Please try again.