feat: show drag cursor

This commit is contained in:
talksik
2026-01-29 08:33:43 -08:00
parent 62c262e0a9
commit 20dd1e3a67
+5
View File
@@ -27,6 +27,9 @@ MainWindow::MainWindow(QWidget *parent)
ui = new Ui::MainWindow;
ui->setupUi(this);
QWidget *topBar = ui->widget;
topBar->setCursor(Qt::OpenHandCursor);
// Enable frameless window for edge-to-edge experience
setWindowFlags(Qt::FramelessWindowHint | Qt::Window);
setAttribute(Qt::WA_TranslucentBackground, false);
@@ -373,6 +376,7 @@ void MainWindow::mousePressEvent(QMouseEvent *event)
if (topBar && topBar->geometry().contains(event->pos()))
{
m_isDragging = true;
setCursor(Qt::ClosedHandCursor);
m_dragPosition = event->globalPosition().toPoint() - frameGeometry().topLeft();
event->accept();
return;
@@ -397,6 +401,7 @@ void MainWindow::mouseReleaseEvent(QMouseEvent *event)
if (event->button() == Qt::LeftButton)
{
m_isDragging = false;
unsetCursor();
}
QMainWindow::mouseReleaseEvent(event);
}