Skip to content

Commit 87c4fd3

Browse files
sp00ktoberclaude
andcommitted
fix(studio): the header's buttons keep their size while the watch status is empty
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 69a6096 commit 87c4fd3

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎apps/studio/src/mhfu_studio/monster/panels/behaviour.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,6 @@ def _marks(self) -> None:
515515
def _status(self) -> None:
516516
"""The header's words on the watch, and the outline's totals."""
517517
w = self.ws.watch
518-
self.live.setVisible(w.on)
519518
self.live.setText(w.status)
520519
self.live.setToolTip(w.status)
521520
self.live.set_level(None if w.fires is not None else "warning")

‎apps/studio/tests/monster/ui/test_marks.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ def scope(qtbot: Any, p: BehaviourPanel, key: str) -> None:
138138

139139

140140
def test_nothing_is_marked_until_the_toggle_is_on(panel: BehaviourPanel, game: Game) -> None:
141-
assert not panel.watch.isChecked() and panel.live.isHidden() and not panel.ticker.isActive()
141+
assert not panel.watch.isChecked() and panel.live.text() == ""
142+
assert not panel.ticker.isActive()
142143
assert all("×" not in t for t in titles(panel))
143144
assert panel.outline.width() == triggers.WIDTH and game.calls == []
145+
assert panel.fit.width() <= panel.fit.sizeHint().width() + 4, "the buttons keep their size"
144146
assert panel.watch.toolTip() and kit.missing_tips(panel) == []
145147

146148

@@ -149,13 +151,13 @@ def test_the_toggle_starts_a_poll_once_a_second_while_the_tab_is_shown(
149151
) -> None:
150152
QTest.mouseClick(panel.watch, LEFT, NONE)
151153
assert panel.ws.watch.on and panel.ticker.isActive() and panel.ticker.interval() == 1000
152-
assert not panel.live.isHidden()
154+
assert panel.live.text() == rg.READING
153155
panel.hide()
154156
assert not panel.ticker.isActive()
155157
panel.show()
156158
assert panel.ticker.isActive()
157159
QTest.mouseClick(panel.watch, LEFT, NONE)
158-
assert not panel.ws.watch.on and not panel.ticker.isActive() and panel.live.isHidden()
160+
assert not panel.ws.watch.on and not panel.ticker.isActive() and panel.live.text() == ""
159161

160162

161163
def test_a_tab_hidden_polls_nothing(

0 commit comments

Comments
 (0)