Skip to content

Fix disabled form slider bars being half-baked#36080

Merged
peppy merged 5 commits intoppy:masterfrom
bdach:form-slider-bar-disabled
Dec 22, 2025
Merged

Fix disabled form slider bars being half-baked#36080
peppy merged 5 commits intoppy:masterfrom
bdach:form-slider-bar-disabled

Conversation

@bdach
Copy link
Copy Markdown
Collaborator

@bdach bdach commented Dec 19, 2025

Noticed during review of #36055.

Before:

Screen.Recording.2025-12-19.at.12.20.13.mov

After:

Screen.Recording.2025-12-19.at.12.21.10.mov

In order of severity:

  • You could actually click on the textbox portion of a disabled textbox, focus it, select text, input stuff, and commit, which would die on the spot.
  • The slider part had no visual indication that it's not interactable anymore.

In order of severity:

- You could actually click on the textbox portion of a disabled textbox,
  focus it, select text, input stuff, and commit, which would die
  on the spot.

- The slider part had no visual indication that it's not interactable
  anymore.
@bdach bdach requested review from frenzibyte and peppy December 19, 2025 11:23
@bdach bdach self-assigned this Dec 19, 2025
@bdach bdach added the type/behavioural An issue with actual UI or game behaviour. Has a real world impact causing something to not work. label Dec 19, 2025
@bdach bdach moved this from Inbox to Pending Review in osu! team task tracker Dec 19, 2025
peppy
peppy previously approved these changes Dec 19, 2025
Comment on lines +210 to +211
textBox.ReadOnly = disabled;
updateState();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placing this here doesn't handle the case where the bindable is already disabled before the slider is loaded.

Consider this diff:

diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneFormControls.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneFormControls.cs
index 2003f5de83..b924e1f844 100644
--- a/osu.Game.Tests/Visual/UserInterface/TestSceneFormControls.cs
+++ b/osu.Game.Tests/Visual/UserInterface/TestSceneFormControls.cs
@@ -87,6 +87,20 @@ public TestSceneFormControls()
                                 },
                                 TabbableContentContainer = this,
                             },
+                            new FormSliderBar<float>
+                            {
+                                Caption = "Slider",
+                                Current = new BindableFloat
+                                {
+                                    MinValue = 0,
+                                    MaxValue = 10,
+                                    Value = 5,
+                                    Precision = 0.1f,
+                                    Disabled = true,
+                                },
+                                TransferValueOnCommit = true,
+                                TabbableContentContainer = this,
+                            },
                             new FormEnumDropdown<CountdownType>
                             {
                                 Caption = EditorSetupStrings.EnableCountdown,
CleanShot.2025-12-20.at.04.56.44.mp4

Copy link
Copy Markdown
Member

@frenzibyte frenzibyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L type/behavioural An issue with actual UI or game behaviour. Has a real world impact causing something to not work.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants