mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fix status bar activation via click
This commit is contained in:
		| @@ -392,6 +392,8 @@ CGStatusBar::CGStatusBar(std::shared_ptr<CPicture> 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<CPicture>(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(); | ||||
|   | ||||
| @@ -137,9 +137,6 @@ protected: | ||||
|  | ||||
| 	void clickLeft(tribool down, bool previousState) override; | ||||
|  | ||||
| private: | ||||
| 	std::function<void()> onClick; | ||||
|  | ||||
| public: | ||||
| 	template<typename ...Args> | ||||
| 	static std::shared_ptr<CGStatusBar> create(Args... args) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user