Make status-bar volume slider clickable and focus-independent#12
Merged
Conversation
The volume control used Nuklear's nk_slide_float, which only changes value while dragging its small knob (track clicks are ignored, and at full volume the knob is jammed against the right edge, nearly impossible to grab). It also went read-only whenever the status-bar window was not the top window, e.g. while a dialog was open, since nk_slider_float honors NK_WINDOW_ROM. The neighboring mute icon kept working because it polls ctx.input directly, producing the "icon works but slider doesn't" symptom. Replace it with a hand-drawn track hit-tested via ctx.input, mirroring the mute icon: a click or drag anywhere along the bar sets the level, drag keeps tracking once started in the cell, and the control is unaffected by window focus/ROM state. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ステータスバーの音量スライダーが操作できない問題を修正しました。
原因は2つ重なっていました。
nk_slide_floatは小さなツマミを掴んでドラッグしている間しか値が変わらない仕様で、レールのクリックは無反応。さらに音量100(既定値)ではツマミがセル右端に張り付き、ほぼ掴めない。nk_slide_floatはNK_WINDOW_ROMを尊重するため、ステータスバーが最前面でない(ダイアログ表示中など)と入力が無効化される。隣のミュートアイコンはctx.inputを直接読むため動き続け、「アイコンは効くがスライダーだけ効かない」状態になっていた。修正として、ミュートアイコンと同じく
ctx.inputを直接ポーリングする自前トラックに置き換えました。nk_input_has_mouse_click_down_in_rectでセル内開始の押下のみ拾うため、縦に少しずれても掴み続けられるctx.input直読みのためウィンドウのフォーカス/ROM 状態の影響を受けないTest plan
zig buildがエラーなく通る