Skip to content

Commit 43b6b2e

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 43b6b2e

2 files changed

Lines changed: 4 additions & 64 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();

files/usr/share/cinnamon/applets/[email protected]/settings-schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@
206206
},
207207
"enable-click-to-slide": {
208208
"type": "checkbox",
209-
"default": true,
210-
"description": "Enable slide on click",
211-
"tooltip": "When the sliding view is visible, clicking the button at the edges will slide the app list. If disabled, hovering the mouse on the edge of the app list will slide the app list towards that side."
209+
"default": false,
210+
"description": "Enable click to slide when slide buttons are visible",
211+
"tooltip": "When enabled, clicking the slide buttons at either end of the app list will scroll the list in that direction. When disabled, the list will scroll when the mouse pointer hovers over the slide buttons."
212212
},
213213
"thumbnail-scroll-behavior": {
214214
"type": "checkbox",

0 commit comments

Comments
 (0)