Skip to content
Commits on Source (21)
......@@ -69,6 +69,7 @@ abi-check:
- ./.gitlab-ci/check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD)
refresh-doc:
image: fedora
stage: publish
only:
refs:
......
=============
Version 1.6.3
=============
==============
Version 1.7.90
==============
- Remove a non-existent property mention from HdyDeck docs
- Remove a leftover debug message from HdySettings
- Translation updates:
- Chinese (China)
- Turkish
- Remove unnecessary cast in HdyPreferencesGroup
- Translation updates
- Georgian
- German
=============
Version 1.6.2
Version 1.7.0
=============
- HdyDeck
- Remove a non-existent property mention
- HdyStyleManager
- Correctly reset the theme if we're not overriding it.
Fixes switching away from HighContrast.
- Fix a typo in docs
- Remove a leftover debug message
- Add environment variables to control styles from Builder
- Fix license in docs
- Fix a Meson error when using as a subproject
- Fix a typo in HdyStyleManager docs
- Translation updates:
- Chinese (China)
- Dutch
- Indonesian
- Persian
=============
Version 1.6.1
=============
- HdyStyleManager
- Correctly reset the theme if we're not overriding it.
Fixes switching away from HighContrast.
- Turkish
=============
Version 1.6.0
......
......@@ -3,6 +3,7 @@
import os
import shutil
import subprocess
import sys
from pathlib import PurePath
......@@ -19,3 +20,5 @@ for reference in references:
if os.path.isdir(src_path):
dst_path = os.path.join(distroot, reference)
shutil.copytree(src_path, dst_path)
else:
sys.exit("Documentation not found. Please pass -Dgtk_doc=true and to Meson and run ninja once.")
project('libhandy', 'c',
version: '1.6.3',
version: '1.7.90',
license: 'LGPL-2.1-or-later',
meson_version: '>= 0.49.0',
default_options: [ 'warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11' ],
......
......@@ -11,6 +11,7 @@ fur
gl
hu
id
ka
nl
oc
pl
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -202,7 +202,7 @@ hdy_preferences_group_destroy (GtkWidget *widget)
* Since we overload forall(), the inherited destroy() won't work as normal.
* Remove internal widgets ourselves.
*/
g_clear_pointer ((GtkWidget **) &priv->box, gtk_widget_destroy);
g_clear_pointer (&priv->box, gtk_widget_destroy);
priv->description = NULL;
priv->listbox = NULL;
priv->listbox_box = NULL;
......
......@@ -32,7 +32,16 @@ struct _HdySettings
gboolean has_high_contrast;
gboolean has_color_scheme;
gboolean color_scheme_use_fdo_setting;
enum {
COLOR_SCHEME_STATE_FDO,
COLOR_SCHEME_STATE_GNOME,
COLOR_SCHEME_STATE_NONE
} color_scheme_portal_state;
enum {
HIGH_CONTRAST_STATE_GNOME,
HIGH_CONTRAST_STATE_NONE
} high_contrast_portal_state;
};
G_DEFINE_TYPE (HdySettings, hdy_settings, G_TYPE_OBJECT);
......@@ -72,6 +81,39 @@ set_high_contrast (HdySettings *self,
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_HIGH_CONTRAST]);
}
static void
init_debug (HdySettings *self)
{
const gchar *env = g_getenv ("HDY_DEBUG_HIGH_CONTRAST");
if (env && *env) {
if (!g_strcmp0 (env, "1")) {
self->has_high_contrast = TRUE;
self->high_contrast = TRUE;
} else if (!g_strcmp0 (env, "0")) {
self->has_high_contrast = TRUE;
self->high_contrast = FALSE;
} else {
g_warning ("Invalid value for HDY_DEBUG_HIGH_CONTRAST: %s (Expected 0 or 1)", env);
}
}
env = g_getenv ("HDY_DEBUG_COLOR_SCHEME");
if (env) {
if (!g_strcmp0 (env, "default")) {
self->has_color_scheme = TRUE;
self->color_scheme = HDY_SYSTEM_COLOR_SCHEME_DEFAULT;
} else if (!g_strcmp0 (env, "prefer-dark")) {
self->has_color_scheme = TRUE;
self->color_scheme = HDY_SYSTEM_COLOR_SCHEME_PREFER_DARK;
} else if (!g_strcmp0 (env, "prefer-light")) {
self->has_color_scheme = TRUE;
self->color_scheme = HDY_SYSTEM_COLOR_SCHEME_PREFER_LIGHT;
} else {
g_warning ("Invalid color scheme %s (Expected one of: default, prefer-dark, prefer-light)", env);
}
}
}
/* Settings portal */
static gboolean
......@@ -199,7 +241,7 @@ settings_portal_changed_cb (GDBusProxy *proxy,
if (!g_strcmp0 (namespace, "org.freedesktop.appearance") &&
!g_strcmp0 (name, "color-scheme") &&
self->color_scheme_use_fdo_setting) {
self->color_scheme_portal_state == COLOR_SCHEME_STATE_FDO) {
set_color_scheme (self, get_fdo_color_scheme (value));
return;
......@@ -207,14 +249,15 @@ settings_portal_changed_cb (GDBusProxy *proxy,
if (!g_strcmp0 (namespace, "org.gnome.desktop.interface") &&
!g_strcmp0 (name, "color-scheme") &&
!self->color_scheme_use_fdo_setting) {
self->color_scheme_portal_state == COLOR_SCHEME_STATE_GNOME) {
set_color_scheme (self, get_gnome_color_scheme (value));
return;
}
if (!g_strcmp0 (namespace, "org.gnome.desktop.a11y.interface") &&
!g_strcmp0 (name, "high-contrast")) {
!g_strcmp0 (name, "high-contrast") &&
self->high_contrast_portal_state == HIGH_CONTRAST_STATE_GNOME) {
set_high_contrast (self, g_variant_get_boolean (value));
return;
......@@ -245,10 +288,11 @@ init_portal (HdySettings *self)
return;
}
if (read_portal_setting (self, "org.freedesktop.appearance",
if (!self->has_color_scheme &&
read_portal_setting (self, "org.freedesktop.appearance",
"color-scheme", "u", &color_scheme_variant)) {
self->has_color_scheme = TRUE;
self->color_scheme_use_fdo_setting = TRUE;
self->color_scheme_portal_state = COLOR_SCHEME_STATE_FDO;
self->color_scheme = get_fdo_color_scheme (color_scheme_variant);
}
......@@ -256,12 +300,15 @@ init_portal (HdySettings *self)
read_portal_setting (self, "org.gnome.desktop.interface",
"color-scheme", "s", &color_scheme_variant)) {
self->has_color_scheme = TRUE;
self->color_scheme_portal_state = COLOR_SCHEME_STATE_GNOME;
self->color_scheme = get_gnome_color_scheme (color_scheme_variant);
}
if (read_portal_setting (self, "org.gnome.desktop.a11y.interface",
if (!self->has_high_contrast &&
read_portal_setting (self, "org.gnome.desktop.a11y.interface",
"high-contrast", "b", &high_contrast_variant)) {
self->has_high_contrast = TRUE;
self->high_contrast_portal_state = HIGH_CONTRAST_STATE_GNOME;
self->high_contrast = g_variant_get_boolean (high_contrast_variant);
}
......@@ -388,7 +435,10 @@ hdy_settings_constructed (GObject *object)
G_OBJECT_CLASS (hdy_settings_parent_class)->constructed (object);
init_portal (self);
init_debug (self);
if (!self->has_color_scheme || !self->has_high_contrast)
init_portal (self);
if (!self->has_color_scheme || !self->has_high_contrast)
init_gsettings (self);
......@@ -461,6 +511,8 @@ hdy_settings_class_init (HdySettingsClass *klass)
static void
hdy_settings_init (HdySettings *self)
{
self->high_contrast_portal_state = HIGH_CONTRAST_STATE_NONE;
self->color_scheme_portal_state = COLOR_SCHEME_STATE_NONE;
}
HdySettings *
......