From 09d7e8ca6ef4eb59ba086707cf63e80cfb098b80 Mon Sep 17 00:00:00 2001 From: Krifa75 Date: Mon, 31 Oct 2022 20:00:04 +0100 Subject: preferences: Modernise preferences UI Use HdyPreferencesWindow and other libhandy helpers to modernise and simplify the preferences UI. This will eventually make it easier to port to GTK 4. Closes: #543 --- data/totem-preferences-dialog.ui | 1124 +++++++++++++------------------------- src/totem-preferences-dialog.c | 9 +- src/totem-preferences-dialog.h | 4 +- 3 files changed, 388 insertions(+), 749 deletions(-) diff --git a/data/totem-preferences-dialog.ui b/data/totem-preferences-dialog.ui index e7696cb50..da525c0e7 100644 --- a/data/totem-preferences-dialog.ui +++ b/data/totem-preferences-dialog.ui @@ -66,7 +66,7 @@ 32767 - + + horizontal + + + + + + + diff --git a/src/totem-preferences-dialog.c b/src/totem-preferences-dialog.c index 3f5ced837..08d43bcfb 100644 --- a/src/totem-preferences-dialog.c +++ b/src/totem-preferences-dialog.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * Copyright (C) 2001,2002,2003 Bastien Nocera * * This program is free software; you can redistribute it and/or modify @@ -45,7 +45,7 @@ #include "totem-plugins-engine.h" struct _TotemPreferencesDialog { - GtkDialog parent_instance; + HdyPreferencesWindow parent_instance; Totem *totem; @@ -67,7 +67,7 @@ struct _TotemPreferencesDialog { GtkComboBox *subtitle_encoding_combo; }; -G_DEFINE_TYPE (TotemPreferencesDialog, totem_preferences_dialog, GTK_TYPE_DIALOG) +G_DEFINE_TYPE (TotemPreferencesDialog, totem_preferences_dialog, HDY_TYPE_PREFERENCES_WINDOW) static void disable_kbd_shortcuts_changed_cb (GSettings *settings, const gchar *key, TotemObject *totem) @@ -292,7 +292,7 @@ totem_preferences_dialog_constructed (GObject *object) prefs->tpw_auto_subtitles_checkbutton, "active", G_SETTINGS_BIND_DEFAULT); /* Plugins button */ - g_signal_connect (prefs->tpw_plugins_button, "clicked", + g_signal_connect (prefs->tpw_plugins_button, "activated", G_CALLBACK (plugin_button_clicked_cb), totem); /* Brightness and all */ @@ -418,6 +418,5 @@ totem_preferences_dialog_new (Totem *totem) { return g_object_new (TOTEM_TYPE_PREFERENCES_DIALOG, "totem", totem, - "use-header-bar", 1, NULL); } diff --git a/src/totem-preferences-dialog.h b/src/totem-preferences-dialog.h index 19ceb9ec3..8553c1b22 100644 --- a/src/totem-preferences-dialog.h +++ b/src/totem-preferences-dialog.h @@ -28,9 +28,9 @@ #pragma once -#include +#include #define TOTEM_TYPE_PREFERENCES_DIALOG (totem_preferences_dialog_get_type()) -G_DECLARE_FINAL_TYPE (TotemPreferencesDialog, totem_preferences_dialog, TOTEM, PREFERENCES_DIALOG, GtkDialog) +G_DECLARE_FINAL_TYPE (TotemPreferencesDialog, totem_preferences_dialog, TOTEM, PREFERENCES_DIALOG, HdyPreferencesWindow) GtkWidget *totem_preferences_dialog_new (Totem *totem); -- cgit v1.2.1