[Lobby] Add instant quick host to the game room (#7802)

* Add instant quick host to the game lobby

* Use a native pull-down on macOS and a split button elsewhere

- Gate on the active application style instead of the platform, so
  choosing Fusion on macOS still gets the split button: QMacStyle ignores
  autoRaise/flat and draws a QToolButton menu as a separate square.
- Rebuild the host control on QEvent::StyleChange, because the appearance
  settings switch styles while the room is open.
- Keep the review action, its arrow and the host button disabled while a
  host or join command is still in flight.
- Announce inline quick-host failures to screen readers.

* Address review findings

* Replace the macOS pull-down with a sibling settings button

QMacStyle has no split-button rendering: a menu-bearing QToolButton is drawn as a second square bezel. Keep the primary Host game button as the one-click quick host on every platform, and show a plain Game settings button as the secondary action on macOS instead; other styles keep the split arrow.

Rename the secondary action from "Review settings first..." to "Game settings..." so the label says what it opens, and update the shortcuts page label to match.
This commit is contained in:
BruebachL 2026-11-08 22:12:29 +01:00 • committed by GitHub
parent b1c8f156dc
commit 40ebd22549
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 388 additions and 21 deletions

View file

@ -185,6 +185,26 @@ TEST(GameCreationOptions, DescriptionWhitespaceIsSimplified)
EXPECT_EQ(cmd.description(), "a b");
}
TEST(GameCreationOptions, DefaultsForRegisteredHostEnforceRegistration)
{
const GameCreationOptions registered = GameCreationOptions::defaultsFor(true);
EXPECT_TRUE(registered.onlyRegistered);
EXPECT_FALSE(registered.onlyBuddies);
EXPECT_EQ(registered.maxPlayers, 2);
EXPECT_TRUE(registered.spectatorsAllowed);
EXPECT_EQ(registered.startingLifeTotal, 20);
EXPECT_TRUE(registered.gameTypeIds.isEmpty());
}
TEST(GameCreationOptions, DefaultsForUnregisteredHostAllowOpenJoining)
{
const GameCreationOptions unregistered = GameCreationOptions::defaultsFor(false);
EXPECT_FALSE(unregistered.onlyRegistered);
EXPECT_FALSE(unregistered.onlyBuddies);
}
TEST(GameCreationOptions, FromSettingsCopiesEveryRememberedField)
{
const FakeGameSettings settings{GameCreationOptions{.description = "Remembered game",