void FlameshotDBusAdapter::trayIconEnabled(bool enabled) { auto controller = Controller::getInstance(); if (enabled) { controller->enableTrayIcon(); } else { controller->disableTrayIcon(); } }
void GeneneralConf::showTrayIconChanged(bool checked) { auto controller = Controller::getInstance(); if (checked) { controller->enableTrayIcon(); } else { controller->disableTrayIcon(); } }
Controller::Controller() : m_captureWindow(nullptr) { qApp->setQuitOnLastWindowClosed(false); // init tray icon #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) if (!ConfigHandler().disabledTrayIconValue()) { enableTrayIcon(); } #elif defined(Q_OS_WIN) enableTrayIcon(); GlobalShortcutFilter *nativeFilter = new GlobalShortcutFilter(this); qApp->installNativeEventFilter(nativeFilter); connect(nativeFilter, &GlobalShortcutFilter::printPressed, this, [this](){ this->requestCapture(CaptureRequest(CaptureRequest::GRAPHICAL_MODE)); }); #endif QString StyleSheet = CaptureButton::globalStyleSheet(); qApp->setStyleSheet(StyleSheet); }