Skip to content

Commit

Permalink
Upgrade to 1.1.4 & fix GPS map buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-spataru committed Dec 7, 2021
1 parent 136c3fd commit afd911f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
#--------------------------------------------------------------------------------

env:
VERSION: "1.1.3"
VERSION: "1.1.4"
EXECUTABLE: "SerialStudio"
APPLICATION: "Serial Studio"
UNIXNAME: "serial-studio"
Expand Down
2 changes: 1 addition & 1 deletion deploy/linux/serial-studio.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ StartupNotify=true
Categories=Electronics;Engineering;Science;
Icon=serial-studio
X-AppImage-Name=Serial Studio
X-AppImage-Version=1.1.3
X-AppImage-Version=1.1.4
X-AppImage-Arch=x86_64
2 changes: 1 addition & 1 deletion deploy/macOS/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>1.1.4</string>
<key>LSHasLocalizedDisplayName</key>
<true/>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion deploy/windows/nsis/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Unicode True
!define DESCRIPTION "Dashboard software for serial port devices"
!define VERSIONMAJOR 1
!define VERSIONMINOR 1
!define VERSIONBUILD 3
!define VERSIONBUILD 4
!define MUI_ABORTWARNING
!define INSTALL_DIR "$PROGRAMFILES64\${APPNAME}"
!define MUI_FINISHPAGE_RUN
Expand Down
2 changes: 1 addition & 1 deletion src/AppInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#pragma once

// clang-format off
#define APP_VERSION "1.1.3"
#define APP_VERSION "1.1.4"
#define APP_DEVELOPER "Alex Spataru"
#define APP_NAME "Serial Studio"
#define APP_ICON ":/images/icon.svg"
Expand Down
35 changes: 19 additions & 16 deletions src/Widgets/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,30 @@ void GPS::resizeEvent(QResizeEvent *event)
event->accept();
}

/**
* Manually calls the zoom in / zoom out button clicks when the user presses on the widget
*/
void GPS::mousePressEvent(QMouseEvent *event)
{
class Hack : public QWidget
{
public:
using QWidget::mousePressEvent;
};
// Get x and y coordinates relative to title widget
auto x = event->x() - m_titleWidget.x();
auto y = event->y() - m_titleWidget.y();

auto hack = static_cast<Hack *>(&m_titleWidget);
hack->mousePressEvent(event);
}
// Press zoom in button
if (x >= m_zoomIn->x() && x <= m_zoomIn->x() + m_zoomIn->width())
{
if (y >= m_zoomIn->y() && y <= m_zoomIn->y() + m_zoomIn->height())
m_zoomIn->clicked();
}

void GPS::mouseReleaseEvent(QMouseEvent *event)
{
class Hack : public QWidget
// Press zoom out button
else if (x >= m_zoomOut->x() && x <= m_zoomOut->x() + m_zoomOut->width())
{
public:
using QWidget::mouseReleaseEvent;
};
if (y >= m_zoomOut->y() && y <= m_zoomOut->y() + m_zoomOut->height())
m_zoomOut->clicked();
}

auto hack = static_cast<Hack *>(&m_titleWidget);
hack->mouseReleaseEvent(event);
// Accept event
event->accept();
}
}
1 change: 0 additions & 1 deletion src/Widgets/GPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ private slots:
protected:
void resizeEvent(QResizeEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);

private:
int m_index;
Expand Down

0 comments on commit afd911f

Please sign in to comment.