Skip to content

Commit

Permalink
simply definition
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Dec 17, 2024
1 parent 01a3722 commit e4b07a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
12 changes: 8 additions & 4 deletions src/DrawingWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,16 @@ int curEventButtons = 0;

DrawingWidget::DrawingWidget(QWidget *parent): QWidget(parent) {
initializeImage(size());
penType = PEN;
penSize[PEN] = get_int((char*)"pen-size");
penSize[ERASER] = get_int((char*)"eraser-size");
penSize[MARKER] = get_int((char*)"marker-size");
penType=PEN;
penStyle=SPLINE;
lineStyle=NORMAL;
penColor = QColor(get_string((char*)"color"));
penMode = DRAW;
reset = true;
setMouseTracking(true);
setAttribute(Qt::WA_AcceptTouchEvents);
cropWidget = new MovableWidget(mainWindow);
cropWidget->stackUnder(this);
QBoxLayout* cropLayout = new QVBoxLayout(cropWidget);
Expand All @@ -301,8 +307,6 @@ DrawingWidget::DrawingWidget(QWidget *parent): QWidget(parent) {
fpressure = get_int((char*)"pressure") / 100.0;
}

DrawingWidget::~DrawingWidget() {}

void DrawingWidget::addPoint(int id, QPointF data) {
if(geo.size(id) == 0) {
geo.saveValue(id, 0, data);
Expand Down
2 changes: 0 additions & 2 deletions src/DrawingWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,12 @@ class GeometryStorage {
class DrawingWidget : public QWidget {
public:
explicit DrawingWidget(QWidget *parent = nullptr);
~DrawingWidget(); // Destructor

QImage image;
QColor penColor;
FloatingSettings* floatingSettings;
MovableWidget* cropWidget;
int penSize[3];
bool reset;
void initializeImage(const QSize &size);
void goPrevious();
void goNext();
Expand Down
8 changes: 1 addition & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,13 @@ int main(int argc, char *argv[]) {
scale = QGuiApplication::primaryScreen()->geometry().height() / 1080.0;

mainWidget = new QWidget(mainWindow);
mainWidget->setAttribute(Qt::WA_AcceptTouchEvents, true);

board = new WhiteBoard(mainWidget);
board->setType(get_int((char*)"page"));
board->setOverlayType(get_int((char*)"page-overlay"));

drawing = new DrawingWidget(mainWidget);
drawing->penSize[PEN] = get_int((char*)"pen-size");
drawing->penSize[ERASER] = get_int((char*)"eraser-size");
drawing->penSize[MARKER] = get_int((char*)"marker-size");
drawing->penType=PEN;
drawing->penStyle=SPLINE;
drawing->lineStyle=NORMAL;
drawing->penColor = QColor(get_string((char*)"color"));

mainWindow->setWindowIcon(QIcon(":tr.org.pardus.pen.svg"));
mainWindow->setWindowTitle(QString(_("Pardus Pen")));
Expand Down

0 comments on commit e4b07a0

Please sign in to comment.