style: run format

This commit is contained in:
2026-06-20 06:59:39 -03:00
parent f30a76fe18
commit 037260acd5
6 changed files with 41 additions and 32 deletions
+1
View File
@@ -1,4 +1,5 @@
#include "cache-cleaner.h"
#include "win-platform.h"
#include <filesystem>
+16 -9
View File
@@ -109,10 +109,13 @@ void TrayIcon::shutdown()
}
}
void TrayIcon::processMessages() {
void TrayIcon::processMessages()
{
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
if (msg.message == WM_QUIT) {
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
break;
}
TranslateMessage(&msg);
@@ -120,20 +123,25 @@ void TrayIcon::processMessages() {
}
HWND consoleWnd = GetConsoleWindow();
if (consoleWnd && IsIconic(consoleWnd)) {
if (consoleWnd && IsIconic(consoleWnd))
{
ShowWindow(consoleWnd, SW_HIDE);
_isConsoleVisible = false;
}
}
void TrayIcon::onToggleConsole() {
void TrayIcon::onToggleConsole()
{
HWND consoleWnd = GetConsoleWindow();
if (!consoleWnd) return;
if (_isConsoleVisible) {
if (_isConsoleVisible)
{
ShowWindow(consoleWnd, SW_HIDE);
_isConsoleVisible = false;
} else {
}
else
{
ShowWindow(consoleWnd, SW_RESTORE);
HWND hCurWnd = GetForegroundWindow();
@@ -158,8 +166,7 @@ void TrayIcon::onOpenControlPanel()
void TrayIcon::onExit()
{
if (_exitCallback)
_exitCallback();
if (_exitCallback) _exitCallback();
}
void TrayIcon::setExitCallback(std::function<void()> callback)
+18 -17
View File
@@ -2,26 +2,27 @@
#include <functional>
class TrayIcon {
public:
TrayIcon();
~TrayIcon();
class TrayIcon
{
public:
TrayIcon();
~TrayIcon();
bool init();
void shutdown();
void processMessages();
bool init();
void shutdown();
void processMessages();
void onToggleConsole();
void onOpenControlPanel();
void onExit();
void onToggleConsole();
void onOpenControlPanel();
void onExit();
void setExitCallback(std::function<void()> callback);
void setExitCallback(std::function<void()> callback);
private:
static void* windowProc(void* hwnd, unsigned int msg, unsigned long long wParam, long long lParam);
static TrayIcon* instance;
private:
static void* windowProc(void* hwnd, unsigned int msg, unsigned long long wParam, long long lParam);
static TrayIcon* instance;
void* _hwnd;
bool _isConsoleVisible;
std::function<void()> _exitCallback;
void* _hwnd;
bool _isConsoleVisible;
std::function<void()> _exitCallback;
};
+1 -1
View File
@@ -6,4 +6,4 @@ namespace utils
{
std::string getExePath();
std::string randomizeString(size_t length);
}
} // namespace utils