PatTheMav 3bbda4803e
frontend: Add renamed Qt UI components
This commit only contains Qt UI components that are self-contained,
i.e. the translation units only contain code for a single class or
interface and don't mix implementations.
2025-01-08 15:36:54 +01:00

26 lines
537 B
C++

#include "FocusList.hpp"
#include <QDragMoveEvent>
#include "moc_FocusList.cpp"
FocusList::FocusList(QWidget *parent) : QListWidget(parent) {}
void FocusList::focusInEvent(QFocusEvent *event)
{
QListWidget::focusInEvent(event);
emit GotFocus();
}
void FocusList::dragMoveEvent(QDragMoveEvent *event)
{
QPoint pos = event->position().toPoint();
int itemRow = row(itemAt(pos));
if ((itemRow == currentRow() + 1) || (currentRow() == count() - 1 && itemRow == -1))
event->ignore();
else
QListWidget::dragMoveEvent(event);
}