Commit db818e5b authored by Edric Milaret's avatar Edric Milaret Committed by gerrit2

fix minimize on close

- This code path was broken since we stopped overiding native window control

Change-Id: I77e5570faf731bc73d4b3d98f8fea9a67200fb5d
Tuleap: #276
parent 7819f431
......@@ -32,6 +32,7 @@
#include "aboutdialog.h"
#include "mainwindowtoolbar.h"
#include "settingskey.h"
#ifdef ENABLE_AUTOUPDATE
#include "winsparkle.h"
......@@ -195,3 +196,13 @@ MainWindow::switchNormalMaximize()
else
showMaximized();
}
void
MainWindow::closeEvent(QCloseEvent* event)
{
QSettings settings;
if (settings.value(SettingsKey::closeOrMinimized).toBool()) {
this->hide();
event->ignore();
}
}
......@@ -46,18 +46,19 @@ public:
void createThumbBar();
protected:
bool nativeEvent(const QByteArray &eventType, void *message, long *result);
bool nativeEvent(const QByteArray& eventType, void* message, long* result);
void closeEvent(QCloseEvent* event);
public slots:
void onRingEvent(const QString& uri);
private slots:
void trayActivated(QSystemTrayIcon::ActivationReason reason);
void onIncomingCall(Call *call);
void onIncomingCall(Call* call);
void switchNormalMaximize();
private:
explicit MainWindow(QWidget *parent = 0);
explicit MainWindow(QWidget* parent = 0);
~MainWindow();
Ui::MainWindow* ui;
NavStack* navStack_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment