1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

use Strg instead mouse pos

This commit is contained in:
Laserlicht
2024-08-09 22:49:05 +02:00
parent dc81426b5e
commit 9a9cc10ee7
3 changed files with 15 additions and 45 deletions

View File

@@ -29,9 +29,10 @@ class CList : public Scrollable
protected:
class CListItem : public CIntObject, public std::enable_shared_from_this<CListItem>
{
CList * parent;
std::shared_ptr<CIntObject> selection;
public:
CList * parent;
CListItem(CList * parent);
~CListItem();
@@ -55,9 +56,6 @@ protected:
private:
const size_t size;
//for selection\deselection
std::shared_ptr<CListItem> selected;
void select(std::shared_ptr<CListItem> which);
friend class CListItem;
@@ -81,6 +79,9 @@ protected:
void update();
public:
//for selection\deselection
std::shared_ptr<CListItem> selected;
/// functions that will be called when selection changes
CFunctionList<void()> onSelect;
@@ -128,7 +129,6 @@ class CHeroList : public CList
void open() override;
void showTooltip() override;
void gesture(bool on, const Point & initialPosition, const Point & finalPosition) override;
bool captureThisKey(EShortcut key) override;
void keyPressed(EShortcut key) override;
std::string getHoverText() override;
};
@@ -164,7 +164,6 @@ class CTownList : public CList
void open() override;
void showTooltip() override;
void gesture(bool on, const Point & initialPosition, const Point & finalPosition) override;
bool captureThisKey(EShortcut key) override;
void keyPressed(EShortcut key) override;
std::string getHoverText() override;
};