Skip to content

Commit

Permalink
Introduce MatrixView class
Browse files Browse the repository at this point in the history
  • Loading branch information
messmerd committed Aug 17, 2024
1 parent c98353f commit 774e3b6
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 132 deletions.
14 changes: 6 additions & 8 deletions include/PluginPinConnectorView.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace lmms
{

class BoolModel;
class PluginPinConnector;

namespace gui
{
Expand All @@ -53,7 +54,7 @@ class LMMS_EXPORT PluginPinConnectorView
Q_OBJECT

public:
PluginPinConnectorView(QWidget* parent);
PluginPinConnectorView(PluginPinConnector* model, QWidget* parent);

auto sizeHint() const -> QSize override;

Expand All @@ -63,14 +64,13 @@ public slots:
void update();

protected:
void mousePressEvent(QMouseEvent* me) override;
void paintEvent(QPaintEvent* pe) override;

private:
class MatrixView;

void updateGeometry();
void updatePositions();
auto calculateMatrixSize(bool inMatrix) const -> QSize;
auto getIcon(const BoolModel& model, int trackChannel, int pluginChannel) -> const QPixmap&;

SubWindow* m_subWindow = nullptr;
QScrollArea* m_scrollArea = nullptr;
Expand All @@ -80,10 +80,8 @@ public slots:
QRect m_outRect;
QSize m_minSize;

QPixmap m_buttonOffBlack = embed::getIconPixmap("step_btn_off");
QPixmap m_buttonOffGray = embed::getIconPixmap("step_btn_off_light");
//QPixmap m_buttonOn0 = embed::getIconPixmap("step_btn_on_0");
QPixmap m_buttonOn = embed::getIconPixmap("step_btn_on_200");
MatrixView* m_inView = nullptr;
MatrixView* m_outView = nullptr;
};

} // namespace gui
Expand Down
11 changes: 1 addition & 10 deletions src/core/PluginPinConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,16 +487,7 @@ void PluginPinConnector::setChannelCount(int newCount, Matrix& matrix)

auto PluginPinConnector::instantiateView(QWidget* parent) -> gui::PluginPinConnectorView*
{
auto view = new gui::PluginPinConnectorView{parent};
view->setModel(this);

connect(this, &PluginPinConnector::dataChanged, view, &gui::PluginPinConnectorView::update);
connect(this, &PluginPinConnector::propertiesChanged, view, &gui::PluginPinConnectorView::update);
view->update();
//view->toggleVisibility();
view->show();

return view;
return new gui::PluginPinConnectorView{this, parent};
}

auto PluginPinConnector::getChannelCountText() const -> QString
Expand Down
Loading

0 comments on commit 774e3b6

Please sign in to comment.