Skip to content

Commit

Permalink
comment-dialog: Port AdwWindow to AdwDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
oscfdezdz committed Feb 8, 2024
1 parent fab7a6d commit 840a3d4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/exm-comment-dialog.blp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Gtk 4.0;
using Adw 1;

template $ExmCommentDialog : Adw.Window {
default-width: 600;
default-height: 500;
template $ExmCommentDialog : Adw.Dialog {
content-width: 600;
content-height: 600;
width-request: 360;
height-request: 294;
title: _("Comments");

Adw.ToolbarView {
child: Adw.ToolbarView {

[top]
Adw.HeaderBar {}
Expand Down Expand Up @@ -50,5 +50,5 @@ template $ExmCommentDialog : Adw.Window {
}
}
};
}
};
}
6 changes: 2 additions & 4 deletions src/exm-comment-dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

struct _ExmCommentDialog
{
AdwWindow parent_instance;
AdwDialog parent_instance;

ExmCommentProvider *comment_provider;

Expand All @@ -17,7 +17,7 @@ struct _ExmCommentDialog
int web_id;
};

G_DEFINE_FINAL_TYPE (ExmCommentDialog, exm_comment_dialog, ADW_TYPE_WINDOW)
G_DEFINE_FINAL_TYPE (ExmCommentDialog, exm_comment_dialog, ADW_TYPE_DIALOG)

enum {
PROP_0,
Expand Down Expand Up @@ -106,8 +106,6 @@ exm_comment_dialog_class_init (ExmCommentDialogClass *klass)

gtk_widget_class_bind_template_child (widget_class, ExmCommentDialog, list_box);
gtk_widget_class_bind_template_child (widget_class, ExmCommentDialog, stack);

gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Escape, 0, "window.close", NULL);
}

static GtkWidget *
Expand Down
2 changes: 1 addition & 1 deletion src/exm-comment-dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ G_BEGIN_DECLS

#define EXM_TYPE_COMMENT_DIALOG (exm_comment_dialog_get_type())

G_DECLARE_FINAL_TYPE (ExmCommentDialog, exm_comment_dialog, EXM, COMMENT_DIALOG, AdwWindow)
G_DECLARE_FINAL_TYPE (ExmCommentDialog, exm_comment_dialog, EXM, COMMENT_DIALOG, AdwDialog)

ExmCommentDialog *exm_comment_dialog_new (int web_id);

Expand Down
5 changes: 1 addition & 4 deletions src/exm-detail-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,7 @@ show_more_comments (GtkButton *button,
dlg = exm_comment_dialog_new (self->pk);
toplevel = gtk_widget_get_root (GTK_WIDGET (self));

gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (toplevel));
gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);

gtk_window_present (GTK_WINDOW (dlg));
adw_dialog_present (ADW_DIALOG (dlg), GTK_WIDGET (toplevel));
}

static void
Expand Down

0 comments on commit 840a3d4

Please sign in to comment.