Files
clide/lib/widgets/src/clide_scrollbar.dart
T
jpmschweitzerandClaude Opus 4.6 46329700d5 dissolve app/ into repo root (D-056)
Single Flutter package at the repo root. All code, tests, assets,
and platform directories moved from app/ to root. Package renamed
from clide_app to clide — all imports rewritten. Merged pubspec
combines core (ffi) and app (flutter, yaml, xterm) dependencies.
Makefile simplified: no APP_PRESENT conditionals, no cd, no daemon
lifecycle. 317 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 00:37:20 +02:00

55 lines
1.3 KiB
Dart

import 'package:clide/kernel/src/theme/controller.dart';
import 'package:flutter/widgets.dart';
/// Thin themed scrollbar. Tier-0 shell; more refined scrolling (velocity
/// multiplier, keyboard nav) lands with the editor.
class ClideScrollbar extends StatelessWidget {
const ClideScrollbar({
super.key,
required this.controller,
required this.child,
this.axis = Axis.vertical,
});
final ScrollController controller;
final Widget child;
final Axis axis;
@override
Widget build(BuildContext context) {
final tokens = ClideTheme.of(context).surface;
return ScrollbarTheme(
slider: tokens.scrollbarSlider,
sliderHover: tokens.scrollbarSliderHover,
track: tokens.scrollbarTrack,
child: RawScrollbar(
controller: controller,
thumbColor: tokens.scrollbarSlider,
thickness: 8,
radius: const Radius.circular(4),
child: child,
),
);
}
}
class ScrollbarTheme extends InheritedWidget {
const ScrollbarTheme({
super.key,
required this.slider,
required this.sliderHover,
required this.track,
required super.child,
});
final Color slider;
final Color sliderHover;
final Color track;
@override
bool updateShouldNotify(ScrollbarTheme old) =>
slider != old.slider ||
sliderHover != old.sliderHover ||
track != old.track;
}