Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 7ebb751

Browse files
committed
Merge pull request #7105 from adobe/pflynn/tickmark-pos-tweaks
Fix ScrollTrackMarkers positioning metrics
2 parents abe919c + 6b45543 commit 7ebb751

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/search/ScrollTrackMarkers.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ define(function (require, exports, module) {
4040
PanelManager = require("view/PanelManager");
4141

4242

43-
/** @const @type {number} Height (and width) or scrollbar up/down arrow button on Win */
44-
var WIN_ARROW_HT = 17;
45-
4643
/** @type {?Editor} Editor the markers are currently shown for, or null if not shown */
4744
var editor;
4845

@@ -70,9 +67,11 @@ define(function (require, exports, module) {
7067
if (trackHt > 0) {
7168
// Scrollbar visible: determine offset of track from top of scrollbar
7269
if (brackets.platform === "win") {
73-
trackOffset = WIN_ARROW_HT; // Up arrow pushes down track
74-
} else {
75-
trackOffset = 0; // No arrows
70+
trackOffset = 0; // Custom scrollbar CSS has no gap around the track
71+
} else if (brackets.platform === "mac") {
72+
trackOffset = 4; // Native scrollbar has padding around the track
73+
} else { //(Linux)
74+
trackOffset = 2; // Custom scrollbar CSS has assymmetrical gap; this approximates it
7675
}
7776
trackHt -= trackOffset * 2;
7877

src/styles/brackets_scrollbars.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
}
7272

7373
.platform-linux {
74+
// Note: when changing padding/margins, may need to adjust metrics in ScrollTrackMarkers.js
75+
7476
::-webkit-scrollbar {
7577
width: 12px;
7678
height: 12px;
@@ -100,6 +102,8 @@
100102
}
101103

102104
.platform-win {
105+
// Note: when changing padding/margins, may need to adjust metrics in ScrollTrackMarkers.js
106+
103107
::-webkit-scrollbar {
104108
width: 12px;
105109
height: 12px;

0 commit comments

Comments
 (0)