restore macOS menubar after viewing fullscreen image
This commit is contained in:
parent
e0ec403754
commit
28b8cd5ad1
@ -28,6 +28,8 @@ class ImageOverlayDialog : public QDialog
|
||||
public:
|
||||
ImageOverlayDialog(QPixmap image, QWidget *parent = nullptr);
|
||||
|
||||
void reject() override;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
@ -38,6 +38,23 @@ ImageOverlayDialog::ImageOverlayDialog(QPixmap image, QWidget *parent)
|
||||
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
|
||||
void ImageOverlayDialog::scaleImage(int max_width, int max_height)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user