style: run format
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#include "cache-cleaner.h"
|
#include "cache-cleaner.h"
|
||||||
|
|
||||||
#include "win-platform.h"
|
#include "win-platform.h"
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
|||||||
@@ -109,10 +109,13 @@ void TrayIcon::shutdown()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrayIcon::processMessages() {
|
void TrayIcon::processMessages()
|
||||||
|
{
|
||||||
MSG msg;
|
MSG msg;
|
||||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
|
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||||
if (msg.message == WM_QUIT) {
|
{
|
||||||
|
if (msg.message == WM_QUIT)
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
@@ -120,20 +123,25 @@ void TrayIcon::processMessages() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HWND consoleWnd = GetConsoleWindow();
|
HWND consoleWnd = GetConsoleWindow();
|
||||||
if (consoleWnd && IsIconic(consoleWnd)) {
|
if (consoleWnd && IsIconic(consoleWnd))
|
||||||
|
{
|
||||||
ShowWindow(consoleWnd, SW_HIDE);
|
ShowWindow(consoleWnd, SW_HIDE);
|
||||||
_isConsoleVisible = false;
|
_isConsoleVisible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrayIcon::onToggleConsole() {
|
void TrayIcon::onToggleConsole()
|
||||||
|
{
|
||||||
HWND consoleWnd = GetConsoleWindow();
|
HWND consoleWnd = GetConsoleWindow();
|
||||||
if (!consoleWnd) return;
|
if (!consoleWnd) return;
|
||||||
|
|
||||||
if (_isConsoleVisible) {
|
if (_isConsoleVisible)
|
||||||
|
{
|
||||||
ShowWindow(consoleWnd, SW_HIDE);
|
ShowWindow(consoleWnd, SW_HIDE);
|
||||||
_isConsoleVisible = false;
|
_isConsoleVisible = false;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ShowWindow(consoleWnd, SW_RESTORE);
|
ShowWindow(consoleWnd, SW_RESTORE);
|
||||||
|
|
||||||
HWND hCurWnd = GetForegroundWindow();
|
HWND hCurWnd = GetForegroundWindow();
|
||||||
@@ -158,8 +166,7 @@ void TrayIcon::onOpenControlPanel()
|
|||||||
|
|
||||||
void TrayIcon::onExit()
|
void TrayIcon::onExit()
|
||||||
{
|
{
|
||||||
if (_exitCallback)
|
if (_exitCallback) _exitCallback();
|
||||||
_exitCallback();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrayIcon::setExitCallback(std::function<void()> callback)
|
void TrayIcon::setExitCallback(std::function<void()> callback)
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
class TrayIcon {
|
class TrayIcon
|
||||||
public:
|
{
|
||||||
|
public:
|
||||||
TrayIcon();
|
TrayIcon();
|
||||||
~TrayIcon();
|
~TrayIcon();
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ public:
|
|||||||
|
|
||||||
void setExitCallback(std::function<void()> callback);
|
void setExitCallback(std::function<void()> callback);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void* windowProc(void* hwnd, unsigned int msg, unsigned long long wParam, long long lParam);
|
static void* windowProc(void* hwnd, unsigned int msg, unsigned long long wParam, long long lParam);
|
||||||
static TrayIcon* instance;
|
static TrayIcon* instance;
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ namespace utils
|
|||||||
{
|
{
|
||||||
std::string getExePath();
|
std::string getExePath();
|
||||||
std::string randomizeString(size_t length);
|
std::string randomizeString(size_t length);
|
||||||
}
|
} // namespace utils
|
||||||
|
|||||||
Reference in New Issue
Block a user