Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
geometry_state_dialog.h
1 /* geometry_state_dialog.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef GEOMETRY_STATE_DIALOG_H
11 #define GEOMETRY_STATE_DIALOG_H
12 
13 #include <QDialog>
14 
15 class GeometryStateDialog : public QDialog
16 {
17  Q_OBJECT
18 
19 public:
20 
21 // As discussed in change 7072, QDialogs have different minimize and "on
22 // top" behaviors depending on their parents, flags, and platforms.
23 //
24 // W = Windows, L = Linux (and other non-macOS UN*Xes), X = macOS
25 //
26 // QDialog(parent)
27 //
28 // W,L: Always on top, no minimize button.
29 // X: Independent, no minimize button.
30 //
31 // QDialog(parent, Qt::Window)
32 //
33 // W: Always on top, minimize button. Minimizes to a small title bar
34 // attached to the taskbar and not the taskbar itself. (The GTK+
35 // UI used to do this.)
36 // L: Always on top, minimize button.
37 // X: Independent, minimize button.
38 //
39 // QDialog(NULL)
40 //
41 // W, L, X: Independent, no minimize button.
42 //
43 // QDialog(NULL, Qt::Window)
44 //
45 // W, L, X: Independent, minimize button.
46 //
47 // Additionally, maximized, parent-less dialogs can close to a black screen
48 // on macOS: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=12544
49 //
50 // Pass in the parent on macOS and NULL elsewhere so that we have an
51 // independent window that un-maximizes correctly.
52 #ifdef Q_OS_MAC
53  explicit GeometryStateDialog(QWidget *parent, Qt::WindowFlags f = 0) : QDialog(parent, f) {}
54 #else
55  explicit GeometryStateDialog(QWidget *, Qt::WindowFlags f = 0) : QDialog(NULL, f) {}
56 #endif
58 
59 protected:
60  void loadGeometry(int width = 0, int height = 0, const QString &dialog_name = QString());
61 
62 private:
63  void saveGeometry();
64 
65  QString dialog_name_;
66 };
67 
68 #endif // GEOMETRY_STATE_DIALOG_H
69 
70 /*
71  * Editor modelines
72  *
73  * Local Variables:
74  * c-basic-offset: 4
75  * tab-width: 8
76  * indent-tabs-mode: nil
77  * End:
78  *
79  * ex: set shiftwidth=4 tabstop=8 expandtab:
80  * :indentSize=4:tabSize=8:noTabs=true:
81  */
Definition: geometry_state_dialog.h:15