From 8aebe404e333bb20f34e0a0a25af245bb2216536 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 19 Jan 2023 19:00:18 +0200 Subject: [PATCH] Fix status bar activation via click --- client/widgets/TextControls.cpp | 6 +++++- client/widgets/TextControls.h | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/widgets/TextControls.cpp b/client/widgets/TextControls.cpp index 4fb9d1093..5ea3a96ca 100644 --- a/client/widgets/TextControls.cpp +++ b/client/widgets/TextControls.cpp @@ -392,6 +392,8 @@ CGStatusBar::CGStatusBar(std::shared_ptr background_, EFonts Font, ETe : CLabel(background_->pos.x, background_->pos.y, Font, Align, Color, "") , enteringText(false) { + addUsedEvents(LCLICK); + background = background_; addChild(background.get()); pos = background->pos; @@ -403,6 +405,8 @@ CGStatusBar::CGStatusBar(int x, int y, std::string name, int maxw) : CLabel(x, y, FONT_SMALL, ETextAlignment::CENTER) , enteringText(false) { + addUsedEvents(LCLICK); + OBJECT_CONSTRUCTION_CAPTURING(255 - DISPOSE); background = std::make_shared(name); pos = background->pos; @@ -428,7 +432,7 @@ void CGStatusBar::init() void CGStatusBar::clickLeft(tribool down, bool previousState) { - if(!down && onClick) + if(!down) { if(LOCPLINT && LOCPLINT->cingconsole->active) LOCPLINT->cingconsole->startEnteringText(); diff --git a/client/widgets/TextControls.h b/client/widgets/TextControls.h index 49189eaa8..70092d0f8 100644 --- a/client/widgets/TextControls.h +++ b/client/widgets/TextControls.h @@ -137,9 +137,6 @@ protected: void clickLeft(tribool down, bool previousState) override; -private: - std::function onClick; - public: template static std::shared_ptr create(Args... args)