Top |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkWindow ╰── GtkDialog ╰── HdyDialog
A GtkDialog that adapts to smaller displays.
Small is defined as:
1 2 |
is_small = (( width <= 400 && height <= 800) || (maximized && width <= 800 && height <= 400)); |
In the smaller view a HdyDialog matches its size to that of its parent and for "Presentation Dialogs" uses a back button rather than close button to dismiss.
It's recommended that dialog contents are wrapped in a GtkScrolledWindow to ensure they don't overflow the screen.
HdyDialog works best when “use-header-bar” is TRUE
(which is
the case when using hdy_dialog_new()
).
Design Information: GitLab Issue
Ideally when using HdyDialog you shouldn't need to know you are using
it rather than GtkDialog however there are some notable differences:
“modal” is TRUE
by default as is “destroy-with-parent” as
the behaviour demonstrated by HdyDialog would be a bad user experience
when not modal.
If you want to replace the titlebar by your own, we recommend using HdyHeaderBar as it will retain the abiity to present a back button when the dialog is small. HdyHeaderBar doesn't have to be its direct child and you can use any complex contraption you like as the dialog's titlebar.
GtkWidget *
hdy_dialog_new (GtkWindow *parent
);
Create a HdyDialog with “transient-for” set to parent
C Usage
1 |
GtkWidget *dlg = hdy_dialog_new (GTK_WINDOW (main_window)); |
Vala Usage
1 |
var dlg = new Hdy.Dialog (main_window); |
Python Usage
1 |
dlg = Handy.Dialog.new (main_window); |
Since: 0.0.7