| 36 | namespace OpenOrienteering { |
| 37 | |
| 38 | PieMenu::PieMenu(QWidget* parent) |
| 39 | : QWidget(parent, Qt::Popup | Qt::FramelessWindowHint), // NOTE: use Qt::Window for debugging to avoid mouse grab |
| 40 | minimum_action_count(3), |
| 41 | icon_size(24), |
| 42 | active_action(nullptr), |
| 43 | actions_changed(true), |
| 44 | clicked(false) |
| 45 | { |
| 46 | setCursor(QCursor(Qt::ArrowCursor)); |
| 47 | setAttribute(Qt::WA_OpaquePaintEvent); |
| 48 | setAttribute(Qt::WA_ShowWithoutActivating); |
| 49 | setAutoFillBackground(false); |
| 50 | setMouseTracking(true); |
| 51 | |
| 52 | auto scale = Settings::getInstance().getSetting(Settings::General_PixelsPerInch).toReal() / 96.0; |
| 53 | if (scale > 1.5) |
| 54 | { |
| 55 | icon_size = qRound(icon_size * scale); |
| 56 | } |
| 57 | |
| 58 | updateCachedState(); |
| 59 | } |
| 60 | |
| 61 | int PieMenu::minimumActionCount() const |
| 62 | { |
nothing calls this directly
no test coverage detected