treewide: Replace libhandy with libadwaita

Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
This commit is contained in:
Anton Lazarev
2023-12-13 12:56:46 -08:00
parent 4ed1bba0b8
commit ee3abc009a
28 changed files with 117 additions and 118 deletions

View File

@@ -40,10 +40,10 @@
/**
* Section:calls-account-overview
* short_description: A #HdyWindow to manage VoIP accounts
* short_description: A #AdwWindow to manage VoIP accounts
* @Title: CallsAccountOverview
*
* This is a #HdyWindow derived window to display and manage the
* This is a #AdwWindow derived window to display and manage the
* VoIP accounts. Each available #CallsAccount from any #CallsAccountProvider
* will be listed as a #CallsAccountRow.
*/
@@ -55,7 +55,7 @@ typedef enum {
struct _CallsAccountOverview {
HdyWindow parent;
AdwWindow parent;
/* UI widgets */
GtkStack *stack;
@@ -81,7 +81,7 @@ struct _CallsAccountOverview {
CallsInAppNotification *in_app_notification;
};
G_DEFINE_TYPE (CallsAccountOverview, calls_account_overview, HDY_TYPE_WINDOW)
G_DEFINE_TYPE (CallsAccountOverview, calls_account_overview, ADW_TYPE_WINDOW)
static void

View File

@@ -24,13 +24,13 @@
#pragma once
#include <handy.h>
#include <adwaita.h>
G_BEGIN_DECLS
#define CALLS_TYPE_ACCOUNT_OVERVIEW (calls_account_overview_get_type ())
G_DECLARE_FINAL_TYPE (CallsAccountOverview, calls_account_overview, CALLS, ACCOUNT_OVERVIEW, HdyWindow)
G_DECLARE_FINAL_TYPE (CallsAccountOverview, calls_account_overview, CALLS, ACCOUNT_OVERVIEW, AdwWindow)
CallsAccountOverview *calls_account_overview_new (void);

View File

@@ -30,10 +30,10 @@
/**
* Section:calls-account-row
* short_description: A #HdyActionRow for use in #CallsAccountOverview
* short_description: A #AdwActionRow for use in #CallsAccountOverview
* @Title: CallsAccountRow
*
* This is a #HdyActionRow derived widget representing a #CallsAccount
* This is a #AdwActionRow derived widget representing a #CallsAccount
* for VoIP accounts (currently only SIP).
*/
@@ -48,18 +48,18 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
struct _CallsAccountRow {
HdyActionRow parent;
AdwActionRow parent;
CallsAccountProvider *provider;
CallsAccount *account;
gboolean online;
/* UI elements */
HdyAvatar *avatar;
AdwAvatar *avatar;
GtkSwitch *online_switch;
};
G_DEFINE_TYPE (CallsAccountRow, calls_account_row, HDY_TYPE_ACTION_ROW)
G_DEFINE_TYPE (CallsAccountRow, calls_account_row, ADW_TYPE_ACTION_ROW)
static void

View File

@@ -27,14 +27,14 @@
#include "calls-account.h"
#include "calls-account-provider.h"
#include <handy.h>
#include <adwaita.h>
G_BEGIN_DECLS
#define CALLS_TYPE_ACCOUNT_ROW (calls_account_row_get_type ())
G_DECLARE_FINAL_TYPE (CallsAccountRow, calls_account_row, CALLS, ACCOUNT_ROW, HdyActionRow);
G_DECLARE_FINAL_TYPE (CallsAccountRow, calls_account_row, CALLS, ACCOUNT_ROW, AdwActionRow);
CallsAccountRow *calls_account_row_new (CallsAccountProvider *provider,
CallsAccount *account);

View File

@@ -44,10 +44,10 @@
#include "calls-ringer.h"
#include "version.h"
#include <adwaita.h>
#include <call-ui.h>
#include <glib/gi18n.h>
#include <glib-unix.h>
#include <handy.h>
#include <libcallaudio.h>
/**
@@ -474,18 +474,18 @@ startup (GApplication *application)
{
g_autoptr (GtkCssProvider) provider = NULL;
g_autoptr (GError) error = NULL;
#if HDY_CHECK_VERSION (1, 5, 0)
HdyStyleManager *style_manager;
#if ADW_CHECK_VERSION (1, 5, 0)
AdwStyleManager *style_manager;
#endif
G_APPLICATION_CLASS (calls_application_parent_class)->startup (application);
hdy_init ();
adw_init ();
#if HDY_CHECK_VERSION (1, 5, 0)
style_manager = hdy_style_manager_get_default ();
#if ADW_CHECK_VERSION (1, 5, 0)
style_manager = adw_style_manager_get_default ();
hdy_style_manager_set_color_scheme (style_manager, HDY_COLOR_SCHEME_PREFER_LIGHT);
adw_style_manager_set_color_scheme (style_manager, ADW_COLOR_SCHEME_PREFER_LIGHT);
#endif
if (!call_audio_init (&error))

View File

@@ -28,10 +28,10 @@
#include "calls-manager.h"
#include "calls-util.h"
#include <adwaita.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#include <glib.h>
#include <handy.h>
#include <sys/time.h>
#include <errno.h>

View File

@@ -66,7 +66,7 @@ static void
set_party (CallsCallSelectorItem *self)
{
CuiCall *call;
// FIXME: use HdyAvatar and the contact avatar
// FIXME: use AdwAvatar and the contact avatar
GtkWidget *image = gtk_image_new_from_icon_name ("avatar-default-symbolic", GTK_ICON_SIZE_DIALOG);
gtk_box_pack_start (self->main_box, image, TRUE, TRUE, 0);

View File

@@ -35,9 +35,9 @@
#include "calls-ui-call-data.h"
#include "calls-util.h"
#include <adwaita.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#include <handy.h>
struct _CallsCallWindow {

View File

@@ -29,8 +29,7 @@
#include <glib/gi18n.h>
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
#include <adwaita.h>
struct _CallsContactsBox {
GtkWidget parent_instance;

View File

@@ -10,8 +10,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include <adwaita.h>
#include <folks/folks.h>
#include <handy.h>
#include "calls-contacts-row.h"
#include "calls-contacts-provider.h"
@@ -103,7 +103,7 @@ avatar_changed_cb (CallsContactsRow *self)
if (icon == NULL)
return;
hdy_avatar_set_loadable_icon (HDY_AVATAR (self->avatar), icon);
adw_avatar_set_loadable_icon (ADW_AVATAR (self->avatar), icon);
}
static void

View File

@@ -36,19 +36,19 @@
#include "calls-util.h"
#include "version.h"
#include <adwaita.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#include <handy.h>
struct _CallsMainWindow {
HdyApplicationWindow parent_instance;
AdwApplicationWindow parent_instance;
GListModel *record_store;
CallsInAppNotification *in_app_notification;
HdyViewSwitcherTitle *title_switcher;
AdwViewSwitcherTitle *title_switcher;
GtkStack *main_stack;
GtkRevealer *permanent_error_revealer;
@@ -68,7 +68,7 @@ struct _CallsMainWindow {
GtkButton *ussd_reply_button;
};
G_DEFINE_TYPE (CallsMainWindow, calls_main_window, HDY_TYPE_APPLICATION_WINDOW);
G_DEFINE_TYPE (CallsMainWindow, calls_main_window, ADW_TYPE_APPLICATION_WINDOW);
enum {
PROP_0,
@@ -428,7 +428,7 @@ size_allocate (GtkWidget *widget,
{
CallsMainWindow *self = CALLS_MAIN_WINDOW (widget);
hdy_view_switcher_title_set_view_switcher_enabled (self->title_switcher,
adw_view_switcher_title_set_view_switcher_enabled (self->title_switcher,
allocation->width > 400);
GTK_WIDGET_CLASS (calls_main_window_parent_class)->size_allocate (widget, allocation);

View File

@@ -25,13 +25,13 @@
#ifndef CALLS_MAIN_WINDOW_H__
#define CALLS_MAIN_WINDOW_H__
#include <handy.h>
#include <adwaita.h>
G_BEGIN_DECLS
#define CALLS_TYPE_MAIN_WINDOW (calls_main_window_get_type ())
G_DECLARE_FINAL_TYPE (CallsMainWindow, calls_main_window, CALLS, MAIN_WINDOW, HdyApplicationWindow);
G_DECLARE_FINAL_TYPE (CallsMainWindow, calls_main_window, CALLS, MAIN_WINDOW, AdwApplicationWindow);
CallsMainWindow *calls_main_window_new (GtkApplication *application,
GListModel *record_store);

View File

@@ -32,9 +32,9 @@
#include "calls-ussd.h"
#include "calls-util.h"
#include <adwaita.h>
#include <call-ui.h>
#include <glib/gi18n.h>
#include <handy.h>
enum {
PROP_0,
@@ -47,10 +47,10 @@ struct _CallsNewCallBox {
GtkWidget parent_instance;
GtkListBox *origin_list_box;
HdyComboRow *origin_list;
AdwComboRow *origin_list;
CuiDialpad *dialpad;
GtkEntry *address_entry;
HdyActionRow *result;
AdwActionRow *result;
GtkButton *dial_result;
GList *dial_queue;
@@ -65,11 +65,11 @@ static CallsOrigin *
get_selected_origin (CallsNewCallBox *self)
{
g_autoptr (CallsOrigin) origin = NULL;
GListModel *model = hdy_combo_row_get_model (self->origin_list);
GListModel *model = adw_combo_row_get_model (self->origin_list);
gint index = -1;
if (model)
index = hdy_combo_row_get_selected_index (self->origin_list);
index = adw_combo_row_get_selected_index (self->origin_list);
if (model && index >= 0)
origin = g_list_model_get_item (model, index);
@@ -326,7 +326,7 @@ calls_new_call_box_init (CallsNewCallBox *self)
gtk_widget_init_template (GTK_WIDGET (self));
origins = calls_manager_get_origins (calls_manager_get_default ());
hdy_combo_row_bind_name_model (self->origin_list, origins,
adw_combo_row_bind_name_model (self->origin_list, origins,
get_origin_name, self, NULL);
g_signal_connect_object (origins,

View File

@@ -31,7 +31,7 @@ calls_includes = [ top_include, src_include ]
calls_deps = [ dependency('gobject-2.0', version: '>= 2.58'),
dependency('gtk4'),
dependency('libhandy-1', version: '>= 1.4.0'),
dependency('libadwaita-1', version: '>= 1.2'),
dependency('libfeedback-0.0'),
dependency('libpeas-1.0'),
dependency('gom-1.0'),

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.24"/>
<requires lib="libhandy" version="1.0"/>
<template class="CallsAccountOverview" parent="HdyWindow">
<requires lib="libadwaita" version="1.0"/>
<template class="CallsAccountOverview" parent="AdwWindow">
<property name="visible">True</property>
<property name="default-width">380</property>
<property name="default-height">660</property>
@@ -12,7 +12,7 @@
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="HdyHeaderBar">
<object class="AdwHeaderBar">
<property name="title" translatable="yes">VoIP Accounts</property>
<property name="show-close-button">True</property>
<property name="visible">True</property>
@@ -47,7 +47,7 @@
<!-- First child type: No accounts present: Show a blurb and a Add button -->
<child>
<object class="HdyStatusPage" id="intro">
<object class="AdwStatusPage" id="intro">
<property name="visible">True</property>
<property name="title" translatable="yes">Add VoIP Accounts</property>
<property name="icon-name">system-users-symbolic</property>
@@ -115,7 +115,7 @@
</object>
<object class="HdyWindow" id="account_window">
<object class="AdwWindow" id="account_window">
<property name="visible">False</property>
<property name="default-width">380</property>
<property name="default-height">660</property>

View File

@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="libhandy" version="1.0"/>
<template class="CallsAccountRow" parent="HdyActionRow">
<requires lib="libadwaita" version="1.0"/>
<template class="CallsAccountRow" parent="AdwActionRow">
<property name="visible">True</property>
<property name="title">Title</property>
<property name="subtitle">Subtitle</property>
<property name="activatable">True</property>
<child type="prefix">
<object class="HdyAvatar" id="avatar">
<object class="AdwAvatar" id="avatar">
<property name="visible">True</property>
<property name="show-initials">True</property>
<property name="size">48</property>

View File

@@ -13,7 +13,7 @@
<object class="GtkBox">
<property name="visible">True</property>
<child>
<object class="HdyAvatar" id="avatar">
<object class="AdwAvatar" id="avatar">
<property name="visible">True</property>
<property name="margin_left">8</property>
<property name="margin_top">8</property>

View File

@@ -2,7 +2,7 @@
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="libhandy" version="0.0"/>
<requires lib="libadwaita" version="0.0"/>
<template class="CallsContactsBox" parent="GtkWidget">
<property name="visible">True</property>
<child>
@@ -10,7 +10,7 @@
<property name="visible">True</property>
<property name="expand">True</property>
<child>
<object class="HdyClamp">
<object class="AdwClamp">
<property name="visible">True</property>
<child>
<object class="GtkBox">

View File

@@ -13,7 +13,7 @@
<!-- Avatar -->
<child>
<object class="HdyAvatar" id="avatar">
<object class="AdwAvatar" id="avatar">
<property name="visible">True</property>
<property name="valign">center</property>
<property name="size">36</property>

View File

@@ -7,7 +7,7 @@
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<child>
<object class="HdyStatusPage">
<object class="AdwStatusPage">
<property name="visible">True</property>
<property name="icon-name">call-start-symbolic</property>
<property name="title" translatable="yes">No Recent Calls</property>
@@ -22,7 +22,7 @@
<property name="visible">True</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="HdyClamp">
<object class="AdwClamp">
<property name="visible">True</property>
<child>
<object class="GtkListBox" id="history">

View File

@@ -2,8 +2,8 @@
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="libhandy" version="1.0"/>
<template class="CallsMainWindow" parent="HdyApplicationWindow">
<requires lib="libadwaita" version="1.0"/>
<template class="CallsMainWindow" parent="AdwApplicationWindow">
<property name="title" translatable="yes">Calls</property>
<property name="hide_titlebar_when_maximized">True</property>
<property name="show_menubar">False</property>
@@ -13,13 +13,13 @@
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="HdyHeaderBar">
<object class="AdwHeaderBar">
<property name="visible">True</property>
<property name="centering_policy">strict</property>
<property name="show_close_button">True</property>
<property name="title" bind-source="CallsMainWindow" bind-property="title" bind-flags="sync-create"/>
<child type="title">
<object class="HdyViewSwitcherTitle" id="title_switcher">
<object class="AdwViewSwitcherTitle" id="title_switcher">
<property name="visible">True</property>
<property name="stack">main_stack</property>
<property name="title" bind-source="CallsMainWindow" bind-property="title" bind-flags="sync-create"/>
@@ -81,7 +81,7 @@
</object>
</child>
<child>
<object class="HdyViewSwitcherBar" id="switcher_bar">
<object class="AdwViewSwitcherBar" id="switcher_bar">
<property name="visible">True</property>
<property name="stack">main_stack</property>
<property name="reveal" bind-source="title_switcher" bind-property="title-visible" bind-flags="sync-create"/>
@@ -102,7 +102,7 @@
<property name="default-height">200</property>
<signal name="delete-event" handler="gtk_widget_hide_on_delete" object="ussd_dialog" swapped="yes"/>
<child type="titlebar">
<object class="HdyHeaderBar">
<object class="AdwHeaderBar">
<property name="visible">True</property>
<property name="show-close-button">False</property>
<property name="title" translatable="yes">USSD</property>

View File

@@ -2,7 +2,7 @@
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.22"/>
<requires lib="libhandy" version="1.0"/>
<requires lib="libadwaita" version="1.0"/>
<template class="CallsNewCallBox" parent="GtkWidget">
<property name="visible">True</property>
<child>
@@ -14,7 +14,7 @@
<property name="visible">True</property>
<child>
<object class="HdyClamp">
<object class="AdwClamp">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
@@ -27,7 +27,7 @@
<property name="selection-mode">none</property>
<property name="halign">center</property>
<child>
<object class="HdyComboRow" id="origin_list">
<object class="AdwComboRow" id="origin_list">
<property name="visible">True</property>
<signal name="notify::selected-index" handler="notify_selected_index_cb" swapped="yes"/>
</object>
@@ -58,13 +58,13 @@
<property name="margin-top">16</property>
<property name="selection-mode">none</property>
<child>
<object class="HdyActionRow" id="result">
<object class="AdwActionRow" id="result">
<property name="visible">False</property>
<property name="title" bind-source="address_entry" bind-property="text"/>
<property name="width-request">300</property>
<property name="subtitle" translatable="yes">SIP Account</property>
<child type="prefix">
<object class="HdyAvatar">
<object class="AdwAvatar">
<property name="visible">True</property>
<property name="show-initials">True</property>
<property name="size">36</property>