restore macOS menubar after viewing fullscreen image
This commit is contained in:
parent
768a2366e6
commit
46b6d943a2
@ -28,6 +28,8 @@ class ImageOverlayDialog : public QDialog
|
|||||||
public:
|
public:
|
||||||
ImageOverlayDialog(QPixmap image, QWidget *parent = nullptr);
|
ImageOverlayDialog(QPixmap image, QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
void reject() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QMouseEvent *event) override;
|
void mousePressEvent(QMouseEvent *event) override;
|
||||||
void paintEvent(QPaintEvent *event) override;
|
void paintEvent(QPaintEvent *event) override;
|
||||||
|
@ -38,6 +38,23 @@ ImageOverlayDialog::ImageOverlayDialog(QPixmap image, QWidget *parent)
|
|||||||
raise();
|
raise();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ImageOverlayDialog::reject()
|
||||||
|
{
|
||||||
|
// needed on macOS to recover the main menu after the dialog is closed(!)
|
||||||
|
setWindowState(Qt::WindowNoState);
|
||||||
|
|
||||||
|
// It might be slightly cleaner to do:
|
||||||
|
//
|
||||||
|
// #ifdef Q_WS_MACX
|
||||||
|
// #include <Carbon/Carbon.h>
|
||||||
|
// ShowMenuBar();
|
||||||
|
// #endif
|
||||||
|
//
|
||||||
|
// ...but there's a chance other platforms might be affected by this too.
|
||||||
|
|
||||||
|
QDialog::reject();
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Move this into Utils
|
// TODO: Move this into Utils
|
||||||
void ImageOverlayDialog::scaleImage(int max_width, int max_height)
|
void ImageOverlayDialog::scaleImage(int max_width, int max_height)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user