@@ -1146,6 +1146,13 @@ void UpdateIndicatorLengths(
1146
1146
pMouseIndicatorLength = 0.0 ;
1147
1147
pTouchIndicatorLength = 0.0 ;
1148
1148
1149
+ // Uno workaround: If the scrollbar is smaller than the min size of the thumb,
1150
+ // we will try to set the visibility collapsed and then request to 'HideThumb',
1151
+ // which will drive uno to fall in an infinite layout cycle.
1152
+ // We instead cache the value and apply it only at the end.
1153
+ double ? m_tpElementHorizontalThumbWidth = default , m_tpElementVerticalThumbHeight = default , m_tpElementHorizontalPanningThumbWidth = default , m_tpElementVerticalPanningThumbHeight = default ;
1154
+ Visibility ? m_tpElementHorizontalThumbVisibility = default , m_tpElementVerticalThumbVisibility = default , m_tpElementHorizontalPanningThumbVisibility = default , m_tpElementVerticalPanningThumbVisibility = default ;
1155
+
1149
1156
if ( ! hideThumb )
1150
1157
{
1151
1158
double minSize = 0.0 ;
@@ -1159,8 +1166,9 @@ void UpdateIndicatorLengths(
1159
1166
1160
1167
double actualSize ;
1161
1168
double actualSizeMinusRepeatButtonsLength ;
1169
+
1162
1170
if ( orientation == Orientation . Horizontal &&
1163
- m_tpElementHorizontalThumb != null )
1171
+ m_tpElementHorizontalThumb != null )
1164
1172
{
1165
1173
if ( maximum - minimum != 0 )
1166
1174
{
@@ -1177,8 +1185,8 @@ void UpdateIndicatorLengths(
1177
1185
}
1178
1186
else
1179
1187
{
1180
- m_tpElementHorizontalThumb . Visibility = Visibility . Visible ;
1181
- m_tpElementHorizontalThumb . Width = result ;
1188
+ m_tpElementHorizontalThumbVisibility = Visibility . Visible ;
1189
+ m_tpElementHorizontalThumbWidth = result ;
1182
1190
mouseIndicatorLengthWasSet = true ;
1183
1191
}
1184
1192
}
@@ -1200,8 +1208,8 @@ void UpdateIndicatorLengths(
1200
1208
}
1201
1209
else
1202
1210
{
1203
- m_tpElementVerticalThumb . Visibility = Visibility . Visible ;
1204
- m_tpElementVerticalThumb . Height = result ;
1211
+ m_tpElementVerticalThumbVisibility = Visibility . Visible ;
1212
+ m_tpElementVerticalThumbHeight = result ;
1205
1213
mouseIndicatorLengthWasSet = true ;
1206
1214
}
1207
1215
}
@@ -1233,8 +1241,8 @@ void UpdateIndicatorLengths(
1233
1241
}
1234
1242
else
1235
1243
{
1236
- m_tpElementHorizontalPanningThumb . Visibility = Visibility . Visible ;
1237
- m_tpElementHorizontalPanningThumb . Width = result ;
1244
+ m_tpElementHorizontalPanningThumbVisibility = Visibility . Visible ;
1245
+ m_tpElementHorizontalPanningThumbWidth = result ;
1238
1246
touchIndicatorLengthWasSet = true ;
1239
1247
}
1240
1248
}
@@ -1255,8 +1263,8 @@ void UpdateIndicatorLengths(
1255
1263
}
1256
1264
else
1257
1265
{
1258
- m_tpElementVerticalPanningThumb . Visibility = Visibility . Visible ;
1259
- m_tpElementVerticalPanningThumb . Height = result ;
1266
+ m_tpElementVerticalPanningThumbVisibility = Visibility . Visible ;
1267
+ m_tpElementVerticalPanningThumbHeight = result ;
1260
1268
touchIndicatorLengthWasSet = true ;
1261
1269
}
1262
1270
}
@@ -1287,6 +1295,17 @@ void UpdateIndicatorLengths(
1287
1295
m_tpElementVerticalPanningThumb . Visibility = Visibility . Collapsed ;
1288
1296
}
1289
1297
}
1298
+ else
1299
+ {
1300
+ if ( m_tpElementHorizontalThumbWidth . HasValue ) m_tpElementHorizontalThumb . Width = m_tpElementHorizontalThumbWidth . Value ;
1301
+ if ( m_tpElementVerticalThumbHeight . HasValue ) m_tpElementVerticalThumb . Height = m_tpElementVerticalThumbHeight . Value ;
1302
+ if ( m_tpElementHorizontalPanningThumbWidth . HasValue ) m_tpElementHorizontalPanningThumb . Width = m_tpElementHorizontalPanningThumbWidth . Value ;
1303
+ if ( m_tpElementVerticalPanningThumbHeight . HasValue ) m_tpElementVerticalPanningThumb . Height = m_tpElementVerticalPanningThumbHeight . Value ;
1304
+ if ( m_tpElementHorizontalThumbVisibility . HasValue ) m_tpElementHorizontalThumb . Visibility = m_tpElementHorizontalThumbVisibility . Value ;
1305
+ if ( m_tpElementVerticalThumbVisibility . HasValue ) m_tpElementVerticalThumb . Visibility = m_tpElementVerticalThumbVisibility . Value ;
1306
+ if ( m_tpElementHorizontalPanningThumbVisibility . HasValue ) m_tpElementHorizontalPanningThumb . Visibility = m_tpElementHorizontalPanningThumbVisibility . Value ;
1307
+ if ( m_tpElementVerticalPanningThumbVisibility . HasValue ) m_tpElementVerticalPanningThumb . Visibility = m_tpElementVerticalPanningThumbVisibility . Value ;
1308
+ }
1290
1309
}
1291
1310
1292
1311
// during a SemanticZoomOperation we want to be able to block the scrollbar
0 commit comments