@@ -443,19 +443,6 @@ local function build_page_components(page)
443
443
end
444
444
445
445
446
- --- Creates a scrollbaroptions for a scroll_container
447
- --
448
- -- @param visible_l the length of the scroll_container and scrollbar
449
- -- @param total_l length of the scrollable area
450
- -- @param scroll_factor as passed to scroll_container
451
- local function make_scrollbaroptions_for_scroll_container (visible_l , total_l , scroll_factor )
452
- assert (total_l >= visible_l )
453
- local max = total_l - visible_l
454
- local thumb_size = (visible_l / total_l ) * max
455
- return (" scrollbaroptions[min=0;max=%f;thumbsize=%f]" ):format (max / scroll_factor , thumb_size / scroll_factor )
456
- end
457
-
458
-
459
446
local formspec_show_hack = false
460
447
461
448
@@ -517,8 +504,8 @@ local function get_formspec(dialogdata)
517
504
" tooltip[search;" , fgettext (" Search" ), " ]" ,
518
505
" tooltip[search_clear;" , fgettext (" Clear" ), " ]" ,
519
506
" container_end[]" ,
520
- " scroll_container[0.25,1.25;" , tostring ( left_pane_width ), " , " ,
521
- tostring ( tabsize .height - 1.5 ), " ;leftscroll;vertical;0.1] " ,
507
+ ( " scroll_container[0.25,1.25;%f,%f;leftscroll;vertical;0.1;0] " ): format (
508
+ left_pane_width , tabsize .height - 1.5 ),
522
509
" style_type[button;border=false;bgcolor=#3333]" ,
523
510
" style_type[button:hover;border=false;bgcolor=#6663]" ,
524
511
}
@@ -548,7 +535,6 @@ local function get_formspec(dialogdata)
548
535
fs [# fs + 1 ] = " scroll_container_end[]"
549
536
550
537
if y >= tabsize .height - 1.25 then
551
- fs [# fs + 1 ] = make_scrollbaroptions_for_scroll_container (tabsize .height - 1.5 , y , 0.1 )
552
538
fs [# fs + 1 ] = (" scrollbar[%f,1.25;%f,%f;vertical;leftscroll;%f]" ):format (
553
539
left_pane_width + 0.25 , scrollbar_w , tabsize .height - 1.5 , dialogdata .leftscroll or 0 )
554
540
end
@@ -560,7 +546,7 @@ local function get_formspec(dialogdata)
560
546
end
561
547
562
548
local right_pane_width = tabsize .width - left_pane_width - 0.375 - 2 * scrollbar_w - 0.25
563
- fs [# fs + 1 ] = (" scroll_container[%f,0;%f,%f;rightscroll;vertical;0.1]" ):format (
549
+ fs [# fs + 1 ] = (" scroll_container[%f,0;%f,%f;rightscroll;vertical;0.1;0.25 ]" ):format (
564
550
tabsize .width - right_pane_width - scrollbar_w , right_pane_width , tabsize .height )
565
551
566
552
y = 0.25
@@ -616,7 +602,6 @@ local function get_formspec(dialogdata)
616
602
fs [# fs + 1 ] = " scroll_container_end[]"
617
603
618
604
if y >= tabsize .height then
619
- fs [# fs + 1 ] = make_scrollbaroptions_for_scroll_container (tabsize .height , y + 0.375 , 0.1 )
620
605
fs [# fs + 1 ] = (" scrollbar[%f,0;%f,%f;vertical;rightscroll;%f]" ):format (
621
606
tabsize .width - scrollbar_w , scrollbar_w , tabsize .height , dialogdata .rightscroll or 0 )
622
607
end
0 commit comments