Skip to content

Commit cc7762e

Browse files
committed
gwl: Remove edge scroll zone in favor of the side buttons
Considering we are already using the side scroll buttons which gives a clear over area for sliding the app list, having a edge scroll zone there makes it redudant and potentially confusing for the user.
1 parent 0d10727 commit cc7762e

1 file changed

Lines changed: 1 addition & 61 deletions

File tree

files/usr/share/cinnamon/applets/[email protected]/scrollBox.js

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ var ScrollBox = class ScrollBox {
138138

139139
// Scroll view signals
140140
this.signals.connect(this.scrollView, 'scroll-event', (actor, event) => this._onScroll(actor, event));
141-
this.signals.connect(this.scrollView, 'motion-event', (actor, event) => this._onMotionEvent(actor, event));
142-
this.signals.connect(this.scrollView, 'leave-event', () => this._stopSlide());
143141

144142
// Track content size changes
145143
this.signals.connect(this.container, 'allocation-changed', () => this.updateScrollButtonVisibility());
@@ -272,7 +270,7 @@ var ScrollBox = class ScrollBox {
272270
const current = adjustment.value;
273271
const page_size = adjustment.page_size;
274272

275-
let fade_offset = this._getFadeOffset() / 2;
273+
let fade_offset = this._getFadeOffset();
276274

277275
if (c1 < current + fade_offset || c2 > current + page_size - fade_offset) {
278276
const newValue = (c1 + c2) / 2 - page_size / 2;
@@ -352,64 +350,6 @@ var ScrollBox = class ScrollBox {
352350
});
353351
}
354352

355-
_onMotionEvent(actor, event) {
356-
if (this.state.panelEditMode || this.state.settings.enableClickToSlide)
357-
return Clutter.EVENT_PROPAGATE;
358-
359-
const [x, y] = event.get_coords();
360-
const [actorX, actorY] = actor.get_transformed_position();
361-
const [actorWidth, actorHeight] = actor.get_transformed_size();
362-
363-
// Calculate relative position within the actor
364-
const relX = x - actorX;
365-
const relY = y - actorY;
366-
367-
let scrollDirection = 0;
368-
const adjustment = this._getScrollAdjustment();
369-
370-
if (!adjustment) return Clutter.EVENT_PROPAGATE;
371-
372-
// Check if we can scroll (content is larger than view)
373-
const canScroll = adjustment.upper > adjustment.page_size;
374-
375-
if (!canScroll) {
376-
this._stopSlide();
377-
return Clutter.EVENT_PROPAGATE;
378-
}
379-
380-
const fadeOffset = this._getFadeOffset();
381-
382-
if (this.state.isHorizontal) {
383-
// Check left edge
384-
if (relX < fadeOffset && adjustment.value > adjustment.lower) {
385-
scrollDirection = -1;
386-
}
387-
// Check right edge
388-
else if (relX > actorWidth - fadeOffset &&
389-
adjustment.value < adjustment.upper - adjustment.page_size) {
390-
scrollDirection = 1;
391-
}
392-
} else {
393-
// Check top edge
394-
if (relY < fadeOffset && adjustment.value > adjustment.lower) {
395-
scrollDirection = -1;
396-
}
397-
// Check bottom edge
398-
else if (relY > actorHeight - fadeOffset &&
399-
adjustment.value < adjustment.upper - adjustment.page_size) {
400-
scrollDirection = 1;
401-
}
402-
}
403-
404-
if (scrollDirection !== 0) {
405-
this._startSlide(scrollDirection);
406-
} else {
407-
this._stopSlide();
408-
}
409-
410-
return Clutter.EVENT_PROPAGATE;
411-
}
412-
413353
_getScrollAdjustment() {
414354
if (this.state.isHorizontal) {
415355
const hBar = this.scrollView.get_hscroll_bar();

0 commit comments

Comments
 (0)