Skip to content

Commit e4b07a0

Browse files
committed
simply definition
1 parent 01a3722 commit e4b07a0

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

src/DrawingWidget.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,16 @@ int curEventButtons = 0;
284284

285285
DrawingWidget::DrawingWidget(QWidget *parent): QWidget(parent) {
286286
initializeImage(size());
287-
penType = PEN;
287+
penSize[PEN] = get_int((char*)"pen-size");
288+
penSize[ERASER] = get_int((char*)"eraser-size");
289+
penSize[MARKER] = get_int((char*)"marker-size");
290+
penType=PEN;
291+
penStyle=SPLINE;
292+
lineStyle=NORMAL;
293+
penColor = QColor(get_string((char*)"color"));
288294
penMode = DRAW;
289-
reset = true;
290295
setMouseTracking(true);
296+
setAttribute(Qt::WA_AcceptTouchEvents);
291297
cropWidget = new MovableWidget(mainWindow);
292298
cropWidget->stackUnder(this);
293299
QBoxLayout* cropLayout = new QVBoxLayout(cropWidget);
@@ -301,8 +307,6 @@ DrawingWidget::DrawingWidget(QWidget *parent): QWidget(parent) {
301307
fpressure = get_int((char*)"pressure") / 100.0;
302308
}
303309

304-
DrawingWidget::~DrawingWidget() {}
305-
306310
void DrawingWidget::addPoint(int id, QPointF data) {
307311
if(geo.size(id) == 0) {
308312
geo.saveValue(id, 0, data);

src/DrawingWidget.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,12 @@ class GeometryStorage {
117117
class DrawingWidget : public QWidget {
118118
public:
119119
explicit DrawingWidget(QWidget *parent = nullptr);
120-
~DrawingWidget(); // Destructor
121120

122121
QImage image;
123122
QColor penColor;
124123
FloatingSettings* floatingSettings;
125124
MovableWidget* cropWidget;
126125
int penSize[3];
127-
bool reset;
128126
void initializeImage(const QSize &size);
129127
void goPrevious();
130128
void goNext();

src/main.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,19 +192,13 @@ int main(int argc, char *argv[]) {
192192
scale = QGuiApplication::primaryScreen()->geometry().height() / 1080.0;
193193

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

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

200201
drawing = new DrawingWidget(mainWidget);
201-
drawing->penSize[PEN] = get_int((char*)"pen-size");
202-
drawing->penSize[ERASER] = get_int((char*)"eraser-size");
203-
drawing->penSize[MARKER] = get_int((char*)"marker-size");
204-
drawing->penType=PEN;
205-
drawing->penStyle=SPLINE;
206-
drawing->lineStyle=NORMAL;
207-
drawing->penColor = QColor(get_string((char*)"color"));
208202

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

0 commit comments

Comments
 (0)