refactor everything

This commit is contained in:
Crylia
2024-07-27 05:16:25 +02:00
parent 7ff0f8b71a
commit 7d19d72bf1
54 changed files with 1259 additions and 680 deletions

47
src/view/NavigationButton.cpp Executable file
View File

@@ -0,0 +1,47 @@
#include "NavigationButton.hpp"
NavigationButton::NavigationButton(const QPixmap& icon, QWidget* parent) :
QPushButton(parent) {
setIcon(icon);
setMouseTracking(true);
}
void NavigationButton::enterEvent(QEnterEvent* event) {
QPushButton::enterEvent(event);
setStyleSheet(R"(
QPushButton{
background-color: #212121;
border: 2px solid #F48FB1;
font-size: 26px;
font-weight: 900;
color: #F48FB1;
border-radius: 8;
}
)");
}
void NavigationButton::leaveEvent(QEvent* event) {
QPushButton::leaveEvent(event);
setStyleSheet(R"(
QPushButton{
background-color: #212121;
border: 2px solid #414141;
font-size: 26px;
font-weight: 900;
color: #F48FB1;
border-radius: 8;
}
)");
}
void NavigationButton::mousePressEvent(QMouseEvent* event) {
if (event->button( ) == Qt::LeftButton) {
emit clicked( );
}
QPushButton::mousePressEvent(event);
}
void NavigationButton::setIcon(const QPixmap& icon) {
QPushButton::setIcon(icon);
}