[Markdown][IJPL-251259] Adapt scrollbar styling to IDE scale

Refactored `JBCefScrollbarsHelper` to support scaling for custom scrollbar styles based on the IDE scale. Adjusted Markdown preview to utilize the new method for consistent styling.

(cherry picked from commit f06bc073b6ddb985740edc3ae75ee50fa27aea0b)


Merge-request: IJ-MR-218766
Merged-by: Ilia Permiashkin <ilia.permiashkin@jetbrains.com>

GitOrigin-RevId: 8d33f41d4f9eb0174be225b09538a4bf4df65d39
This commit is contained in:
Ekaterina Berezhko
2026-08-17 12:20:59 +00:00
committed by intellij-monorepo-bot
parent a7b268f9dc
commit caef43e423
@@ -3,7 +3,6 @@ package com.intellij.ui.jcef;
import com.intellij.diagnostic.LoadingState;
import com.intellij.ide.ui.UISettings;
import com.intellij.ide.ui.UISettingsUtils;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.colors.ColorKey;
import com.intellij.openapi.editor.colors.EditorColorsManager;
@@ -257,15 +256,15 @@ public final class JBCefScrollbarsHelper {
}
private static int getTrackSizePx() {
return (int)(JBCefApp.normalizeScaledSize(SystemInfo.isMac ? 14 : 10) * UISettingsUtils.getInstance().getCurrentIdeScale());
return JBCefApp.normalizeScaledSize(14);
}
private static int getThumbPaddingPx() {
return (int)(JBCefApp.normalizeScaledSize(SystemInfo.isMac ? 3 : 1) * UISettingsUtils.getInstance().getCurrentIdeScale());
return JBCefApp.normalizeScaledSize(3);
}
private static int getThumbRadiusPx() {
return (int)(JBCefApp.normalizeScaledSize(SystemInfo.isMac ? 7 : 0) * UISettingsUtils.getInstance().getCurrentIdeScale());
return JBCefApp.normalizeScaledSize(7);
}