Remove mousebtn argument from action_open

This commit is contained in:
patrick96 2021-01-14 10:45:28 +01:00 committed by Patrick Ziegler
parent 8fcd514168
commit 7a569c4b98
5 changed files with 5 additions and 6 deletions

View File

@ -53,7 +53,7 @@ class renderer : public renderer_interface,
void change_alignment(const tags::context& ctxt) override;
void action_open(const tags::context& ctxt, mousebtn btn, tags::action_t id) override;
void action_open(const tags::context& ctxt, tags::action_t id) override;
void action_close(const tags::context& ctxt, tags::action_t id) override;
protected:

View File

@ -13,7 +13,7 @@ class renderer_interface {
virtual void render_text(const tags::context& ctxt, const string&& str) = 0;
virtual void change_alignment(const tags::context& ctxt) = 0;
virtual void action_open(const tags::context& ctxt, mousebtn btn, tags::action_t id) = 0;
virtual void action_open(const tags::context& ctxt, tags::action_t id) = 0;
virtual void action_close(const tags::context& ctxt, tags::action_t id) = 0;
protected:

View File

@ -706,8 +706,7 @@ void renderer::change_alignment(const tags::context& ctxt) {
}
}
void renderer::action_open(const tags::context&, mousebtn btn, tags::action_t id) {
assert(btn != mousebtn::NONE);
void renderer::action_open(const tags::context&, tags::action_t id) {
m_action_ctxt.set_start(id, m_blocks.at(m_align).x);
}

View File

@ -127,7 +127,7 @@ namespace tags {
renderer.action_close(*m_ctxt, id);
} else {
action_t id = m_action_ctxt.action_open(btn, std::move(cmd), m_ctxt->get_alignment());
renderer.action_open(*m_ctxt, btn, id);
renderer.action_open(*m_ctxt, id);
}
}

View File

@ -18,7 +18,7 @@ class MockRenderer : public renderer_interface {
MOCK_METHOD(void, render_offset, (const context& ctxt, int pixels), (override));
MOCK_METHOD(void, render_text, (const context& ctxt, const string&& str), (override));
MOCK_METHOD(void, change_alignment, (const context& ctxt), (override));
MOCK_METHOD(void, action_open, (const context& ctxt, mousebtn btn, action_t id), (override));
MOCK_METHOD(void, action_open, (const context& ctxt, action_t id), (override));
MOCK_METHOD(void, action_close, (const context& ctxt, action_t id), (override));
};