From 4992f4e0cfaf590a08e5bfa2d331e5983173e7d8 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Thu, 24 Sep 2020 16:25:43 -0500 Subject: [PATCH] config toggle to show/hide ladder scrollbar for dj (defaults to hide) --- src/client/spark/Modules/Trading/Ladder/View/LadderGridHost.cs | 3 +++ src/lib/config/protos/UI.proto | 1 + 2 files changed, 4 insertions(+) diff --git a/src/client/spark/Modules/Trading/Ladder/View/LadderGridHost.cs b/src/client/spark/Modules/Trading/Ladder/View/LadderGridHost.cs index bbdc0c968..1f39bb13d 100644 --- a/src/client/spark/Modules/Trading/Ladder/View/LadderGridHost.cs +++ b/src/client/spark/Modules/Trading/Ladder/View/LadderGridHost.cs @@ -29,6 +29,7 @@ using System.Windows.Media.Animation; namespace mbts.spark { partial class LadderGridHost : Control { const int _min_row_count = 501, _max_row_count = 2001; + static readonly bool _show_scrollbar = config.Configuration.get().show_scrollbar; int _row_count = _min_row_count; @@ -82,6 +83,8 @@ namespace mbts.spark { _ordershost = new LadderOrdersHost(this) { HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Stretch }; var scrollViewerFactory = new FrameworkElementFactory(typeof(ScrollViewer)); scrollViewerFactory.SetValue(FocusableProperty, false); + if (!_show_scrollbar) + scrollViewerFactory.SetValue(ScrollViewer.VerticalScrollBarVisibilityProperty, ScrollBarVisibility.Hidden); Template = new ControlTemplate() { VisualTree = scrollViewerFactory }; diff --git a/src/lib/config/protos/UI.proto b/src/lib/config/protos/UI.proto index 0b0e543a5..4c319007b 100644 --- a/src/lib/config/protos/UI.proto +++ b/src/lib/config/protos/UI.proto @@ -72,6 +72,7 @@ message LadderKnobs { optional bool open_algo_popup_on_select = 6 [default = false]; optional bool use_algo_param_grid = 7 [default = true]; optional uint32 max_mbo_orders = 8 [default = 200]; + optional bool show_scrollbar = 9 [default = false]; } message OrderBookOptions {