Tidied structure of all classes within the entire code base
Also some other small bits of tidying
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#include <QPainter>
|
||||
|
||||
#include "BodyWidget.hpp"
|
||||
#include "src/Logger/Logger.hpp"
|
||||
|
||||
#include <QPainter>
|
||||
|
||||
using namespace Bloom::Widgets::InsightTargetWidgets::Qfp;
|
||||
|
||||
|
||||
@@ -6,18 +6,9 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
{
|
||||
class BodyWidget: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QColor bodyColor READ getBodyColor WRITE setBodyColor DESIGNABLE true)
|
||||
Q_PROPERTY(int disableAlphaLevel READ getDisableAlphaLevel WRITE setDisableAlphaLevel DESIGNABLE true)
|
||||
|
||||
private:
|
||||
// These properties can be modified via Qt style sheets (see Stylesheets/QuadFlatPackage.qss)
|
||||
QColor bodyColor = QColor("#8E8B83");
|
||||
int disableAlphaLevel = 100;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
void drawWidget(QPainter& painter);
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QColor bodyColor READ getBodyColor WRITE setBodyColor DESIGNABLE true)
|
||||
Q_PROPERTY(int disableAlphaLevel READ getDisableAlphaLevel WRITE setDisableAlphaLevel DESIGNABLE true)
|
||||
|
||||
public:
|
||||
explicit BodyWidget(QWidget* parent): QWidget(parent) {
|
||||
@@ -39,5 +30,14 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
void setDisableAlphaLevel(int level) {
|
||||
this->disableAlphaLevel = level;
|
||||
}
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
void drawWidget(QPainter& painter);
|
||||
|
||||
private:
|
||||
// These properties can be modified via Qt style sheets (see Stylesheets/QuadFlatPackage.qss)
|
||||
QColor bodyColor = QColor("#8E8B83");
|
||||
int disableAlphaLevel = 100;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "PinBodyWidget.hpp"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QEvent>
|
||||
|
||||
#include "PinBodyWidget.hpp"
|
||||
|
||||
using namespace Bloom::Widgets::InsightTargetWidgets::Qfp;
|
||||
using namespace Bloom::Targets;
|
||||
|
||||
|
||||
@@ -5,18 +5,14 @@
|
||||
#include <utility>
|
||||
|
||||
#include "../TargetPinBodyWidget.hpp"
|
||||
|
||||
#include "src/Targets/TargetPinDescriptor.hpp"
|
||||
|
||||
namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
{
|
||||
class PinBodyWidget: public TargetPinBodyWidget
|
||||
{
|
||||
private:
|
||||
bool isVertical = false;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
void drawWidget(QPainter& painter);
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static const int WIDTH = 30;
|
||||
@@ -33,5 +29,12 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
this->setFixedSize(PinBodyWidget::HEIGHT, PinBodyWidget::WIDTH);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
void drawWidget(QPainter& painter);
|
||||
|
||||
private:
|
||||
bool isVertical = false;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "PinWidget.hpp"
|
||||
#include "PinBodyWidget.hpp"
|
||||
#include "src/Logger/Logger.hpp"
|
||||
|
||||
using namespace Bloom::Widgets::InsightTargetWidgets::Qfp;
|
||||
using namespace Bloom::Targets;
|
||||
|
||||
@@ -12,20 +12,7 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
{
|
||||
class PinWidget: public TargetPinWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QBoxLayout* layout = nullptr;
|
||||
QLabel* pinNumberLabel = nullptr;
|
||||
QLabel* pinNameLabel = nullptr;
|
||||
QLabel* pinDirectionLabel = nullptr;
|
||||
PinBodyWidget* bodyWidget = nullptr;
|
||||
|
||||
bool isLeftLayout = false;
|
||||
bool isBottomLayout = false;
|
||||
bool isRightLayout = false;
|
||||
bool isTopLayout = false;
|
||||
|
||||
void setLabelColor(const QString& hexColor);
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static const int PIN_WIDGET_LAYOUT_PADDING = 46;
|
||||
@@ -49,5 +36,19 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
);
|
||||
|
||||
void updatePinState(const Targets::TargetPinState& pinState) override;
|
||||
|
||||
private:
|
||||
QBoxLayout* layout = nullptr;
|
||||
QLabel* pinNumberLabel = nullptr;
|
||||
QLabel* pinNameLabel = nullptr;
|
||||
QLabel* pinDirectionLabel = nullptr;
|
||||
PinBodyWidget* bodyWidget = nullptr;
|
||||
|
||||
bool isLeftLayout = false;
|
||||
bool isBottomLayout = false;
|
||||
bool isRightLayout = false;
|
||||
bool isTopLayout = false;
|
||||
|
||||
void setLabelColor(const QString& hexColor);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <QEvent>
|
||||
#include <QFile>
|
||||
|
||||
#include "../../../InsightWindow.hpp"
|
||||
#include "src/Helpers/Paths.hpp"
|
||||
#include "PinWidget.hpp"
|
||||
#include "BodyWidget.hpp"
|
||||
|
||||
@@ -17,7 +17,15 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
*/
|
||||
class QuadFlatPackageWidget: public TargetPackageWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QuadFlatPackageWidget(
|
||||
const Targets::TargetVariant& targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
);
|
||||
|
||||
private:
|
||||
QVBoxLayout* layout = nullptr;
|
||||
QHBoxLayout* horizontalLayout = nullptr;
|
||||
@@ -26,12 +34,5 @@ namespace Bloom::Widgets::InsightTargetWidgets::Qfp
|
||||
QHBoxLayout* bottomPinLayout = nullptr;
|
||||
QVBoxLayout* leftPinLayout = nullptr;
|
||||
BodyWidget* bodyWidget = nullptr;
|
||||
|
||||
public:
|
||||
QuadFlatPackageWidget(
|
||||
const Targets::TargetVariant& targetVariant,
|
||||
InsightWorker& insightWorker,
|
||||
QWidget* parent
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user