Wireshark  4.3.0
The Wireshark network protocol analyzer
geometry_state_dialog.h
Go to the documentation of this file.
1 
10 #ifndef GEOMETRY_STATE_DIALOG_H
11 #define GEOMETRY_STATE_DIALOG_H
12 
13 #include <QDialog>
14 
15 class GeometryStateDialog : public QDialog
16 {
17 public:
18 
19 // As discussed in change 7072, QDialogs have different minimize and "on
20 // top" behaviors depending on their parents, flags, and platforms.
21 //
22 // W = Windows, L = Linux (and other non-macOS UN*Xes), X = macOS
23 //
24 // QDialog(parent)
25 //
26 // W,L: Always on top, no minimize button.
27 // X: Independent, no minimize button.
28 //
29 // QDialog(parent, Qt::Window)
30 //
31 // W: Always on top, minimize button. Minimizes to a small title bar
32 // attached to the taskbar and not the taskbar itself. (The GTK+
33 // UI used to do this.)
34 // L: Always on top, minimize button.
35 // X: Independent, minimize button.
36 //
37 // QDialog(NULL)
38 //
39 // W, L, X: Independent, no minimize button.
40 //
41 // QDialog(NULL, Qt::Window)
42 //
43 // W, L, X: Independent, minimize button.
44 //
45 // Additionally, maximized, parent-less dialogs can close to a black screen
46 // on macOS: https://gitlab.com/wireshark/wireshark/-/issues/12544
47 //
48 // Pass in the parent on macOS and NULL elsewhere so that we have an
49 // independent window that un-maximizes correctly.
50 
51 #ifdef Q_OS_MAC
52  explicit GeometryStateDialog(QWidget *parent, Qt::WindowFlags f = Qt::WindowFlags()) : QDialog(parent, f) {}
53 #else
54  explicit GeometryStateDialog(QWidget *, Qt::WindowFlags f = Qt::WindowFlags()) : QDialog(NULL, f) {}
55 #endif
57 
58 protected:
59  void loadGeometry(int width = 0, int height = 0, const QString &dialog_name = QString());
60 
61 private:
62  void saveGeometry();
63 
64  QString dialog_name_;
65 };
66 
67 #endif // GEOMETRY_STATE_DIALOG_H
Definition: geometry_state_dialog.h:16