Skip to content

Commit

Permalink
feat: Port Edit Playlist dialog to Adw.Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
sungsphinx committed Feb 4, 2024
1 parent 228c5f2 commit e7f0ea7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions data/ui/components/playlist/edit.blp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using Gtk 4.0;
using Adw 1;

template $EditPlaylistDialog : Adw.PreferencesWindow {
search-enabled: false;
template $EditPlaylistDialog : Adw.PreferencesDialog {
title: _("Edit Playlist");
default-width: 360;
default-height: 440;
//content-width: 360;
//content-height: 440;

Adw.PreferencesPage {
title: _("Edit Playlist");
Expand Down
2 changes: 1 addition & 1 deletion src/components/playlist/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ privacy_model.append(
),
);

export class EditPlaylistDialog extends Adw.PreferencesWindow {
export class EditPlaylistDialog extends Adw.PreferencesDialog {
static {
GObject.registerClass({
GTypeName: "EditPlaylistDialog",
Expand Down
4 changes: 2 additions & 2 deletions src/pages/playlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,13 @@ export class PlaylistPage extends Adw.Bin

const edit_dialog = new EditPlaylistDialog(this.playlist);

edit_dialog.set_transient_for(this.get_root() as Gtk.Window);
//edit_dialog.set_transient_for(this.get_root() as Gtk.Window);

edit_dialog.connect("saved", (_, values: ObjectContainer<EditedValues>) => {
this.update_values(values.object);
});

edit_dialog.present();
edit_dialog.present(this.get_root() as Gtk.Window);
}

update_values(values: EditedValues) {
Expand Down

0 comments on commit e7f0ea7

Please sign in to comment.