quill/qclickablelabel.cpp
Nicolas Mailloux 4a104522f5 Local library: Basic setup working
A local books database is maintained at `/data/onboard/.inkbox/LocalLibrary.db`. It contains compressed JSON read by the GUI.

URGENT TODO: Fix `*** Error in '/mnt/onboard/.adds/inkbox/inkbox-bin': double free or corruption (out): 0x00648708 ***` error whenever we try to delete localLibraryWidget
2022-06-25 20:12:50 -04:00

19 lines
602 B
C++

#include "qclickablelabel.h"
QClickableLabel::QClickableLabel(QWidget* parent, Qt::WindowFlags f)
: QLabel(parent) {
}
QClickableLabel::~QClickableLabel() {}
void QClickableLabel::mousePressEvent(QMouseEvent * event) {
emit clicked();
QClickableLabel::setStyleSheet("color: white; background-color: black; border-radius: 10px; padding: 10px");
}
void QClickableLabel::mouseReleaseEvent(QMouseEvent * event) {
emit unclicked();
emit bookID(objectName().toInt());
QClickableLabel::setStyleSheet("color: black; background-color: white; border-radius: 10px; padding: 10px");
}