style: run format
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "cache-cleaner.h"
|
||||
|
||||
#include "win-platform.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
class TrayIcon {
|
||||
public:
|
||||
class TrayIcon
|
||||
{
|
||||
public:
|
||||
TrayIcon();
|
||||
~TrayIcon();
|
||||
|
||||
@@ -17,7 +18,7 @@ public:
|
||||
|
||||
void setExitCallback(std::function<void()> callback);
|
||||
|
||||
private:
|
||||
private:
|
||||
static void* windowProc(void* hwnd, unsigned int msg, unsigned long long wParam, long long lParam);
|
||||
static TrayIcon* instance;
|
||||
|
||||
|
||||
@@ -6,4 +6,4 @@ namespace utils
|
||||
{
|
||||
std::string getExePath();
|
||||
std::string randomizeString(size_t length);
|
||||
}
|
||||
} // namespace utils
|
||||
|
||||
Reference in New Issue
Block a user