Improve icons. Move some menu items to the toolbar. Don't show buttons in current...
[dorian] / widgets / dyalog.h
1 #ifndef DYALOG_H
2 #define DYALOG_H
3
4 #include <QDialog>
5 #include <QDialogButtonBox>
6
7 class QWidget;
8 class QPushButton;
9 class QScrollArea;
10 class QVBoxLayout;
11
12 /** Maemo- and Mac-friendly dialog box. */
13 class Dyalog: public QDialog
14 {
15     Q_OBJECT
16
17 public:
18     explicit Dyalog(QWidget *parent, bool showButtons = true);
19
20     /** Add widget to the scrollable content pane. */
21     void addWidget(QWidget *widget);
22
23     /** Add stretch to the scrollable content pane. */
24     void addStretch(int stretch = 0);
25
26     /** Add button to the dialog button box. */
27     void addButton(QPushButton *button,
28         QDialogButtonBox::ButtonRole role = QDialogButtonBox::AcceptRole);
29
30     /** Add standard button to the dialog button box. */
31     QPushButton *addButton(QDialogButtonBox::StandardButton button);
32
33 protected:
34     QScrollArea *scroller;
35     QWidget *content;
36     QVBoxLayout *contentLayout;
37     QDialogButtonBox *buttonBox;
38 };
39
40 #endif // DYALOG_H