Skip to content

Commit dade9e8

Browse files
committed
Small improvements
1 parent 81da9fa commit dade9e8

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
lines changed

AboutBox.hpp.in

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#ifndef MOUSESIM_ABOUTBOX
22

33
#define MOUSESIM_ABOUTBOX \
4-
"<h2>MouseSim</h2> \
5-
<p>Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}</p> \
6-
<p>Build Number: ${PROJECT_VERSION_TWEAK}</p> \
7-
<p>Copyright &copy; 2017 Alex Swindler</p> \
8-
<p><a href='https://github.com/axelstudios/MouseSim'>MouseSim</a> is a simple tool to simulate mouse movement and avoid computer inactivity.</p>"
4+
"<div style=\"margin-right: 20px; text-align: center;\"> \
5+
<h2>MouseSim</h2> \
6+
<p>Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}</p> \
7+
<p>Build Number: ${PROJECT_VERSION_TWEAK}</p> \
8+
<p>Copyright &copy; 2017 Alex Swindler</p> \
9+
<p><a href='https://github.com/axelstudios/MouseSim'>MouseSim</a> is a simple tool to simulate mouse movement and avoid computer inactivity.</p> \
10+
</div>"
911

1012
#endif // MOUSESIM_ABOUTBOX

MouseSim.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "MouseSim.hpp"
2-
#include <AboutBox.hpp>
2+
#include "AboutBox.hpp"
33

4-
#include <QAction>
54
#include <QCoreApplication>
65
#include <QMenu>
76
#include <QMessageBox>
@@ -70,7 +69,7 @@ MouseSim::MouseSim() :
7069
m_trayIcon->show();
7170
}
7271

73-
void MouseSim::iconActivated(QSystemTrayIcon::ActivationReason reason)
72+
void MouseSim::iconActivated(QSystemTrayIcon::ActivationReason reason) const
7473
{
7574
if (reason == QSystemTrayIcon::Trigger || reason == QSystemTrayIcon::DoubleClick) {
7675
if (m_timer->isActive()) {
@@ -95,7 +94,7 @@ void MouseSim::sendInput()
9594
SendInput(1, &input, sizeof(INPUT));
9695
}
9796

98-
void MouseSim::enable()
97+
void MouseSim::enable() const
9998
{
10099
m_timer->start(1000);
101100
m_trayIcon->setIcon(*m_activated);
@@ -105,7 +104,7 @@ void MouseSim::enable()
105104
m_disableAction->setEnabled(true);
106105
}
107106

108-
void MouseSim::disable()
107+
void MouseSim::disable() const
109108
{
110109
m_timer->stop();
111110

@@ -115,7 +114,7 @@ void MouseSim::disable()
115114
m_enableAction->setEnabled(true);
116115
}
117116

118-
void MouseSim::autostart(bool enabled)
117+
void MouseSim::autostart(const bool enabled) const
119118
{
120119
if (enabled) {
121120
m_settings->setValue("MouseSim", m_appPath);
@@ -128,7 +127,6 @@ void MouseSim::about()
128127
{
129128
QMessageBox about(nullptr);
130129
about.setText(MOUSESIM_ABOUTBOX);
131-
about.setStyleSheet("qproperty-alignment: AlignCenter;");
132130
about.setWindowTitle("About MouseSim");
133131
about.exec();
134132
}

MouseSim.exe.manifest

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
2121
<!--The ID below indicates application support for Windows 8.1 -->
2222
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
23+
<!--The ID below indicates application support for Windows 10 -->
24+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
2325
</application>
2426
</compatibility>
2527
</assembly>

MouseSim.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ class MouseSim : public QWidget
1818
virtual ~MouseSim() override = default;
1919

2020
private slots:
21-
void iconActivated(QSystemTrayIcon::ActivationReason reason);
22-
void sendInput();
23-
void enable();
24-
void disable();
25-
void autostart(bool enabled);
26-
void about();
21+
void iconActivated(QSystemTrayIcon::ActivationReason reason) const;
22+
static void sendInput();
23+
void enable() const;
24+
void disable() const;
25+
void autostart(const bool enabled) const;
26+
static void about();
2727

2828
private:
2929
const QString m_appPath;

MouseSim.rc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ BEGIN
1313
VALUE "FileDescription", "MouseSim\0"
1414
VALUE "FileVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.0\0"
1515
VALUE "InternalName", "MouseSim\0"
16+
VALUE "LegalCopyright", "Copyright � 2017 Alex Swindler\0"
1617
VALUE "OriginalFilename", "MouseSim.exe\0"
1718
VALUE "ProductName", "MouseSim\0"
1819
VALUE "ProductVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}\0"

icons/mouse_16.png

-71 Bytes
Loading

0 commit comments

Comments
 (0)