-
Notifications
You must be signed in to change notification settings - Fork 20
Fix Player and RoomCountBox tooltip not updating #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,12 +14,10 @@ | |
| using WheelWizard.Settings.Types; | ||
| using WheelWizard.Shared.DependencyInjection; | ||
| using WheelWizard.Utilities.RepeatedTasks; | ||
| using WheelWizard.Views.Components; | ||
| using WheelWizard.Views.Pages; | ||
| using WheelWizard.Views.Patterns; | ||
| using WheelWizard.Views.Popups.Generic; | ||
| using WheelWizard.WheelWizardData.Domain; | ||
| using WheelWizard.WiiManagement; | ||
| using WheelWizard.WiiManagement.GameLicense; | ||
|
|
||
| namespace WheelWizard.Views; | ||
|
|
@@ -198,20 +196,26 @@ public void UpdatePlayerAndRoomCount(RRLiveRooms sender) | |
| var playerCount = sender.PlayerCount; | ||
| var roomCount = sender.RoomCount; | ||
| PlayerCountBox.Text = playerCount.ToString(); | ||
| PlayerCountBox.TipText = playerCount switch | ||
| { | ||
| 1 => Phrases.Hover_PlayersOnline_1, | ||
| 0 => Phrases.Hover_PlayersOnline_0, | ||
| _ => Humanizer.ReplaceDynamic(Phrases.Hover_PlayersOnline_x, playerCount) | ||
| ?? $"There are currently {playerCount} players online", | ||
| }; | ||
| ToolTip.SetTip( | ||
| PlayerCountBox, | ||
| playerCount switch | ||
| { | ||
| 1 => Phrases.Hover_PlayersOnline_1, | ||
| 0 => Phrases.Hover_PlayersOnline_0, | ||
| _ => Humanizer.ReplaceDynamic(Phrases.Hover_PlayersOnline_x, playerCount) | ||
| ?? $"There are currently {playerCount} players online", | ||
| } | ||
| ); | ||
| RoomCountBox.Text = roomCount.ToString(); | ||
| RoomCountBox.TipText = roomCount switch | ||
| { | ||
| 1 => Phrases.Hover_RoomsOnline_1, | ||
| 0 => Phrases.Hover_RoomsOnline_0, | ||
| _ => Humanizer.ReplaceDynamic(Phrases.Hover_RoomsOnline_x, roomCount) ?? $"There are currently {roomCount} rooms active", | ||
| }; | ||
| ToolTip.SetTip( | ||
| RoomCountBox, | ||
| roomCount switch | ||
| { | ||
| 1 => Phrases.Hover_RoomsOnline_1, | ||
| 0 => Phrases.Hover_RoomsOnline_0, | ||
| _ => Humanizer.ReplaceDynamic(Phrases.Hover_RoomsOnline_x, roomCount) ?? $"There are currently {roomCount} rooms active", | ||
| } | ||
| ); | ||
|
Comment on lines
+199
to
+218
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: In Avalonia, these are two separate mechanisms: 1) Inheritance (“inherits: true”) is low precedenceProperty inheritance only applies to properties registered with So even if an attached property is inheritable, an inherited value will lose to any template-provided value. 2)
|
||
| UpdateFriendCount(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: TeamWheelWizard/WheelWizard
Length of output: 853
🏁 Script executed:
fd -type f "StateBox.axaml.cs"Repository: TeamWheelWizard/WheelWizard
Length of output: 241
🏁 Script executed:
Repository: TeamWheelWizard/WheelWizard
Length of output: 5855
Set
TipTextproperty instead ofToolTip.Tipattached property on StateBox controls.The StateBox template (in
StateBox.axaml:30) binds its internal Border's tooltip viaToolTip.Tip="{TemplateBinding TipText}". SettingToolTip.Tipdirectly on the StateBox control here will not work because the TemplateBinding explicitly binds to theTipTextproperty, which remains unset.Use the
TipTextproperty instead (as seen in other StateBox usages in the codebase):Example fix
🤖 Prompt for AI Agents