@@ -82,14 +82,6 @@ impl LikeLayerSlice for ExpandingLayerSlice {
82
82
83
83
slice. expand_to_contain_rect ( Rect :: from ( bounding_box) ) ;
84
84
85
- /*
86
- slice.fill_rect(
87
- Rect::from(bounding_box),
88
- Color::red(),
89
- StrokeThickness::Filled,
90
- );
91
- */
92
-
93
85
match fill_mode {
94
86
FillMode :: Filled => {
95
87
for line in
@@ -699,7 +691,7 @@ impl ScrollView {
699
691
}
700
692
701
693
fn scroll_bar_width ( ) -> isize {
702
- 50
694
+ 42
703
695
}
704
696
}
705
697
@@ -717,7 +709,6 @@ impl Bordered for ScrollView {
717
709
}
718
710
719
711
fn draw_border_with_insets ( & self , onto : & mut Box < dyn LikeLayerSlice > ) -> Rect {
720
- //let rect = Bordered::draw_border_with_insets(self, onto, insets);
721
712
let ( frame_of_inner_margin, frame_of_content) = draw_border_with_insets (
722
713
onto,
723
714
self . outer_border_insets ( ) ,
@@ -759,7 +750,6 @@ impl Bordered for ScrollView {
759
750
RectInsets :: new ( 5 , 5 , 5 , 5 ) ,
760
751
RectInsets :: new ( 5 , 5 , 5 , 5 ) ,
761
752
scroll_bar_content_frame. size ,
762
- //self.currently_contains_mouse(),
763
753
false ,
764
754
false ,
765
755
) ;
@@ -779,10 +769,17 @@ impl Bordered for ScrollView {
779
769
) ;
780
770
scroll_bar_onto. fill_rect (
781
771
Rect :: from_parts ( scrollbar_attrs. origin , scrollbar_attrs. size ) ,
782
- Color :: green ( ) ,
772
+ Color :: new ( 180 , 180 , 180 ) ,
783
773
StrokeThickness :: Filled ,
784
774
) ;
785
775
776
+ // Mouse interaction highlight on top of the scroll bar
777
+ scroll_bar_onto. fill_rect (
778
+ Rect :: from_parts ( scrollbar_attrs. origin , scrollbar_attrs. size ) ,
779
+ Color :: new ( 160 , 160 , 160 ) ,
780
+ StrokeThickness :: Width ( 1 ) ,
781
+ ) ;
782
+
786
783
// PT: Horrible hack to make the highlight border show perfectly on top of the scroll bar
787
784
draw_outer_mouse_highlight ( onto, self . frame ( ) . size , self . currently_contains_mouse ( ) ) ;
788
785
@@ -939,10 +936,10 @@ fn compute_scrollbar_attributes(
939
936
scroll_position : Point ,
940
937
) -> ScrollbarAttributes {
941
938
// TODO(PT): Handle when the scroll offset is 'negative' i.e. when there's a bunch of content above the origin?
942
- let scrollbar_vertical_padding = 14 ;
939
+ let scrollbar_vertical_padding = 12 ;
943
940
let scrollbar_canvas_height = ( viewport_size. height - ( scrollbar_vertical_padding * 2 ) ) as f64 ;
944
- let min_scrollbar_height = ( scrollbar_canvas_height * 0.1 ) as isize ;
945
- let max_scrollbar_height = ( scrollbar_canvas_height * 0.4 ) as isize ;
941
+ let min_scrollbar_height = ( scrollbar_canvas_height * 0.08 ) as isize ;
942
+ let max_scrollbar_height = ( scrollbar_canvas_height * 0.35 ) as isize ;
946
943
947
944
// If the viewport is larger than the current content size, cap out at 100%
948
945
let nominal_scrollbar_height = if viewport_size. height >= content_size. height {
0 commit comments