Windows fixes and adaptation

Binary will have icon
Start capture with Print key
Fix .rc generation
This commit is contained in:
lupoDharkael
2017-12-28 18:18:14 +01:00
parent e96651bc07
commit 3258062d16
5 changed files with 98 additions and 6 deletions

View File

@@ -27,6 +27,10 @@
#include <QAction>
#include <QMenu>
#ifdef Q_OS_WIN
#include "src/core/globalshortcutfilter.h"
#endif
// Controller is the core component of Flameshot, creates the trayIcon and
// launches the capture widget
@@ -34,16 +38,21 @@ Controller::Controller() : m_captureWindow(nullptr)
{
qApp->setQuitOnLastWindowClosed(false);
initDefaults();
// init tray icon
#ifdef Q_OS_LINUX
#if defined(Q_OS_LINUX)
if (!ConfigHandler().disabledTrayIconValue()) {
enableTrayIcon();
}
#else
#elif defined(Q_OS_WIN)
enableTrayIcon();
#endif
initDefaults();
GlobalShortcutFilter *nativeFilter = new GlobalShortcutFilter(this);
qApp->installNativeEventFilter(nativeFilter);
connect(nativeFilter, &GlobalShortcutFilter::printPressed,
this, [this](){ this->createVisualCapture(); });
#endif
QString StyleSheet = CaptureButton::globalStyleSheet();
qApp->setStyleSheet(StyleSheet);