From d03be7eba5b32ad79b9ffdacebcf5e6de1ab8fa9 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Sun, 19 Jan 2025 20:22:28 -0800 Subject: [PATCH] add comment --- .../src/client/ui/widgets/cards/card_info_frame_widget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cockatrice/src/client/ui/widgets/cards/card_info_frame_widget.cpp b/cockatrice/src/client/ui/widgets/cards/card_info_frame_widget.cpp index fb6075124..ab197b801 100644 --- a/cockatrice/src/client/ui/widgets/cards/card_info_frame_widget.cpp +++ b/cockatrice/src/client/ui/widgets/cards/card_info_frame_widget.cpp @@ -82,6 +82,11 @@ void CardInfoFrameWidget::setViewMode(int mode) if (currentIndex() != mode) setCurrentIndex(mode); + /* This weird code is to work around the following: + * - Widgets can only have one parent; adding an already-parented widget will cause the new parent to "steal" it + * from the old parent + * - Unparented widgets become freefloating, which we do not want + */ switch (mode) { case ImageOnlyView: case TextOnlyView: