/* Appearance.c generated by valac 0.56.19, the Vala compiler
 * generated from Appearance.vala, do not modify */

/*
 * Copyright © 2025 Alain M. (https://github.com/alainm23/planify)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include <adwaita.h>
#include <glib-object.h>
#include <gee.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include "planify.h"
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE (dialogs_preferences_pages_base_page_get_type ())
#define DIALOGS_PREFERENCES_PAGES_BASE_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE, DialogsPreferencesPagesBasePage))
#define DIALOGS_PREFERENCES_PAGES_BASE_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE, DialogsPreferencesPagesBasePageClass))
#define DIALOGS_PREFERENCES_PAGES_IS_BASE_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE))
#define DIALOGS_PREFERENCES_PAGES_IS_BASE_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE))
#define DIALOGS_PREFERENCES_PAGES_BASE_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE, DialogsPreferencesPagesBasePageClass))

typedef struct _DialogsPreferencesPagesBasePage DialogsPreferencesPagesBasePage;
typedef struct _DialogsPreferencesPagesBasePageClass DialogsPreferencesPagesBasePageClass;
typedef struct _DialogsPreferencesPagesBasePagePrivate DialogsPreferencesPagesBasePagePrivate;

#define DIALOGS_PREFERENCES_PAGES_TYPE_APPEARANCE (dialogs_preferences_pages_appearance_get_type ())
#define DIALOGS_PREFERENCES_PAGES_APPEARANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_APPEARANCE, DialogsPreferencesPagesAppearance))
#define DIALOGS_PREFERENCES_PAGES_APPEARANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_PREFERENCES_PAGES_TYPE_APPEARANCE, DialogsPreferencesPagesAppearanceClass))
#define DIALOGS_PREFERENCES_PAGES_IS_APPEARANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_APPEARANCE))
#define DIALOGS_PREFERENCES_PAGES_IS_APPEARANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_PREFERENCES_PAGES_TYPE_APPEARANCE))
#define DIALOGS_PREFERENCES_PAGES_APPEARANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_PREFERENCES_PAGES_TYPE_APPEARANCE, DialogsPreferencesPagesAppearanceClass))

typedef struct _DialogsPreferencesPagesAppearance DialogsPreferencesPagesAppearance;
typedef struct _DialogsPreferencesPagesAppearanceClass DialogsPreferencesPagesAppearanceClass;
typedef struct _DialogsPreferencesPagesAppearancePrivate DialogsPreferencesPagesAppearancePrivate;
enum  {
	DIALOGS_PREFERENCES_PAGES_APPEARANCE_0_PROPERTY,
	DIALOGS_PREFERENCES_PAGES_APPEARANCE_NUM_PROPERTIES
};
static GParamSpec* dialogs_preferences_pages_appearance_properties[DIALOGS_PREFERENCES_PAGES_APPEARANCE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block100Data Block100Data;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DialogsPreferencesPagesBasePage {
	AdwNavigationPage parent_instance;
	DialogsPreferencesPagesBasePagePrivate * priv;
	GeeHashMap* signal_map;
};

struct _DialogsPreferencesPagesBasePageClass {
	AdwNavigationPageClass parent_class;
	void (*clean_up) (DialogsPreferencesPagesBasePage* self);
};

struct _DialogsPreferencesPagesAppearance {
	DialogsPreferencesPagesBasePage parent_instance;
	DialogsPreferencesPagesAppearancePrivate * priv;
};

struct _DialogsPreferencesPagesAppearanceClass {
	DialogsPreferencesPagesBasePageClass parent_class;
};

struct _DialogsPreferencesPagesAppearancePrivate {
	GtkSwitch* system_appearance_switch;
	GtkSwitch* system_accent_switch;
	AdwActionRow* light_row;
	AdwActionRow* dark_row;
	AdwActionRow* blue_row;
	GtkCheckButton* light_radio;
	GtkCheckButton* dark_radio;
	GtkCheckButton* blue_radio;
	AdwPreferencesGroup* theme_group;
	AdwPreferencesGroup* accent_group;
	GtkRevealer* placeholder_revealer;
};

struct _Block100Data {
	int _ref_count_;
	DialogsPreferencesPagesAppearance* self;
	GtkScale* font_size_scale;
	guint update_timeout_id;
};

static gint DialogsPreferencesPagesAppearance_private_offset;
static gpointer dialogs_preferences_pages_appearance_parent_class = NULL;

VALA_EXTERN GType dialogs_preferences_pages_base_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsPreferencesPagesBasePage, g_object_unref)
VALA_EXTERN GType dialogs_preferences_pages_appearance_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsPreferencesPagesAppearance, g_object_unref)
VALA_EXTERN void dialogs_preferences_pages_base_page_clean_up (DialogsPreferencesPagesBasePage* self);
VALA_EXTERN DialogsPreferencesPagesAppearance* dialogs_preferences_pages_appearance_new (AdwPreferencesDialog* preferences_dialog);
VALA_EXTERN DialogsPreferencesPagesAppearance* dialogs_preferences_pages_appearance_construct (GType object_type,
                                                                                   AdwPreferencesDialog* preferences_dialog);
static void dialogs_preferences_pages_appearance_verify_theme (DialogsPreferencesPagesAppearance* self);
VALA_EXTERN gboolean dialogs_preferences_pages_appearance_is_light_visible (DialogsPreferencesPagesAppearance* self);
VALA_EXTERN gboolean dialogs_preferences_pages_appearance_is_dark_modes_visible (DialogsPreferencesPagesAppearance* self);
VALA_EXTERN gboolean dialogs_preferences_pages_appearance_is_dark_theme (DialogsPreferencesPagesAppearance* self);
static void dialogs_preferences_pages_appearance_real_clean_up (DialogsPreferencesPagesBasePage* base);
static GObject * dialogs_preferences_pages_appearance_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties);
static Block100Data* block100_data_ref (Block100Data* _data100_);
static void block100_data_unref (void * _userdata_);
static void _dialogs_preferences_pages_appearance___lambda348_ (DialogsPreferencesPagesAppearance* self);
static void __dialogs_preferences_pages_appearance___lambda348__g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self);
static void _dialogs_preferences_pages_appearance___lambda349_ (DialogsPreferencesPagesAppearance* self);
static void __dialogs_preferences_pages_appearance___lambda349__g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self);
static void _dialogs_preferences_pages_appearance___lambda350_ (DialogsPreferencesPagesAppearance* self);
static void __dialogs_preferences_pages_appearance___lambda350__g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self);
static void _dialogs_preferences_pages_appearance___lambda351_ (DialogsPreferencesPagesAppearance* self);
static void __dialogs_preferences_pages_appearance___lambda351__g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self);
static void _dialogs_preferences_pages_appearance___lambda352_ (DialogsPreferencesPagesAppearance* self);
static void __dialogs_preferences_pages_appearance___lambda352__g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self);
static void _dialogs_preferences_pages_appearance___lambda353_ (Block100Data* _data100_);
static gboolean __lambda354_ (Block100Data* _data100_);
static gboolean ___lambda354__gsource_func (gpointer self);
static void __dialogs_preferences_pages_appearance___lambda353__gtk_range_value_changed (GtkRange* _sender,
                                                                                  gpointer self);
static void _dialogs_preferences_pages_appearance_verify_theme_g_settings_changed (GSettings* _sender,
                                                                            const gchar* key,
                                                                            gpointer self);
static void _dialogs_preferences_pages_appearance___lambda355_ (DialogsPreferencesPagesAppearance* self);
static void __dialogs_preferences_pages_appearance___lambda355__g_settings_changed (GSettings* _sender,
                                                                             const gchar* key,
                                                                             gpointer self);
static void _dialogs_preferences_pages_appearance___lambda356_ (DialogsPreferencesPagesAppearance* self);
static void __dialogs_preferences_pages_appearance___lambda356__gtk_widget_destroy (GtkWidget* _sender,
                                                                             gpointer self);
static void dialogs_preferences_pages_appearance_finalize (GObject * obj);
static GType dialogs_preferences_pages_appearance_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
dialogs_preferences_pages_appearance_get_instance_private (DialogsPreferencesPagesAppearance* self)
{
	return G_STRUCT_MEMBER_P (self, DialogsPreferencesPagesAppearance_private_offset);
}

DialogsPreferencesPagesAppearance*
dialogs_preferences_pages_appearance_construct (GType object_type,
                                                AdwPreferencesDialog* preferences_dialog)
{
	DialogsPreferencesPagesAppearance * self = NULL;
	g_return_val_if_fail (preferences_dialog != NULL, NULL);
	self = (DialogsPreferencesPagesAppearance*) g_object_new (object_type, "preferences-dialog", preferences_dialog, "title", _ ("Appearance"), NULL);
	return self;
}

DialogsPreferencesPagesAppearance*
dialogs_preferences_pages_appearance_new (AdwPreferencesDialog* preferences_dialog)
{
	return dialogs_preferences_pages_appearance_construct (DIALOGS_PREFERENCES_PAGES_TYPE_APPEARANCE, preferences_dialog);
}

static void
dialogs_preferences_pages_appearance_verify_theme (DialogsPreferencesPagesAppearance* self)
{
	GtkSwitch* _tmp0_;
	ServicesSettings* _tmp1_;
	ServicesSettings* _tmp2_;
	GSettings* _tmp3_;
	AdwActionRow* _tmp4_;
	AdwPreferencesGroup* _tmp5_;
	GtkRevealer* _tmp6_;
	ServicesSettings* _tmp7_;
	ServicesSettings* _tmp8_;
	GSettings* _tmp9_;
	gboolean _tmp10_;
	gint appearance = 0;
	ServicesSettings* _tmp12_;
	ServicesSettings* _tmp13_;
	GSettings* _tmp14_;
	gint _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->system_appearance_switch;
	_tmp1_ = services_settings_get_default ();
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->settings;
	gtk_switch_set_active (_tmp0_, g_settings_get_boolean (_tmp3_, "system-appearance"));
	_g_object_unref0 (_tmp2_);
	_tmp4_ = self->priv->light_row;
	gtk_widget_set_visible ((GtkWidget*) _tmp4_, dialogs_preferences_pages_appearance_is_light_visible (self));
	_tmp5_ = self->priv->theme_group;
	gtk_widget_set_visible ((GtkWidget*) _tmp5_, dialogs_preferences_pages_appearance_is_dark_modes_visible (self));
	_tmp6_ = self->priv->placeholder_revealer;
	gtk_revealer_set_reveal_child (_tmp6_, !dialogs_preferences_pages_appearance_is_dark_modes_visible (self));
	_tmp7_ = services_settings_get_default ();
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_->settings;
	_tmp10_ = !g_settings_get_boolean (_tmp9_, "dark-mode");
	_g_object_unref0 (_tmp8_);
	if (_tmp10_) {
		GtkCheckButton* _tmp11_;
		_tmp11_ = self->priv->light_radio;
		gtk_check_button_set_active (_tmp11_, TRUE);
		return;
	}
	_tmp12_ = services_settings_get_default ();
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp13_->settings;
	_tmp15_ = g_settings_get_enum (_tmp14_, "appearance");
	_g_object_unref0 (_tmp13_);
	appearance = _tmp15_;
	if (appearance == 1) {
		GtkCheckButton* _tmp16_;
		_tmp16_ = self->priv->dark_radio;
		gtk_check_button_set_active (_tmp16_, TRUE);
	} else {
		if (appearance == 2) {
			GtkCheckButton* _tmp17_;
			_tmp17_ = self->priv->blue_radio;
			gtk_check_button_set_active (_tmp17_, TRUE);
		}
	}
}

gboolean
dialogs_preferences_pages_appearance_is_dark_theme (DialogsPreferencesPagesAppearance* self)
{
	gboolean dark_mode = FALSE;
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	gboolean _tmp3_;
	ServicesSettings* _tmp4_;
	ServicesSettings* _tmp5_;
	GSettings* _tmp6_;
	gboolean _tmp7_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = g_settings_get_boolean (_tmp2_, "dark-mode");
	_g_object_unref0 (_tmp1_);
	dark_mode = _tmp3_;
	_tmp4_ = services_settings_get_default ();
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_->settings;
	_tmp7_ = g_settings_get_boolean (_tmp6_, "system-appearance");
	_g_object_unref0 (_tmp5_);
	if (_tmp7_) {
		ColorSchemeSettingsSettings* _tmp8_;
		ColorSchemeSettingsSettingsColorScheme _tmp9_;
		ColorSchemeSettingsSettingsColorScheme _tmp10_;
		_tmp8_ = color_scheme_settings_settings_get_default ();
		_tmp9_ = color_scheme_settings_settings_get_prefers_color_scheme (_tmp8_);
		_tmp10_ = _tmp9_;
		dark_mode = _tmp10_ == COLOR_SCHEME_SETTINGS_SETTINGS_COLOR_SCHEME_DARK;
	}
	result = dark_mode;
	return result;
}

gboolean
dialogs_preferences_pages_appearance_is_light_visible (DialogsPreferencesPagesAppearance* self)
{
	gboolean system_appearance = FALSE;
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = g_settings_get_boolean (_tmp2_, "system-appearance");
	_g_object_unref0 (_tmp1_);
	system_appearance = _tmp3_;
	if (system_appearance) {
		result = !dialogs_preferences_pages_appearance_is_dark_theme (self);
		return result;
	}
	result = TRUE;
	return result;
}

gboolean
dialogs_preferences_pages_appearance_is_dark_modes_visible (DialogsPreferencesPagesAppearance* self)
{
	gboolean system_appearance = FALSE;
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = g_settings_get_boolean (_tmp2_, "system-appearance");
	_g_object_unref0 (_tmp1_);
	system_appearance = _tmp3_;
	if (system_appearance) {
		result = dialogs_preferences_pages_appearance_is_dark_theme (self);
		return result;
	}
	result = TRUE;
	return result;
}

static void
dialogs_preferences_pages_appearance_real_clean_up (DialogsPreferencesPagesBasePage* base)
{
	DialogsPreferencesPagesAppearance * self;
	GeeHashMap* _tmp15_;
	self = (DialogsPreferencesPagesAppearance*) base;
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeMapEntry* _tmp9_;
			gconstpointer _tmp10_;
			gconstpointer _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gconstpointer _tmp14_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp9_ = entry;
			_tmp10_ = gee_map_entry_get_value (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			g_signal_handler_disconnect ((GObject*) _tmp11_, (gulong) ((guintptr) _tmp14_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp15_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp15_);
}

static Block100Data*
block100_data_ref (Block100Data* _data100_)
{
	g_atomic_int_inc (&_data100_->_ref_count_);
	return _data100_;
}

static void
block100_data_unref (void * _userdata_)
{
	Block100Data* _data100_;
	_data100_ = (Block100Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data100_->_ref_count_)) {
		DialogsPreferencesPagesAppearance* self;
		self = _data100_->self;
		_g_object_unref0 (_data100_->font_size_scale);
		_g_object_unref0 (self);
		g_slice_free (Block100Data, _data100_);
	}
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
_dialogs_preferences_pages_appearance___lambda348_ (DialogsPreferencesPagesAppearance* self)
{
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	GtkSwitch* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = self->priv->system_appearance_switch;
	_tmp4_ = gtk_switch_get_active (_tmp3_);
	_tmp5_ = _tmp4_;
	g_settings_set_boolean (_tmp2_, "system-appearance", _tmp5_);
	_g_object_unref0 (_tmp1_);
}

static void
__dialogs_preferences_pages_appearance___lambda348__g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self)
{
	_dialogs_preferences_pages_appearance___lambda348_ ((DialogsPreferencesPagesAppearance*) self);
}

static void
_dialogs_preferences_pages_appearance___lambda349_ (DialogsPreferencesPagesAppearance* self)
{
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	GtkSwitch* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = self->priv->system_accent_switch;
	_tmp4_ = gtk_switch_get_active (_tmp3_);
	_tmp5_ = _tmp4_;
	g_settings_set_boolean (_tmp2_, "use-system-accent", _tmp5_);
	_g_object_unref0 (_tmp1_);
}

static void
__dialogs_preferences_pages_appearance___lambda349__g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self)
{
	_dialogs_preferences_pages_appearance___lambda349_ ((DialogsPreferencesPagesAppearance*) self);
}

static void
_dialogs_preferences_pages_appearance___lambda350_ (DialogsPreferencesPagesAppearance* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->light_radio;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ServicesSettings* _tmp3_;
		ServicesSettings* _tmp4_;
		GSettings* _tmp5_;
		ServicesSettings* _tmp6_;
		ServicesSettings* _tmp7_;
		GSettings* _tmp8_;
		_tmp3_ = services_settings_get_default ();
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_->settings;
		g_settings_set_boolean (_tmp5_, "dark-mode", FALSE);
		_g_object_unref0 (_tmp4_);
		_tmp6_ = services_settings_get_default ();
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_->settings;
		g_settings_set_enum (_tmp8_, "appearance", 0);
		_g_object_unref0 (_tmp7_);
	}
}

static void
__dialogs_preferences_pages_appearance___lambda350__g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self)
{
	_dialogs_preferences_pages_appearance___lambda350_ ((DialogsPreferencesPagesAppearance*) self);
}

static void
_dialogs_preferences_pages_appearance___lambda351_ (DialogsPreferencesPagesAppearance* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->dark_radio;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ServicesSettings* _tmp3_;
		ServicesSettings* _tmp4_;
		GSettings* _tmp5_;
		ServicesSettings* _tmp6_;
		ServicesSettings* _tmp7_;
		GSettings* _tmp8_;
		_tmp3_ = services_settings_get_default ();
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_->settings;
		g_settings_set_boolean (_tmp5_, "dark-mode", TRUE);
		_g_object_unref0 (_tmp4_);
		_tmp6_ = services_settings_get_default ();
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_->settings;
		g_settings_set_enum (_tmp8_, "appearance", 1);
		_g_object_unref0 (_tmp7_);
	}
}

static void
__dialogs_preferences_pages_appearance___lambda351__g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self)
{
	_dialogs_preferences_pages_appearance___lambda351_ ((DialogsPreferencesPagesAppearance*) self);
}

static void
_dialogs_preferences_pages_appearance___lambda352_ (DialogsPreferencesPagesAppearance* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->blue_radio;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ServicesSettings* _tmp3_;
		ServicesSettings* _tmp4_;
		GSettings* _tmp5_;
		ServicesSettings* _tmp6_;
		ServicesSettings* _tmp7_;
		GSettings* _tmp8_;
		_tmp3_ = services_settings_get_default ();
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_->settings;
		g_settings_set_boolean (_tmp5_, "dark-mode", TRUE);
		_g_object_unref0 (_tmp4_);
		_tmp6_ = services_settings_get_default ();
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_->settings;
		g_settings_set_enum (_tmp8_, "appearance", 2);
		_g_object_unref0 (_tmp7_);
	}
}

static void
__dialogs_preferences_pages_appearance___lambda352__g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self)
{
	_dialogs_preferences_pages_appearance___lambda352_ ((DialogsPreferencesPagesAppearance*) self);
}

static gboolean
__lambda354_ (Block100Data* _data100_)
{
	DialogsPreferencesPagesAppearance* self;
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	GtkScale* _tmp3_;
	gboolean result;
	self = _data100_->self;
	_data100_->update_timeout_id = (guint) 0;
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = _data100_->font_size_scale;
	g_settings_set_double (_tmp2_, "font-scale", gtk_range_get_value ((GtkRange*) _tmp3_));
	_g_object_unref0 (_tmp1_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda354__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda354_ (self);
	return result;
}

static void
_dialogs_preferences_pages_appearance___lambda353_ (Block100Data* _data100_)
{
	DialogsPreferencesPagesAppearance* self;
	self = _data100_->self;
	if (_data100_->update_timeout_id != ((guint) 0)) {
		g_source_remove (_data100_->update_timeout_id);
	}
	_data100_->update_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 300, ___lambda354__gsource_func, block100_data_ref (_data100_), block100_data_unref);
}

static void
__dialogs_preferences_pages_appearance___lambda353__gtk_range_value_changed (GtkRange* _sender,
                                                                             gpointer self)
{
	_dialogs_preferences_pages_appearance___lambda353_ (self);
}

static void
_dialogs_preferences_pages_appearance_verify_theme_g_settings_changed (GSettings* _sender,
                                                                       const gchar* key,
                                                                       gpointer self)
{
	dialogs_preferences_pages_appearance_verify_theme ((DialogsPreferencesPagesAppearance*) self);
}

static void
_dialogs_preferences_pages_appearance___lambda355_ (DialogsPreferencesPagesAppearance* self)
{
	Util* _tmp0_;
	Util* _tmp1_;
	_tmp0_ = util_get_default ();
	_tmp1_ = _tmp0_;
	util_update_theme (_tmp1_);
	_g_object_unref0 (_tmp1_);
}

static void
__dialogs_preferences_pages_appearance___lambda355__g_settings_changed (GSettings* _sender,
                                                                        const gchar* key,
                                                                        gpointer self)
{
	_dialogs_preferences_pages_appearance___lambda355_ ((DialogsPreferencesPagesAppearance*) self);
}

static void
_dialogs_preferences_pages_appearance___lambda356_ (DialogsPreferencesPagesAppearance* self)
{
	dialogs_preferences_pages_base_page_clean_up ((DialogsPreferencesPagesBasePage*) self);
}

static void
__dialogs_preferences_pages_appearance___lambda356__gtk_widget_destroy (GtkWidget* _sender,
                                                                        gpointer self)
{
	_dialogs_preferences_pages_appearance___lambda356_ ((DialogsPreferencesPagesAppearance*) self);
}

static GObject *
dialogs_preferences_pages_appearance_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DialogsPreferencesPagesAppearance * self;
	Block100Data* _data100_;
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	GtkSwitch* _tmp3_ = NULL;
	AdwActionRow* system_appearance_row = NULL;
	gchar* _tmp4_;
	AdwActionRow* _tmp5_ = NULL;
	AdwActionRow* _tmp6_;
	GtkImage* _tmp7_ = NULL;
	GtkImage* _tmp8_;
	AdwActionRow* _tmp9_;
	GtkSwitch* _tmp10_;
	AdwActionRow* _tmp11_;
	GtkSwitch* _tmp12_;
	ServicesSettings* _tmp13_;
	ServicesSettings* _tmp14_;
	GSettings* _tmp15_;
	GtkSwitch* _tmp16_ = NULL;
	AdwActionRow* system_accent_row = NULL;
	gchar* _tmp17_;
	AdwActionRow* _tmp18_ = NULL;
	AdwActionRow* _tmp19_;
	GtkImage* _tmp20_ = NULL;
	GtkImage* _tmp21_;
	AdwActionRow* _tmp22_;
	GtkSwitch* _tmp23_;
	AdwActionRow* _tmp24_;
	GtkSwitch* _tmp25_;
	AdwPreferencesGroup* system_appearance_group = NULL;
	gchar* _tmp26_;
	AdwPreferencesGroup* _tmp27_ = NULL;
	AdwPreferencesGroup* _tmp28_;
	AdwActionRow* _tmp29_;
	GtkCheckButton* _tmp30_ = NULL;
	gchar* _tmp31_;
	gchar* _tmp32_;
	GtkCheckButton* _tmp33_;
	GtkWidget* _tmp34_;
	AdwActionRow* _tmp35_ = NULL;
	AdwActionRow* _tmp36_;
	GtkImage* _tmp37_;
	GtkImage* _tmp38_;
	GdkPaintable* _tmp39_;
	GdkPaintable* _tmp40_;
	gchar* _tmp41_;
	gchar** _tmp42_;
	AdwAvatar* _tmp43_ = NULL;
	AdwAvatar* _tmp44_;
	AdwActionRow* _tmp45_;
	GtkCheckButton* _tmp46_;
	GtkCheckButton* _tmp47_;
	GtkCheckButton* _tmp48_;
	GtkCheckButton* _tmp49_ = NULL;
	gchar* _tmp50_;
	gchar* _tmp51_;
	GtkCheckButton* _tmp52_;
	GtkWidget* _tmp53_;
	AdwActionRow* _tmp54_ = NULL;
	AdwActionRow* _tmp55_;
	GtkImage* _tmp56_;
	GtkImage* _tmp57_;
	GdkPaintable* _tmp58_;
	GdkPaintable* _tmp59_;
	gchar* _tmp60_;
	gchar** _tmp61_;
	AdwAvatar* _tmp62_ = NULL;
	AdwAvatar* _tmp63_;
	AdwActionRow* _tmp64_;
	GtkCheckButton* _tmp65_;
	GtkCheckButton* _tmp66_;
	GtkCheckButton* _tmp67_;
	GtkCheckButton* _tmp68_ = NULL;
	gchar* _tmp69_;
	gchar* _tmp70_;
	GtkCheckButton* _tmp71_;
	GtkWidget* _tmp72_;
	AdwActionRow* _tmp73_ = NULL;
	AdwActionRow* _tmp74_;
	GtkImage* _tmp75_;
	GtkImage* _tmp76_;
	GdkPaintable* _tmp77_;
	GdkPaintable* _tmp78_;
	gchar* _tmp79_;
	gchar** _tmp80_;
	AdwAvatar* _tmp81_ = NULL;
	AdwAvatar* _tmp82_;
	AdwActionRow* _tmp83_;
	GtkCheckButton* _tmp84_;
	AdwPreferencesGroup* _tmp85_;
	AdwPreferencesGroup* _tmp86_;
	AdwActionRow* _tmp87_;
	AdwPreferencesGroup* _tmp88_;
	AdwActionRow* _tmp89_;
	AdwPreferencesGroup* _tmp90_;
	AdwActionRow* _tmp91_;
	gchar* _tmp92_;
	AdwPreferencesGroup* _tmp93_ = NULL;
	AdwPreferencesGroup* _tmp94_;
	AdwActionRow* _tmp95_;
	AdwPreferencesGroup* _tmp96_;
	AdwStyleManager* _tmp97_;
	GtkLabel* _tmp98_ = NULL;
	GtkRevealer* _tmp99_ = NULL;
	GtkScale* _tmp100_ = NULL;
	GtkScale* _tmp101_;
	ServicesSettings* _tmp102_;
	ServicesSettings* _tmp103_;
	GtkScale* _tmp104_;
	GtkBox* font_size_box = NULL;
	GtkBox* _tmp105_ = NULL;
	GtkBox* _tmp106_;
	GtkImage* _tmp107_ = NULL;
	GtkImage* _tmp108_;
	GtkBox* _tmp109_;
	GtkScale* _tmp110_;
	GtkBox* _tmp111_;
	GtkImage* _tmp112_ = NULL;
	GtkImage* _tmp113_;
	AdwActionRow* font_size_row = NULL;
	GtkScale* _tmp114_;
	GtkWidget* _tmp115_;
	GtkBox* _tmp116_;
	GtkWidget* _tmp117_;
	AdwActionRow* _tmp118_ = NULL;
	AdwPreferencesGroup* font_size_group = NULL;
	gchar* _tmp119_;
	AdwPreferencesGroup* _tmp120_ = NULL;
	AdwPreferencesGroup* _tmp121_;
	AdwActionRow* _tmp122_;
	GtkBox* content_box = NULL;
	GtkBox* _tmp123_ = NULL;
	GtkBox* _tmp124_;
	AdwPreferencesGroup* _tmp125_;
	GtkBox* _tmp126_;
	AdwPreferencesGroup* _tmp127_;
	GtkBox* _tmp128_;
	GtkRevealer* _tmp129_;
	GtkBox* _tmp130_;
	AdwPreferencesGroup* _tmp131_;
	GtkBox* _tmp132_;
	AdwPreferencesGroup* _tmp133_;
	AdwToolbarView* toolbar_view = NULL;
	GtkBox* _tmp134_;
	GtkWidget* _tmp135_;
	AdwToolbarView* _tmp136_ = NULL;
	AdwToolbarView* _tmp137_;
	AdwHeaderBar* _tmp138_;
	AdwHeaderBar* _tmp139_;
	AdwToolbarView* _tmp140_;
	GeeHashMap* _tmp141_;
	GtkSwitch* _tmp142_;
	gulong _tmp143_;
	GtkSwitch* _tmp144_;
	GeeHashMap* _tmp145_;
	GtkSwitch* _tmp146_;
	gulong _tmp147_;
	GtkSwitch* _tmp148_;
	GeeHashMap* _tmp149_;
	GtkCheckButton* _tmp150_;
	gulong _tmp151_;
	GtkCheckButton* _tmp152_;
	GeeHashMap* _tmp153_;
	GtkCheckButton* _tmp154_;
	gulong _tmp155_;
	GtkCheckButton* _tmp156_;
	GeeHashMap* _tmp157_;
	GtkCheckButton* _tmp158_;
	gulong _tmp159_;
	GtkCheckButton* _tmp160_;
	GeeHashMap* _tmp161_;
	GtkScale* _tmp162_;
	gulong _tmp163_;
	GtkScale* _tmp164_;
	GeeHashMap* _tmp165_;
	ServicesSettings* _tmp166_;
	ServicesSettings* _tmp167_;
	GSettings* _tmp168_;
	gulong _tmp169_;
	ServicesSettings* _tmp170_;
	ServicesSettings* _tmp171_;
	GeeHashMap* _tmp172_;
	ServicesSettings* _tmp173_;
	ServicesSettings* _tmp174_;
	GSettings* _tmp175_;
	gulong _tmp176_;
	ServicesSettings* _tmp177_;
	ServicesSettings* _tmp178_;
	GeeHashMap* _tmp179_;
	ServicesSettings* _tmp180_;
	ServicesSettings* _tmp181_;
	GSettings* _tmp182_;
	gulong _tmp183_;
	ServicesSettings* _tmp184_;
	ServicesSettings* _tmp185_;
	parent_class = G_OBJECT_CLASS (dialogs_preferences_pages_appearance_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_PREFERENCES_PAGES_TYPE_APPEARANCE, DialogsPreferencesPagesAppearance);
	_data100_ = g_slice_new0 (Block100Data);
	_data100_->_ref_count_ = 1;
	_data100_->self = g_object_ref (self);
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp3_, GTK_ALIGN_CENTER);
	gtk_switch_set_active (_tmp3_, g_settings_get_boolean (_tmp2_, "system-appearance"));
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->system_appearance_switch);
	self->priv->system_appearance_switch = _tmp3_;
	_g_object_unref0 (_tmp1_);
	_tmp4_ = g_strdup (_ ("Use System Settings"));
	_tmp5_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp5_, _tmp4_);
	_g_free0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	system_appearance_row = _tmp5_;
	_tmp6_ = system_appearance_row;
	_tmp7_ = (GtkImage*) gtk_image_new_from_icon_name ("computer-symbolic");
	gtk_image_set_pixel_size (_tmp7_, 16);
	g_object_ref_sink (_tmp7_);
	_tmp8_ = _tmp7_;
	adw_action_row_add_prefix (_tmp6_, (GtkWidget*) _tmp8_);
	_g_object_unref0 (_tmp8_);
	_tmp9_ = system_appearance_row;
	_tmp10_ = self->priv->system_appearance_switch;
	adw_action_row_set_activatable_widget (_tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = system_appearance_row;
	_tmp12_ = self->priv->system_appearance_switch;
	adw_action_row_add_suffix (_tmp11_, (GtkWidget*) _tmp12_);
	_tmp13_ = services_settings_get_default ();
	_tmp14_ = _tmp13_;
	_tmp15_ = _tmp14_->settings;
	_tmp16_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp16_, GTK_ALIGN_CENTER);
	gtk_switch_set_active (_tmp16_, g_settings_get_boolean (_tmp15_, "use-system-accent"));
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->system_accent_switch);
	self->priv->system_accent_switch = _tmp16_;
	_g_object_unref0 (_tmp14_);
	_tmp17_ = g_strdup (_ ("Use System Accent Color"));
	_tmp18_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp18_, _tmp17_);
	_g_free0 (_tmp17_);
	g_object_ref_sink (_tmp18_);
	system_accent_row = _tmp18_;
	_tmp19_ = system_accent_row;
	_tmp20_ = (GtkImage*) gtk_image_new_from_icon_name ("color-symbolic");
	gtk_image_set_pixel_size (_tmp20_, 16);
	g_object_ref_sink (_tmp20_);
	_tmp21_ = _tmp20_;
	adw_action_row_add_prefix (_tmp19_, (GtkWidget*) _tmp21_);
	_g_object_unref0 (_tmp21_);
	_tmp22_ = system_accent_row;
	_tmp23_ = self->priv->system_accent_switch;
	adw_action_row_set_activatable_widget (_tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = system_accent_row;
	_tmp25_ = self->priv->system_accent_switch;
	adw_action_row_add_suffix (_tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = g_strdup (_ ("Select theme"));
	_tmp27_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp27_, _tmp26_);
	_g_free0 (_tmp26_);
	g_object_ref_sink (_tmp27_);
	system_appearance_group = _tmp27_;
	_tmp28_ = system_appearance_group;
	_tmp29_ = system_appearance_row;
	adw_preferences_group_add (_tmp28_, (GtkWidget*) _tmp29_);
	_tmp30_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp30_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->priv->light_radio);
	self->priv->light_radio = _tmp30_;
	_tmp31_ = g_strdup (_ ("Light Style"));
	_tmp32_ = g_strdup (_ ("Clean light theme"));
	_tmp33_ = self->priv->light_radio;
	_tmp34_ = _g_object_ref0 ((GtkWidget*) _tmp33_);
	_tmp35_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp35_, _tmp31_);
	_g_free0 (_tmp31_);
	adw_action_row_set_subtitle (_tmp35_, _tmp32_);
	_g_free0 (_tmp32_);
	adw_action_row_set_activatable_widget (_tmp35_, _tmp34_);
	_g_object_unref0 (_tmp34_);
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (self->priv->light_row);
	self->priv->light_row = _tmp35_;
	_tmp36_ = self->priv->light_row;
	_tmp37_ = (GtkImage*) gtk_image_new_from_resource ("/io/github/alainm23/planify/light-mode.svg");
	g_object_ref_sink (_tmp37_);
	_tmp38_ = _tmp37_;
	_tmp39_ = gtk_image_get_paintable (_tmp38_);
	_tmp40_ = _g_object_ref0 (_tmp39_);
	_tmp41_ = g_strdup ("theme-mode-image");
	_tmp42_ = g_new0 (gchar*, 1 + 1);
	_tmp42_[0] = _tmp41_;
	_tmp43_ = (AdwAvatar*) adw_avatar_new (32, NULL, TRUE);
	adw_avatar_set_custom_image (_tmp43_, _tmp40_);
	_g_object_unref0 (_tmp40_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp43_, _tmp42_);
	_tmp42_ = (_vala_array_free (_tmp42_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp43_);
	_tmp44_ = _tmp43_;
	adw_action_row_add_prefix (_tmp36_, (GtkWidget*) _tmp44_);
	_g_object_unref0 (_tmp44_);
	_g_object_unref0 (_tmp38_);
	_tmp45_ = self->priv->light_row;
	_tmp46_ = self->priv->light_radio;
	adw_action_row_add_suffix (_tmp45_, (GtkWidget*) _tmp46_);
	_tmp47_ = self->priv->light_radio;
	_tmp48_ = _g_object_ref0 (_tmp47_);
	_tmp49_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp49_, _tmp48_);
	_g_object_unref0 (_tmp48_);
	gtk_widget_set_valign ((GtkWidget*) _tmp49_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp49_);
	_g_object_unref0 (self->priv->dark_radio);
	self->priv->dark_radio = _tmp49_;
	_tmp50_ = g_strdup (_ ("Dark Style"));
	_tmp51_ = g_strdup (_ ("Elegant dark theme"));
	_tmp52_ = self->priv->dark_radio;
	_tmp53_ = _g_object_ref0 ((GtkWidget*) _tmp52_);
	_tmp54_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp54_, _tmp50_);
	_g_free0 (_tmp50_);
	adw_action_row_set_subtitle (_tmp54_, _tmp51_);
	_g_free0 (_tmp51_);
	adw_action_row_set_activatable_widget (_tmp54_, _tmp53_);
	_g_object_unref0 (_tmp53_);
	g_object_ref_sink (_tmp54_);
	_g_object_unref0 (self->priv->dark_row);
	self->priv->dark_row = _tmp54_;
	_tmp55_ = self->priv->dark_row;
	_tmp56_ = (GtkImage*) gtk_image_new_from_resource ("/io/github/alainm23/planify/dark-mode.svg");
	g_object_ref_sink (_tmp56_);
	_tmp57_ = _tmp56_;
	_tmp58_ = gtk_image_get_paintable (_tmp57_);
	_tmp59_ = _g_object_ref0 (_tmp58_);
	_tmp60_ = g_strdup ("theme-mode-image");
	_tmp61_ = g_new0 (gchar*, 1 + 1);
	_tmp61_[0] = _tmp60_;
	_tmp62_ = (AdwAvatar*) adw_avatar_new (32, NULL, TRUE);
	adw_avatar_set_custom_image (_tmp62_, _tmp59_);
	_g_object_unref0 (_tmp59_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp62_, _tmp61_);
	_tmp61_ = (_vala_array_free (_tmp61_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp62_);
	_tmp63_ = _tmp62_;
	adw_action_row_add_prefix (_tmp55_, (GtkWidget*) _tmp63_);
	_g_object_unref0 (_tmp63_);
	_g_object_unref0 (_tmp57_);
	_tmp64_ = self->priv->dark_row;
	_tmp65_ = self->priv->dark_radio;
	adw_action_row_add_suffix (_tmp64_, (GtkWidget*) _tmp65_);
	_tmp66_ = self->priv->light_radio;
	_tmp67_ = _g_object_ref0 (_tmp66_);
	_tmp68_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_check_button_set_group (_tmp68_, _tmp67_);
	_g_object_unref0 (_tmp67_);
	gtk_widget_set_valign ((GtkWidget*) _tmp68_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp68_);
	_g_object_unref0 (self->priv->blue_radio);
	self->priv->blue_radio = _tmp68_;
	_tmp69_ = g_strdup (_ ("Dark Blue Style"));
	_tmp70_ = g_strdup (_ ("Professional blue theme"));
	_tmp71_ = self->priv->blue_radio;
	_tmp72_ = _g_object_ref0 ((GtkWidget*) _tmp71_);
	_tmp73_ = (AdwActionRow*) adw_action_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp73_, _tmp69_);
	_g_free0 (_tmp69_);
	adw_action_row_set_subtitle (_tmp73_, _tmp70_);
	_g_free0 (_tmp70_);
	adw_action_row_set_activatable_widget (_tmp73_, _tmp72_);
	_g_object_unref0 (_tmp72_);
	g_object_ref_sink (_tmp73_);
	_g_object_unref0 (self->priv->blue_row);
	self->priv->blue_row = _tmp73_;
	_tmp74_ = self->priv->blue_row;
	_tmp75_ = (GtkImage*) gtk_image_new_from_resource ("/io/github/alainm23/planify/blue-mode.svg");
	g_object_ref_sink (_tmp75_);
	_tmp76_ = _tmp75_;
	_tmp77_ = gtk_image_get_paintable (_tmp76_);
	_tmp78_ = _g_object_ref0 (_tmp77_);
	_tmp79_ = g_strdup ("theme-mode-image");
	_tmp80_ = g_new0 (gchar*, 1 + 1);
	_tmp80_[0] = _tmp79_;
	_tmp81_ = (AdwAvatar*) adw_avatar_new (32, NULL, TRUE);
	adw_avatar_set_custom_image (_tmp81_, _tmp78_);
	_g_object_unref0 (_tmp78_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp81_, _tmp80_);
	_tmp80_ = (_vala_array_free (_tmp80_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp81_);
	_tmp82_ = _tmp81_;
	adw_action_row_add_prefix (_tmp74_, (GtkWidget*) _tmp82_);
	_g_object_unref0 (_tmp82_);
	_g_object_unref0 (_tmp76_);
	_tmp83_ = self->priv->blue_row;
	_tmp84_ = self->priv->blue_radio;
	adw_action_row_add_suffix (_tmp83_, (GtkWidget*) _tmp84_);
	_tmp85_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	g_object_ref_sink (_tmp85_);
	_g_object_unref0 (self->priv->theme_group);
	self->priv->theme_group = _tmp85_;
	_tmp86_ = self->priv->theme_group;
	_tmp87_ = self->priv->light_row;
	adw_preferences_group_add (_tmp86_, (GtkWidget*) _tmp87_);
	_tmp88_ = self->priv->theme_group;
	_tmp89_ = self->priv->dark_row;
	adw_preferences_group_add (_tmp88_, (GtkWidget*) _tmp89_);
	_tmp90_ = self->priv->theme_group;
	_tmp91_ = self->priv->blue_row;
	adw_preferences_group_add (_tmp90_, (GtkWidget*) _tmp91_);
	_tmp92_ = g_strdup (_ ("Accent Color"));
	_tmp93_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp93_, _tmp92_);
	_g_free0 (_tmp92_);
	g_object_ref_sink (_tmp93_);
	_g_object_unref0 (self->priv->accent_group);
	self->priv->accent_group = _tmp93_;
	_tmp94_ = self->priv->accent_group;
	_tmp95_ = system_accent_row;
	adw_preferences_group_add (_tmp94_, (GtkWidget*) _tmp95_);
	_tmp96_ = self->priv->accent_group;
	_tmp97_ = adw_style_manager_get_default ();
	gtk_widget_set_visible ((GtkWidget*) _tmp96_, adw_style_manager_get_system_supports_accent_colors (_tmp97_));
	_tmp98_ = (GtkLabel*) gtk_label_new (_ ("Custom themes are not available when using the system light theme"));
	gtk_label_set_wrap (_tmp98_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp98_, GTK_ALIGN_CENTER);
	gtk_label_set_justify (_tmp98_, GTK_JUSTIFY_CENTER);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp98_, 12);
	g_object_ref_sink (_tmp98_);
	_tmp99_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp99_, (GtkWidget*) _tmp98_);
	_g_object_unref0 (_tmp98_);
	g_object_ref_sink (_tmp99_);
	_g_object_unref0 (self->priv->placeholder_revealer);
	self->priv->placeholder_revealer = _tmp99_;
	_tmp100_ = (GtkScale*) gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0.5, (gdouble) 2, 0.1);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp100_, TRUE);
	gtk_scale_set_draw_value (_tmp100_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp100_, 9);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp100_, 6);
	gtk_scale_set_value_pos (_tmp100_, GTK_POS_RIGHT);
	g_object_ref_sink (_tmp100_);
	_data100_->font_size_scale = _tmp100_;
	_tmp101_ = _data100_->font_size_scale;
	_tmp102_ = services_settings_get_default ();
	_tmp103_ = _tmp102_;
	gtk_range_set_value ((GtkRange*) _tmp101_, services_settings_get_double (_tmp103_, "font-scale"));
	_g_object_unref0 (_tmp103_);
	_tmp104_ = _data100_->font_size_scale;
	gtk_scale_add_mark (_tmp104_, (gdouble) 1, GTK_POS_LEFT, NULL);
	_tmp105_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	gtk_widget_set_valign ((GtkWidget*) _tmp105_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp105_, TRUE);
	g_object_ref_sink (_tmp105_);
	font_size_box = _tmp105_;
	_tmp106_ = font_size_box;
	_tmp107_ = (GtkImage*) gtk_image_new_from_icon_name ("text-bold-symbolic");
	gtk_image_set_pixel_size (_tmp107_, 16);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp107_, 12);
	g_object_ref_sink (_tmp107_);
	_tmp108_ = _tmp107_;
	gtk_box_append (_tmp106_, (GtkWidget*) _tmp108_);
	_g_object_unref0 (_tmp108_);
	_tmp109_ = font_size_box;
	_tmp110_ = _data100_->font_size_scale;
	gtk_box_append (_tmp109_, (GtkWidget*) _tmp110_);
	_tmp111_ = font_size_box;
	_tmp112_ = (GtkImage*) gtk_image_new_from_icon_name ("text-bold-symbolic");
	gtk_image_set_pixel_size (_tmp112_, 24);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp112_, 12);
	g_object_ref_sink (_tmp112_);
	_tmp113_ = _tmp112_;
	gtk_box_append (_tmp111_, (GtkWidget*) _tmp113_);
	_g_object_unref0 (_tmp113_);
	_tmp114_ = _data100_->font_size_scale;
	_tmp115_ = _g_object_ref0 ((GtkWidget*) _tmp114_);
	_tmp116_ = font_size_box;
	_tmp117_ = _g_object_ref0 ((GtkWidget*) _tmp116_);
	_tmp118_ = (AdwActionRow*) adw_action_row_new ();
	adw_action_row_set_activatable_widget (_tmp118_, _tmp115_);
	_g_object_unref0 (_tmp115_);
	gtk_list_box_row_set_child ((GtkListBoxRow*) _tmp118_, _tmp117_);
	_g_object_unref0 (_tmp117_);
	g_object_ref_sink (_tmp118_);
	font_size_row = _tmp118_;
	_tmp119_ = g_strdup (_ ("Font Size"));
	_tmp120_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	adw_preferences_group_set_title (_tmp120_, _tmp119_);
	_g_free0 (_tmp119_);
	g_object_ref_sink (_tmp120_);
	font_size_group = _tmp120_;
	_tmp121_ = font_size_group;
	_tmp122_ = font_size_row;
	adw_preferences_group_add (_tmp121_, (GtkWidget*) _tmp122_);
	_tmp123_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp123_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp123_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp123_, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp123_, 6);
	g_object_ref_sink (_tmp123_);
	content_box = _tmp123_;
	_tmp124_ = content_box;
	_tmp125_ = system_appearance_group;
	gtk_box_append (_tmp124_, (GtkWidget*) _tmp125_);
	_tmp126_ = content_box;
	_tmp127_ = self->priv->theme_group;
	gtk_box_append (_tmp126_, (GtkWidget*) _tmp127_);
	_tmp128_ = content_box;
	_tmp129_ = self->priv->placeholder_revealer;
	gtk_box_append (_tmp128_, (GtkWidget*) _tmp129_);
	_tmp130_ = content_box;
	_tmp131_ = self->priv->accent_group;
	gtk_box_append (_tmp130_, (GtkWidget*) _tmp131_);
	_tmp132_ = content_box;
	_tmp133_ = font_size_group;
	gtk_box_append (_tmp132_, (GtkWidget*) _tmp133_);
	_tmp134_ = content_box;
	_tmp135_ = _g_object_ref0 ((GtkWidget*) _tmp134_);
	_tmp136_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_content (_tmp136_, _tmp135_);
	_g_object_unref0 (_tmp135_);
	g_object_ref_sink (_tmp136_);
	toolbar_view = _tmp136_;
	_tmp137_ = toolbar_view;
	_tmp138_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp138_);
	_tmp139_ = _tmp138_;
	adw_toolbar_view_add_top_bar (_tmp137_, (GtkWidget*) _tmp139_);
	_g_object_unref0 (_tmp139_);
	_tmp140_ = toolbar_view;
	adw_navigation_page_set_child ((AdwNavigationPage*) self, (GtkWidget*) _tmp140_);
	dialogs_preferences_pages_appearance_verify_theme (self);
	_tmp141_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp142_ = self->priv->system_appearance_switch;
	_tmp143_ = g_signal_connect_object ((GObject*) _tmp142_, "notify::active", (GCallback) __dialogs_preferences_pages_appearance___lambda348__g_object_notify, self, 0);
	_tmp144_ = self->priv->system_appearance_switch;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp141_, (gpointer) ((guintptr) _tmp143_), (GObject*) _tmp144_);
	_tmp145_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp146_ = self->priv->system_accent_switch;
	_tmp147_ = g_signal_connect_object ((GObject*) _tmp146_, "notify::active", (GCallback) __dialogs_preferences_pages_appearance___lambda349__g_object_notify, self, 0);
	_tmp148_ = self->priv->system_accent_switch;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp145_, (gpointer) ((guintptr) _tmp147_), (GObject*) _tmp148_);
	_tmp149_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp150_ = self->priv->light_radio;
	_tmp151_ = g_signal_connect_object ((GObject*) _tmp150_, "notify::active", (GCallback) __dialogs_preferences_pages_appearance___lambda350__g_object_notify, self, 0);
	_tmp152_ = self->priv->light_radio;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp149_, (gpointer) ((guintptr) _tmp151_), (GObject*) _tmp152_);
	_tmp153_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp154_ = self->priv->dark_radio;
	_tmp155_ = g_signal_connect_object ((GObject*) _tmp154_, "notify::active", (GCallback) __dialogs_preferences_pages_appearance___lambda351__g_object_notify, self, 0);
	_tmp156_ = self->priv->dark_radio;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp153_, (gpointer) ((guintptr) _tmp155_), (GObject*) _tmp156_);
	_tmp157_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp158_ = self->priv->blue_radio;
	_tmp159_ = g_signal_connect_object ((GObject*) _tmp158_, "notify::active", (GCallback) __dialogs_preferences_pages_appearance___lambda352__g_object_notify, self, 0);
	_tmp160_ = self->priv->blue_radio;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp157_, (gpointer) ((guintptr) _tmp159_), (GObject*) _tmp160_);
	_data100_->update_timeout_id = (guint) 0;
	_tmp161_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp162_ = _data100_->font_size_scale;
	_tmp163_ = g_signal_connect_data ((GtkRange*) _tmp162_, "value-changed", (GCallback) __dialogs_preferences_pages_appearance___lambda353__gtk_range_value_changed, block100_data_ref (_data100_), (GClosureNotify) block100_data_unref, 0);
	_tmp164_ = _data100_->font_size_scale;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp161_, (gpointer) ((guintptr) _tmp163_), (GObject*) _tmp164_);
	_tmp165_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp166_ = services_settings_get_default ();
	_tmp167_ = _tmp166_;
	_tmp168_ = _tmp167_->settings;
	_tmp169_ = g_signal_connect_object (_tmp168_, "changed::system-appearance", (GCallback) _dialogs_preferences_pages_appearance_verify_theme_g_settings_changed, self, 0);
	_tmp170_ = services_settings_get_default ();
	_tmp171_ = _tmp170_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp165_, (gpointer) ((guintptr) _tmp169_), (GObject*) _tmp171_);
	_g_object_unref0 (_tmp171_);
	_g_object_unref0 (_tmp167_);
	_tmp172_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp173_ = services_settings_get_default ();
	_tmp174_ = _tmp173_;
	_tmp175_ = _tmp174_->settings;
	_tmp176_ = g_signal_connect_object (_tmp175_, "changed::dark-mode", (GCallback) _dialogs_preferences_pages_appearance_verify_theme_g_settings_changed, self, 0);
	_tmp177_ = services_settings_get_default ();
	_tmp178_ = _tmp177_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp172_, (gpointer) ((guintptr) _tmp176_), (GObject*) _tmp178_);
	_g_object_unref0 (_tmp178_);
	_g_object_unref0 (_tmp174_);
	_tmp179_ = ((DialogsPreferencesPagesBasePage*) self)->signal_map;
	_tmp180_ = services_settings_get_default ();
	_tmp181_ = _tmp180_;
	_tmp182_ = _tmp181_->settings;
	_tmp183_ = g_signal_connect_object (_tmp182_, "changed::use-system-accent", (GCallback) __dialogs_preferences_pages_appearance___lambda355__g_settings_changed, self, 0);
	_tmp184_ = services_settings_get_default ();
	_tmp185_ = _tmp184_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp179_, (gpointer) ((guintptr) _tmp183_), (GObject*) _tmp185_);
	_g_object_unref0 (_tmp185_);
	_g_object_unref0 (_tmp181_);
	g_signal_connect_object ((GtkWidget*) self, "destroy", (GCallback) __dialogs_preferences_pages_appearance___lambda356__gtk_widget_destroy, self, 0);
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (content_box);
	_g_object_unref0 (font_size_group);
	_g_object_unref0 (font_size_row);
	_g_object_unref0 (font_size_box);
	_g_object_unref0 (system_appearance_group);
	_g_object_unref0 (system_accent_row);
	_g_object_unref0 (system_appearance_row);
	block100_data_unref (_data100_);
	_data100_ = NULL;
	return obj;
}

static void
dialogs_preferences_pages_appearance_class_init (DialogsPreferencesPagesAppearanceClass * klass,
                                                 gpointer klass_data)
{
	dialogs_preferences_pages_appearance_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DialogsPreferencesPagesAppearance_private_offset);
	((DialogsPreferencesPagesBasePageClass *) klass)->clean_up = (void (*) (DialogsPreferencesPagesBasePage*)) dialogs_preferences_pages_appearance_real_clean_up;
	G_OBJECT_CLASS (klass)->constructor = dialogs_preferences_pages_appearance_constructor;
	G_OBJECT_CLASS (klass)->finalize = dialogs_preferences_pages_appearance_finalize;
}

static void
dialogs_preferences_pages_appearance_instance_init (DialogsPreferencesPagesAppearance * self,
                                                    gpointer klass)
{
	self->priv = dialogs_preferences_pages_appearance_get_instance_private (self);
}

static void
dialogs_preferences_pages_appearance_finalize (GObject * obj)
{
	DialogsPreferencesPagesAppearance * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_PREFERENCES_PAGES_TYPE_APPEARANCE, DialogsPreferencesPagesAppearance);
	g_debug ("Appearance.vala:43: Destroying - Dialogs.Preferences.Pages.Appearance\n");
	_g_object_unref0 (self->priv->system_appearance_switch);
	_g_object_unref0 (self->priv->system_accent_switch);
	_g_object_unref0 (self->priv->light_row);
	_g_object_unref0 (self->priv->dark_row);
	_g_object_unref0 (self->priv->blue_row);
	_g_object_unref0 (self->priv->light_radio);
	_g_object_unref0 (self->priv->dark_radio);
	_g_object_unref0 (self->priv->blue_radio);
	_g_object_unref0 (self->priv->theme_group);
	_g_object_unref0 (self->priv->accent_group);
	_g_object_unref0 (self->priv->placeholder_revealer);
	G_OBJECT_CLASS (dialogs_preferences_pages_appearance_parent_class)->finalize (obj);
}

static GType
dialogs_preferences_pages_appearance_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DialogsPreferencesPagesAppearanceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dialogs_preferences_pages_appearance_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DialogsPreferencesPagesAppearance), 0, (GInstanceInitFunc) dialogs_preferences_pages_appearance_instance_init, NULL };
	GType dialogs_preferences_pages_appearance_type_id;
	dialogs_preferences_pages_appearance_type_id = g_type_register_static (DIALOGS_PREFERENCES_PAGES_TYPE_BASE_PAGE, "DialogsPreferencesPagesAppearance", &g_define_type_info, 0);
	DialogsPreferencesPagesAppearance_private_offset = g_type_add_instance_private (dialogs_preferences_pages_appearance_type_id, sizeof (DialogsPreferencesPagesAppearancePrivate));
	return dialogs_preferences_pages_appearance_type_id;
}

GType
dialogs_preferences_pages_appearance_get_type (void)
{
	static volatile gsize dialogs_preferences_pages_appearance_type_id__once = 0;
	if (g_once_init_enter (&dialogs_preferences_pages_appearance_type_id__once)) {
		GType dialogs_preferences_pages_appearance_type_id;
		dialogs_preferences_pages_appearance_type_id = dialogs_preferences_pages_appearance_get_type_once ();
		g_once_init_leave (&dialogs_preferences_pages_appearance_type_id__once, dialogs_preferences_pages_appearance_type_id);
	}
	return dialogs_preferences_pages_appearance_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

