@@ -216,14 +216,19 @@ class MainView : MonoBehaviour
216
216
Label m_ResultLabel ;
217
217
Button m_ScreenResultMainMenuButton ;
218
218
Button m_ScreenResultPlayAgainButton ;
219
+
219
220
VisualElement m_SettingsView ;
220
221
Button m_CloseSettingsButton ;
221
222
Button m_SettingsButton ;
222
223
Button m_InGameSettingsButton ;
223
- private TextField m_SearchField ;
224
+ TextField m_SearchField ;
225
+ Label m_GameplayHeader ;
226
+ Label m_AudioHeader ;
227
+ Label m_AppearanceHeader ;
228
+ Label m_SettingsHeader ;
224
229
VisualElement m_LastView ;
225
230
LetterCardListModel m_Model = new ( ) ;
226
-
231
+
227
232
// Label m_AnswerLabel;
228
233
229
234
Gameplay . DifficultyLevel m_SelectedDifficultyLevel = Gameplay . DifficultyLevel . Hard ;
@@ -416,15 +421,28 @@ void SetupUI()
416
421
417
422
m_SettingsView = m_StackView . Q ( "settingsView" ) ;
418
423
m_SettingsView . dataSource = m_PlayerSettings ;
419
-
424
+
420
425
var settingsScrollView = m_SettingsView . Q < ScrollView > ( "settingsScrollView" ) ;
421
426
settingsScrollView . GetOrCreateAccessibleProperties ( ) . label = "Settings Scroll View" ;
422
-
427
+
423
428
m_SearchField = m_SettingsView . Q < TextField > ( "settingsSearchField" ) ;
429
+ // TODO: This should be localized.
424
430
m_SearchField . GetOrCreateAccessibleProperties ( ) . label = "Search" ;
425
431
m_SearchField . GetOrCreateAccessibleProperties ( ) . role = AccessibilityRole . SearchField ;
426
432
m_SearchField . RegisterValueChangedCallback ( ( e ) => UpdateSearchField ( ) ) ;
427
433
434
+ m_GameplayHeader = m_SettingsView . Q < Label > ( "gameplayHeader" ) ;
435
+ m_GameplayHeader . GetOrCreateAccessibleProperties ( ) . role = AccessibilityRole . Header ;
436
+
437
+ m_AudioHeader = m_SettingsView . Q < Label > ( "audioHeader" ) ;
438
+ m_AudioHeader . GetOrCreateAccessibleProperties ( ) . role = AccessibilityRole . Header ;
439
+
440
+ m_AppearanceHeader = m_SettingsView . Q < Label > ( "appearanceHeader" ) ;
441
+ m_AppearanceHeader . GetOrCreateAccessibleProperties ( ) . role = AccessibilityRole . Header ;
442
+
443
+ m_SettingsHeader = m_SettingsView . Q < Label > ( "settingsHeader" ) ;
444
+ m_SettingsHeader . GetOrCreateAccessibleProperties ( ) . role = AccessibilityRole . Header ;
445
+
428
446
// m_SettingsPopup = new PopupWindow();
429
447
// m_SettingsPopup.content = m_SettingsView;
430
448
@@ -460,16 +478,16 @@ void SetupUI()
460
478
461
479
//root.Add(m_AnswerLabel = new Label());
462
480
//m_AnswerLabel.style.position = Position.Absolute;
463
-
481
+
464
482
}
465
483
466
484
void UpdateLangDirection ( VisualElement root )
467
485
{
468
486
if ( root . panel == null )
469
487
return ;
470
-
488
+
471
489
bool isRightToLeft = LocalizationSettings . SelectedLocale ? . Identifier . CultureInfo . TextInfo . IsRightToLeft ?? false ;
472
-
490
+
473
491
// Update text direction
474
492
root . languageDirection = isRightToLeft ? LanguageDirection . RTL : LanguageDirection . LTR ;
475
493
root . panel . visualTree . EnableInClassList ( "lsp-dir-ltr" , ! isRightToLeft ) ;
@@ -629,7 +647,7 @@ void UpdateSearchField()
629
647
}
630
648
631
649
var label = field . Q < Label > ( ) ;
632
-
650
+
633
651
if ( label != null && label . text . ToLowerInvariant ( ) . Contains ( searchText ) )
634
652
{
635
653
field . parent . style . display = DisplayStyle . Flex ;
0 commit comments