2025-01-03 23:27:19 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <widgets/container_widget.hpp>
|
2025-01-10 01:38:58 +00:00
|
|
|
#include "ScenarioComponent.hpp"
|
2025-01-03 23:27:19 +00:00
|
|
|
|
|
|
|
namespace Hardware
|
|
|
|
{
|
2025-01-13 18:49:21 +00:00
|
|
|
struct StateWidget final : QObject
|
|
|
|
, ScenarioComponentSpec<Scenario::StateModel>
|
2025-01-03 23:27:19 +00:00
|
|
|
{
|
|
|
|
explicit StateWidget(Scenario::StateModel& state,
|
2025-01-11 11:56:26 +00:00
|
|
|
ScenarioWidget* scenario,
|
2025-01-10 01:38:58 +00:00
|
|
|
bugui::container_widget* parent);
|
2025-01-03 23:27:19 +00:00
|
|
|
|
2025-01-13 18:49:21 +00:00
|
|
|
~StateWidget() override;
|
2025-01-03 23:27:19 +00:00
|
|
|
|
|
|
|
int y() const override;
|
|
|
|
|
2025-01-13 18:49:21 +00:00
|
|
|
private:
|
|
|
|
W_OBJECT(StateWidget)
|
|
|
|
|
2025-01-14 00:04:35 +00:00
|
|
|
void paint(bugui::painter& painter) const override;
|
|
|
|
|
2025-01-03 23:27:19 +00:00
|
|
|
bool contains(int px, int py) const override;
|
2025-01-13 18:49:21 +00:00
|
|
|
|
|
|
|
void on_press(int x, int y, bool pressed) override;
|
|
|
|
void on_double_press(int x, int y) override;
|
|
|
|
void on_drag(int from_x, int from_y, int to_x, int to_y) override;
|
2025-01-03 23:27:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} //namespace Hardware
|