File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -1160,6 +1160,18 @@ public override void TabAction()
1160
1160
1161
1161
protected override ControlLayout Layout ( ControlLayout layout )
1162
1162
{
1163
+ int scrollPosition = 0 ;
1164
+ if ( Tabs [ ActiveTab ] . Vbox != null )
1165
+ {
1166
+ foreach ( var control in Tabs [ ActiveTab ] . Vbox . Controls )
1167
+ {
1168
+ if ( control is ControlLayoutScrollboxVertical controlLayoutScrollboxVertical )
1169
+ {
1170
+ scrollPosition = controlLayoutScrollboxVertical . GetScrollPosition ( ) ;
1171
+ }
1172
+ }
1173
+ }
1174
+
1163
1175
var vbox = base . Layout ( layout ) . AddLayoutVertical ( ) ;
1164
1176
1165
1177
if ( Tabs . Count > 0 )
@@ -1175,8 +1187,17 @@ protected override ControlLayout Layout(ControlLayout layout)
1175
1187
}
1176
1188
vbox . AddHorizontalSeparator ( ) ;
1177
1189
Tabs [ ActiveTab ] . Layout ( vbox ) ;
1190
+
1191
+ foreach ( var control in vbox . Controls )
1192
+ {
1193
+ if ( control is ControlLayoutScrollboxVertical controlLayoutScrollboxVertical )
1194
+ {
1195
+ controlLayoutScrollboxVertical . SetScrollPosition ( scrollPosition ) ;
1196
+ }
1197
+ }
1178
1198
}
1179
1199
1200
+ Tabs [ ActiveTab ] . Vbox = vbox ;
1180
1201
return vbox ;
1181
1202
}
1182
1203
@@ -1202,12 +1223,14 @@ class TabData
1202
1223
public readonly Tab Tab ;
1203
1224
public readonly string TabLabel ;
1204
1225
public readonly Action < ControlLayout > Layout ;
1226
+ public Orts . Viewer3D . Popups . ControlLayoutVertical Vbox ;
1205
1227
1206
1228
public TabData ( Tab tab , string tabLabel , Action < ControlLayout > layout )
1207
1229
{
1208
1230
Tab = tab ;
1209
1231
TabLabel = tabLabel ;
1210
1232
Layout = layout ;
1233
+ Vbox = null ;
1211
1234
}
1212
1235
}
1213
1236
Original file line number Diff line number Diff line change @@ -587,6 +587,7 @@ protected ControlLayoutScrollbox(int width, int height)
587
587
588
588
public abstract int ScrollSize { get ; }
589
589
590
+ public abstract int GetScrollPosition ( ) ;
590
591
public abstract void SetScrollPosition ( int position ) ;
591
592
592
593
internal RasterizerState ScissorTestEnable = new RasterizerState { ScissorTestEnable = true } ;
@@ -707,6 +708,11 @@ public override int ScrollSize
707
708
}
708
709
}
709
710
711
+ public override int GetScrollPosition ( )
712
+ {
713
+ return ScrollPosition ;
714
+ }
715
+
710
716
public override void SetScrollPosition ( int position )
711
717
{
712
718
position = Math . Max ( 0 , Math . Min ( Math . Max ( 0 , ScrollSize ) , position ) ) ;
@@ -841,6 +847,11 @@ public override int ScrollSize
841
847
}
842
848
}
843
849
850
+ public override int GetScrollPosition ( )
851
+ {
852
+ return ( ScrollPosition ) ;
853
+ }
854
+
844
855
public override void SetScrollPosition ( int position )
845
856
{
846
857
position = Math . Max ( 0 , Math . Min ( Math . Max ( 0 , ScrollSize ) , position ) ) ;
You can’t perform that action at this time.
0 commit comments