mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Issue #112 Hotkeys to zoom in/out radar
This commit is contained in:
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
#include "blackgui/enablefordockwidgetinfoarea.h"
|
#include "blackgui/enablefordockwidgetinfoarea.h"
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
|
#include "blackcore/actionbind.h"
|
||||||
|
#include "blackmisc/input/actionhotkeydefs.h"
|
||||||
|
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QGraphicsItemGroup>
|
#include <QGraphicsItemGroup>
|
||||||
@@ -75,6 +77,11 @@ namespace BlackGui
|
|||||||
int m_rotatenAngle = 0;
|
int m_rotatenAngle = 0;
|
||||||
QTimer m_updateTimer;
|
QTimer m_updateTimer;
|
||||||
QTimer m_headingTimer;
|
QTimer m_headingTimer;
|
||||||
|
|
||||||
|
BlackCore::CActionBind m_actionZoomIn { BlackMisc::Input::radarZoomInHotkeyAction(), BlackMisc::Input::radarZoomInHotkeyIcon(), this, &CRadarComponent::rangeZoomIn };
|
||||||
|
BlackCore::CActionBind m_actionZoomOut { BlackMisc::Input::radarZoomOutHotkeyAction(), BlackMisc::Input::radarZoomOutHotkeyIcon(), this, &CRadarComponent::rangeZoomOut };
|
||||||
|
void rangeZoomIn (bool keydown) { if (keydown) { changeRangeInSteps(true); } }
|
||||||
|
void rangeZoomOut(bool keydown) { if (keydown) { changeRangeInSteps(false); } }
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -255,6 +255,8 @@ namespace BlackMisc
|
|||||||
CIcon(CIcons::StandardIconWarning16, "warning"),
|
CIcon(CIcons::StandardIconWarning16, "warning"),
|
||||||
CIcon(CIcons::StandardIconWeatherCloudy16, "cloudy"),
|
CIcon(CIcons::StandardIconWeatherCloudy16, "cloudy"),
|
||||||
CIcon(CIcons::StandardIconWrench16, "wrench"),
|
CIcon(CIcons::StandardIconWrench16, "wrench"),
|
||||||
|
CIcon(CIcons::StandardIconZoomIn16, "zoom in"),
|
||||||
|
CIcon(CIcons::StandardIconZoomOut16, "zoom out"),
|
||||||
CIcon(CIcons::StandardIconBuilding16, "building"),
|
CIcon(CIcons::StandardIconBuilding16, "building"),
|
||||||
CIcon(CIcons::Swift16, "swift"),
|
CIcon(CIcons::Swift16, "swift"),
|
||||||
CIcon(CIcons::Swift24, "swift"),
|
CIcon(CIcons::Swift24, "swift"),
|
||||||
|
|||||||
@@ -413,6 +413,18 @@ namespace BlackMisc
|
|||||||
return pm;
|
return pm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QPixmap & CIcons::zoomIn16()
|
||||||
|
{
|
||||||
|
static const QPixmap pm(":/diagona/icons/diagona/icons/magnifier-zoom-in.png");
|
||||||
|
return pm;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QPixmap & CIcons::zoomOut16()
|
||||||
|
{
|
||||||
|
static const QPixmap pm(":/diagona/icons/diagona/icons/magnifier-zoom-out.png");
|
||||||
|
return pm;
|
||||||
|
}
|
||||||
|
|
||||||
const QPixmap &CIcons::building16()
|
const QPixmap &CIcons::building16()
|
||||||
{
|
{
|
||||||
static const QPixmap pm(":/diagona/icons/diagona/icons/building.png");
|
static const QPixmap pm(":/diagona/icons/diagona/icons/building.png");
|
||||||
|
|||||||
@@ -188,6 +188,8 @@ namespace BlackMisc
|
|||||||
StandardIconWarning16,
|
StandardIconWarning16,
|
||||||
StandardIconWeatherCloudy16,
|
StandardIconWeatherCloudy16,
|
||||||
StandardIconWrench16,
|
StandardIconWrench16,
|
||||||
|
StandardIconZoomIn16,
|
||||||
|
StandardIconZoomOut16,
|
||||||
StandardIconBuilding16,
|
StandardIconBuilding16,
|
||||||
Swift16,
|
Swift16,
|
||||||
Swift24,
|
Swift24,
|
||||||
@@ -436,6 +438,12 @@ namespace BlackMisc
|
|||||||
//! Cut
|
//! Cut
|
||||||
static const QPixmap &cut16();
|
static const QPixmap &cut16();
|
||||||
|
|
||||||
|
//! Zoom in
|
||||||
|
static const QPixmap &zoomIn16();
|
||||||
|
|
||||||
|
//! Zoom out
|
||||||
|
static const QPixmap &zoomOut16();
|
||||||
|
|
||||||
//! Building
|
//! Building
|
||||||
static const QPixmap &building16();
|
static const QPixmap &building16();
|
||||||
|
|
||||||
|
|||||||
@@ -79,5 +79,27 @@ namespace BlackMisc
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString &radarZoomInHotkeyAction()
|
||||||
|
{
|
||||||
|
static const QString s("/Radar/Zoom in");
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
CIcons::IconIndex radarZoomInHotkeyIcon()
|
||||||
|
{
|
||||||
|
return CIcons::StandardIconZoomIn16;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &radarZoomOutHotkeyAction()
|
||||||
|
{
|
||||||
|
static const QString s("/Radar/Zoom out");
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
CIcons::IconIndex radarZoomOutHotkeyIcon()
|
||||||
|
{
|
||||||
|
return CIcons::StandardIconZoomOut16;
|
||||||
|
}
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -56,6 +56,18 @@ namespace BlackMisc
|
|||||||
//! XPDR ident
|
//! XPDR ident
|
||||||
BLACKMISC_EXPORT BlackMisc::CIcons::IconIndex toggleXPDRIdentHotkeyIcon();
|
BLACKMISC_EXPORT BlackMisc::CIcons::IconIndex toggleXPDRIdentHotkeyIcon();
|
||||||
|
|
||||||
|
//! Radar zoom in
|
||||||
|
BLACKMISC_EXPORT const QString &radarZoomInHotkeyAction();
|
||||||
|
|
||||||
|
//! Radar zoom in
|
||||||
|
BLACKMISC_EXPORT BlackMisc::CIcons::IconIndex radarZoomInHotkeyIcon();
|
||||||
|
|
||||||
|
//! Radar zoom out
|
||||||
|
BLACKMISC_EXPORT const QString &radarZoomOutHotkeyAction();
|
||||||
|
|
||||||
|
//! Radar zoom out
|
||||||
|
BLACKMISC_EXPORT BlackMisc::CIcons::IconIndex radarZoomOutHotkeyIcon();
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user