mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 19:13:25 -08:00
[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:
parent
b1c8f156dc
commit
40ebd22549
7 changed files with 388 additions and 21 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue