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 authored and vixalien committed Feb 5, 2024
1 parent ec86ae2 commit 0bd02ac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions data/ui/components/playlist/edit.blp
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
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;

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: 1 addition & 3 deletions src/pages/playlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,11 @@ 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.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 0bd02ac

Please sign in to comment.