Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo: make dialogs modal #702

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions demo/Views/DialogsView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class DialogsView : Gtk.Box {
layout.attach (gtk_switch, 0, 3);

var dialog = new Granite.Dialog () {
modal = true,
transient_for = window
};
dialog.get_content_area ().append (layout);
Expand All @@ -75,14 +76,16 @@ public class DialogsView : Gtk.Box {
}

private void show_message_dialog () {
var message_dialog = new Granite.MessageDialog.with_image_from_icon_name (
var message_dialog = new Granite.MessageDialog (
"Basic information and a suggestion",
"Further details, including information that explains any unobvious consequences of actions.",
"phone",
new ThemedIcon ("phone"),
Gtk.ButtonsType.CANCEL
);
message_dialog.badge_icon = new ThemedIcon ("dialog-information");
message_dialog.transient_for = window;
) {
badge_icon = new ThemedIcon ("dialog-information"),
modal = true,
transient_for = window
};

var suggested_button = new Gtk.Button.with_label ("Suggested Action");
suggested_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION);
Expand Down