diff --git a/cockatrice/src/game_graphics/board/abstract_card_item.cpp b/cockatrice/src/game_graphics/board/abstract_card_item.cpp index f7ae1ff71..f2c0966e4 100644 --- a/cockatrice/src/game_graphics/board/abstract_card_item.cpp +++ b/cockatrice/src/game_graphics/board/abstract_card_item.cpp @@ -48,8 +48,8 @@ class QSizeF; // Width the hovered card smooth-zooms to: exactly the hover panel picture size, so // all four corners coincide when the panel swaps in over it. static constexpr qreal HOVER_ZOOM_WIDTH = 270.0; -// The pre-panel hover enlargement. The smooth zoom is opt-in, so this stays the hover -// behavior whenever no zoom trigger is configured (see setHoverHighlighted). +// The pre-panel hover enlargement. This stays the hover behavior when the smooth zoom is +// turned off (see setHoverHighlighted). static constexpr qreal LEGACY_HOVER_SCALE = 1.1; static constexpr int HOVER_ZOOM_IN_MS = 220; static constexpr int HOVER_ZOOM_OUT_MS = 140; @@ -356,11 +356,9 @@ void AbstractCardItem::setHoverHighlighted(bool highlighted) setZValue(ZValues::HOVERED_CARD); } - // Fallback to the historical hover scale: the smooth hover zoom is opt-in and its - // trigger defaults to Off, so when hovering drives neither the zoom nor the panel - // (zoom trigger Off, panel not on hover) contact alone must still enlarge the card - // to the old 1.1x while scaleCards is on. Otherwise every existing user silently - // loses the hover enlargement on upgrade. + // Fallback to the historical hover scale when the smooth hover zoom is turned off and + // the panel is not driven by hover: contact alone must still enlarge the card to the + // old 1.1x while scaleCards is on. auto &display = SettingsCache::instance().cardsDisplay(); const bool legacyHoverScale = display.getScaleCards() && display.getHoverZoomTrigger() == CardsDisplaySettings::HoverPanelTriggerOff && diff --git a/libcockatrice_settings/libcockatrice/settings/cards_display_settings.cpp b/libcockatrice_settings/libcockatrice/settings/cards_display_settings.cpp index 910e3f09d..bdd494646 100644 --- a/libcockatrice_settings/libcockatrice/settings/cards_display_settings.cpp +++ b/libcockatrice_settings/libcockatrice/settings/cards_display_settings.cpp @@ -70,16 +70,14 @@ bool CardsDisplaySettings::getScaleCards() const int CardsDisplaySettings::getHoverPanelTrigger() const { - // Off by default: the panel is new, so it is opt-in. - return getValue("hoverPanelTrigger", QString(), QString(), static_cast(HoverPanelTriggerOff)).toInt(); + return getValue("hoverPanelTrigger", QString(), QString(), static_cast(HoverPanelTriggerHover)).toInt(); } int CardsDisplaySettings::getHoverZoomTrigger() const { - // Off by default: the smooth hover zoom is opt-in. With no trigger configured, - // hovering keeps the historical 1.1x scale (AbstractCardItem::setHoverHighlighted) - // instead of the smooth zoom to the hover panel size. - return getValue("hoverZoomTrigger", QString(), QString(), static_cast(HoverPanelTriggerOff)).toInt(); + // Hover is the default: hovering first zooms the card, then the tab panel shows up. + // Either trigger can still be changed or turned off in the interface settings. + return getValue("hoverZoomTrigger", QString(), QString(), static_cast(HoverPanelTriggerHover)).toInt(); } bool CardsDisplaySettings::getHoverPanelDoubleConfirm() const diff --git a/libcockatrice_settings/libcockatrice/settings/cards_display_settings.h b/libcockatrice_settings/libcockatrice/settings/cards_display_settings.h index 59a513e8f..d8ced83a4 100644 --- a/libcockatrice_settings/libcockatrice/settings/cards_display_settings.h +++ b/libcockatrice_settings/libcockatrice/settings/cards_display_settings.h @@ -23,7 +23,7 @@ public: HoverPanelTriggerRightClick = 1, HoverPanelTriggerWheel = 2, HoverPanelTriggerShortcut = 3, - /// Never fires. The hover zoom and panel are opt-in, so this is their default. + /// Never fires when selected; lets the user turn the hover zoom and panel off. HoverPanelTriggerOff = 4 }; diff --git a/tests/settings/settings_defaults_test.cpp b/tests/settings/settings_defaults_test.cpp index 4ca440567..acffae9a8 100644 --- a/tests/settings/settings_defaults_test.cpp +++ b/tests/settings/settings_defaults_test.cpp @@ -686,8 +686,7 @@ TEST_F(SettingsDefaultsTest, CardsDisplay_ArrowDrawAnimation_Default) TEST_F(SettingsDefaultsTest, CardsDisplay_HoverPanelTrigger_Default) { CardsDisplaySettings s(settingsPath, nullptr); - // Off by default: the panel is opt-in on upgrade. - ASSERT_EQ(s.getHoverPanelTrigger(), CardsDisplaySettings::HoverPanelTriggerOff); + ASSERT_EQ(s.getHoverPanelTrigger(), CardsDisplaySettings::HoverPanelTriggerHover); } TEST_F(SettingsDefaultsTest, CardsDisplay_HoverPanelTrigger_SetAndGet) @@ -702,8 +701,7 @@ TEST_F(SettingsDefaultsTest, CardsDisplay_HoverPanelTrigger_SetAndGet) TEST_F(SettingsDefaultsTest, CardsDisplay_HoverZoomTrigger_Default) { CardsDisplaySettings s(settingsPath, nullptr); - // Off by default: the smooth hover zoom is opt-in on upgrade. - ASSERT_EQ(s.getHoverZoomTrigger(), CardsDisplaySettings::HoverPanelTriggerOff); + ASSERT_EQ(s.getHoverZoomTrigger(), CardsDisplaySettings::HoverPanelTriggerHover); } TEST_F(SettingsDefaultsTest, CardsDisplay_HoverZoomTrigger_SetAndGet)