Hello community, here is the log from the commit of package libhandy for openSUSE:Factory checked in at 2019-03-11 13:51:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libhandy (Old) and /work/SRC/openSUSE:Factory/.libhandy.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libhandy" Mon Mar 11 13:51:56 2019 rev:6 rq:683756 version:0.0.9 Changes: -------- --- /work/SRC/openSUSE:Factory/libhandy/libhandy.changes 2019-03-04 09:23:50.776563505 +0100 +++ /work/SRC/openSUSE:Factory/.libhandy.new.28833/libhandy.changes 2019-03-11 13:51:57.829244425 +0100 @@ -1,0 +2,7 @@ +Thu Mar 7 16:45:40 UTC 2019 - Bjørn Lie <bjorn....@gmail.com> + +- Update to version 0.0.9: + + Various build and bug fixes. +- Drop libhandy-fix-translations.patch: Fixed upstream. + +------------------------------------------------------------------- Old: ---- libhandy-fix-translations.patch libhandy-v0.0.8.tar.bz2 New: ---- libhandy-v0.0.9.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libhandy.spec ++++++ --- /var/tmp/diff_new_pack.Kxes0n/_old 2019-03-11 13:51:58.521243972 +0100 +++ /var/tmp/diff_new_pack.Kxes0n/_new 2019-03-11 13:51:58.525243970 +0100 @@ -19,15 +19,13 @@ %define shlib %{name}-0_0-0 Name: libhandy -Version: 0.0.8 +Version: 0.0.9 Release: 0 Summary: A GTK+ library to develop UI for mobile devices License: LGPL-2.1-or-later Group: Development/Libraries/GNOME URL: https://source.puri.sm/Librem5/libhandy/ Source0: %{url}-/archive/v%{version}/%{name}-v%{version}.tar.bz2 -# PATCH-FIX-UPSTREAM libhandy-fix-translations.patch -- Fix broken translations -Patch0: libhandy-fix-translations.patch BuildRequires: gtk-doc BuildRequires: meson >= 0.47.0 ++++++ libhandy-v0.0.8.tar.bz2 -> libhandy-v0.0.9.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/data/packaging/rpm/libhandy.spec new/libhandy-v0.0.9/data/packaging/rpm/libhandy.spec --- old/libhandy-v0.0.8/data/packaging/rpm/libhandy.spec 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/data/packaging/rpm/libhandy.spec 2019-03-07 12:39:27.000000000 +0100 @@ -1,7 +1,7 @@ %global _vpath_srcdir %{name} Name: libhandy -Version: 0.0.8 +Version: 0.0.9 Release: 1%{?dist} Summary: A library full of GTK+ widgets for mobile phones diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/debian/changelog new/libhandy-v0.0.9/debian/changelog --- old/libhandy-v0.0.8/debian/changelog 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/debian/changelog 2019-03-07 12:39:27.000000000 +0100 @@ -1,3 +1,68 @@ +libhandy (0.0.9) experimental; urgency=medium + + [ Benjamin Berg ] + * glade: Mark ActionRow properties as translatable/icon. + Without this, it is impossible to set the translatable flag in glade, + making it hard to create proper UI definitions. + + [ Bastien Nocera ] + * Use correct i18n include. + From the Internationalization section of the GLib API docs: + In order to use these macros in an application, you must include + <glib/gi18n.h>. For use in a library, you must include <glib/gi18n-lib.h> + after defining the GETTEXT_PACKAGE macro suitably for your library + * Fix broken translations in all libhandy applications. + Translations in all the applications using libhandy would be broken + after a call to hdy_init() as it changed the default gettext translation + domain. + See https://gitlab.gnome.org/GNOME/gnome-control-center/issues/393 + + [ Adrien Plazas ] + * examples: Update the Flatpak command. + The command should changed with the demo application name. + * leaflet: Improve the slide child transition description. + This makes the slide child transition description match the one of the + slide mode transition one. + * action-row: Upcast self to check the activated row. + Upcast the HdyActionRow rather than downcasting the activated row to + compare their pointers. This prevents error messages when a sibbling row + that isn't a HdyActionRow is activated. Also use a simple cast rather + than a safe cast as it is there only to please the compiler and is + useless for a pointer comparison and it's faster. + * Drop 'dialer' from the UI resources path. + This makes the UI file paths more correct and simpler. + * leaflet: Add hdy_leaflet_stop_child_transition() + This makes the code clearer by encapsulating child mode transition + cancellation into its own function. + * leaflet: Factorize bin window move and resize. + This ensures we move or resize it consistently. + * leaflet: Move the bin window on child transition cancellation. + This avoids the children to be drawn out of place when a mode transition + is triggered while a child transition was ongoing. + Fixes https://source.puri.sm/Librem5/libhandy/issues/93 + * Add HDY_STYLE_PROVIDER_PRIORITY. + Add and use HDY_STYLE_PROVIDER_PRIORITY to help ensuring custom styling + is applied consistently and correctly accross all the library. + * expander-row: Move the custom style to a resource. + This makes the code cleaner, easier to read, and simnpler to modify. + * combo-row: Move the custom style to a resource. + This makes the code cleaner, easier to read, and simnpler to modify. + * expander-row: Add the expanded property. + This can be used to reveal external widgets depending on the state of + the row. + + [ Guido Günther ] + * debian: Test GObject introspection. + This makes sure we have the typelib file installed correctly. + * debian/tests: Drop API version from include. + This makes sure we respect pkg-config's findings. + * examples: Add API version to demo name. + This makes different versions co-installable. + * build: Don't hardcode API version + * Release libhandy 0.0.9 + + -- Guido Günther <a...@sigxcpu.org> Thu, 07 Mar 2019 12:37:34 +0100 + libhandy (0.0.8) experimental; urgency=medium [ Adrien Plazas ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/debian/libhandy-0.0-0.symbols new/libhandy-v0.0.9/debian/libhandy-0.0-0.symbols --- old/libhandy-v0.0.8/debian/libhandy-0.0-0.symbols 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/debian/libhandy-0.0-0.symbols 2019-03-07 12:39:27.000000000 +0100 @@ -69,10 +69,12 @@ hdy_enum_value_object_new@LIBHANDY_0_0_0 0.0.6 hdy_enum_value_row_name@LIBHANDY_0_0_0 0.0.6 hdy_expander_row_get_enable_expansion@LIBHANDY_0_0_0 0.0.6 + hdy_expander_row_get_expanded@LIBHANDY_0_0_0 0.0.9 hdy_expander_row_get_show_enable_switch@LIBHANDY_0_0_0 0.0.6 hdy_expander_row_get_type@LIBHANDY_0_0_0 0.0.6 hdy_expander_row_new@LIBHANDY_0_0_0 0.0.6 hdy_expander_row_set_enable_expansion@LIBHANDY_0_0_0 0.0.6 + hdy_expander_row_set_expanded@LIBHANDY_0_0_0 0.0.9 hdy_expander_row_set_show_enable_switch@LIBHANDY_0_0_0 0.0.6 hdy_fold_get_type@LIBHANDY_0_0_0 0.0~git20180429 hdy_header_group_add_header_bar@LIBHANDY_0_0_0 0.0.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/debian/tests/build-test.c new/libhandy-v0.0.9/debian/tests/build-test.c --- old/libhandy-v0.0.8/debian/tests/build-test.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/debian/tests/build-test.c 2019-03-07 12:39:27.000000000 +0100 @@ -1,6 +1,6 @@ #include <gtk/gtk.h> #define HANDY_USE_UNSTABLE_API -#include <libhandy-0.0/handy.h> +#include <handy.h> int main (int argc, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/debian/tests/control new/libhandy-v0.0.9/debian/tests/control --- old/libhandy-v0.0.8/debian/tests/control 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/debian/tests/control 2019-03-07 12:39:27.000000000 +0100 @@ -2,3 +2,7 @@ Depends: libhandy-0.0-dev, build-essential, pkg-config Restrictions: allow-stderr +Tests: python-gi-test +Depends: gir1.2-handy-0.0, python3-gi, python3 +Restrictions: allow-stderr + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/debian/tests/python-gi-test new/libhandy-v0.0.9/debian/tests/python-gi-test --- old/libhandy-v0.0.8/debian/tests/python-gi-test 1970-01-01 01:00:00.000000000 +0100 +++ new/libhandy-v0.0.9/debian/tests/python-gi-test 2019-03-07 12:39:27.000000000 +0100 @@ -0,0 +1,13 @@ +#!/usr/bin/python3 +# +# Make sure gobject introspection works + +import gi + +from gi.repository import GLib +gi.require_version('Handy', '0.0') +from gi.repository import Handy + +s = GLib.String().append("asdü") + +assert Handy.string_utf8_len(s) == 4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/doc/meson.build new/libhandy-v0.0.9/doc/meson.build --- old/libhandy-v0.0.8/doc/meson.build 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/doc/meson.build 2019-03-07 12:39:27.000000000 +0100 @@ -6,6 +6,7 @@ 'config.h', 'gtkprogresstrackerprivate.h', 'hdy-main-private.h', + 'hdy-style-private.h', ] images = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/examples/meson.build new/libhandy-v0.0.9/examples/meson.build --- old/libhandy-v0.0.8/examples/meson.build 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/examples/meson.build 2019-03-07 12:39:27.000000000 +0100 @@ -14,7 +14,8 @@ libhandy_generated_headers, ] -handy_demo = executable('handy-demo', handy_demo_sources, +handy_demo = executable('handy-@0@-demo'.format(apiversion), + handy_demo_sources, dependencies: libhandy_dep, gui_app: true, install: installable, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/examples/sm.puri.Handy.Demo.json new/libhandy-v0.0.9/examples/sm.puri.Handy.Demo.json --- old/libhandy-v0.0.8/examples/sm.puri.Handy.Demo.json 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/examples/sm.puri.Handy.Demo.json 2019-03-07 12:39:27.000000000 +0100 @@ -3,7 +3,7 @@ "runtime": "org.gnome.Platform", "runtime-version": "master", "sdk": "org.gnome.Sdk", - "command": "handy-demo", + "command": "handy-0.0-demo", "finish-args": [ "--env=DCONF_USER_CONFIG_DIR=.config/dconf", "--share=ipc", "--socket=x11", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/glade/libhandy.xml new/libhandy-v0.0.9/glade/libhandy.xml --- old/libhandy-v0.0.8/glade/libhandy.xml 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/glade/libhandy.xml 2019-03-07 12:39:27.000000000 +0100 @@ -1,7 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <glade-catalog name="libhandy" library="glade-handy" depends="gtk+" book="libhandy"> <glade-widget-classes> - <glade-widget-class name="HdyActionRow" generic-name="actionrow" title="Action Row" since="0.0.6"/> + <glade-widget-class name="HdyActionRow" generic-name="actionrow" title="Action Row" since="0.0.6"> + <properties> + <property id="icon-name" themed-icon="True" /> + <property id="title" translatable="True" /> + <property id="subtitle" translatable="True" /> + </properties> + </glade-widget-class> <glade-widget-class name="HdyArrows" generic-name="arrows" title="Arrows"/> <glade-widget-class name="HdyColumn" generic-name="column" title="Column"/> <glade-widget-class name="HdyComboRow" generic-name="comborow" title="Combo Row" since="0.0.6"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/meson.build new/libhandy-v0.0.9/meson.build --- old/libhandy-v0.0.8/meson.build 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/meson.build 2019-03-07 12:39:27.000000000 +0100 @@ -1,5 +1,5 @@ project('libhandy', 'c', - version: '0.0.8', + version: '0.0.9', license: 'LGPL-2.1+', meson_version: '>= 0.47.0', default_options: [ 'warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11' ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/handy.gresources.xml new/libhandy-v0.0.9/src/handy.gresources.xml --- old/libhandy-v0.0.8/src/handy.gresources.xml 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/handy.gresources.xml 2019-03-07 12:39:27.000000000 +0100 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <gresources> - <gresource prefix="/sm/puri/handy/dialer/ui"> + <gresource prefix="/sm/puri/handy/ui"> <file preprocess="xml-stripblanks">hdy-action-row.ui</file> <file preprocess="xml-stripblanks">hdy-combo-row.ui</file> <file preprocess="xml-stripblanks">hdy-dialer.ui</file> @@ -8,4 +8,8 @@ <file preprocess="xml-stripblanks">hdy-expander-row.ui</file> <file preprocess="xml-stripblanks">hdy-search-bar.ui</file> </gresource> + <gresource prefix="/sm/puri/handy/style"> + <file>hdy-combo-row-list.css</file> + <file>hdy-expander-row-arrow.css</file> + </gresource> </gresources> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-action-row.c new/libhandy-v0.0.9/src/hdy-action-row.c --- old/libhandy-v0.0.8/src/hdy-action-row.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-action-row.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,9 +4,10 @@ * SPDX-License-Identifier: LGPL-2.1+ */ +#include "config.h" #include "hdy-action-row.h" -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> /** * SECTION:hdy-action-row @@ -71,10 +72,11 @@ static GParamSpec *props[LAST_PROP]; static void -row_activated_cb (HdyActionRow *self, +row_activated_cb (HdyActionRow *self, GtkListBoxRow *row) { - if (self == HDY_ACTION_ROW (row)) + /* No need to use GTK_LIST_BOX_ROW() for a pointer comparison. */ + if ((GtkListBoxRow *) self == row) hdy_action_row_activate (self); } @@ -379,7 +381,7 @@ g_object_class_install_properties (object_class, LAST_PROP, props); gtk_widget_class_set_template_from_resource (widget_class, - "/sm/puri/handy/dialer/ui/hdy-action-row.ui"); + "/sm/puri/handy/ui/hdy-action-row.ui"); gtk_widget_class_bind_template_child_private (widget_class, HdyActionRow, box); gtk_widget_class_bind_template_child_private (widget_class, HdyActionRow, header); gtk_widget_class_bind_template_child_private (widget_class, HdyActionRow, image); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-arrows.c new/libhandy-v0.0.9/src/hdy-arrows.c --- old/libhandy-v0.0.8/src/hdy-arrows.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-arrows.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,7 +4,8 @@ * SPDX-License-Identifier: LGPL-2.1+ */ -#include <glib/gi18n.h> +#include "config.h" +#include <glib/gi18n-lib.h> #include "hdy-arrows.h" #include "hdy-enums.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-column.c new/libhandy-v0.0.9/src/hdy-column.c --- old/libhandy-v0.0.8/src/hdy-column.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-column.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,9 +4,10 @@ * SPDX-License-Identifier: LGPL-2.1+ */ +#include "config.h" #include "hdy-column.h" -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> #include <math.h> /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-combo-row-list.css new/libhandy-v0.0.9/src/hdy-combo-row-list.css --- old/libhandy-v0.0.8/src/hdy-combo-row-list.css 1970-01-01 01:00:00.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-combo-row-list.css 2019-03-07 12:39:27.000000000 +0100 @@ -0,0 +1,6 @@ +/* Make the list's background transparent. */ + +list { + border-style: none; + background-color: transparent; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-combo-row.c new/libhandy-v0.0.9/src/hdy-combo-row.c --- old/libhandy-v0.0.8/src/hdy-combo-row.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-combo-row.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,10 +4,12 @@ * SPDX-License-Identifier: LGPL-2.1+ */ +#include "config.h" #include "hdy-combo-row.h" -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> #include "hdy-list-box.h" +#include "hdy-style-private.h" /** * SECTION:hdy-combo-row @@ -322,7 +324,7 @@ g_object_class_install_properties (object_class, LAST_PROP, props); gtk_widget_class_set_template_from_resource (widget_class, - "/sm/puri/handy/dialer/ui/hdy-combo-row.ui"); + "/sm/puri/handy/ui/hdy-combo-row.ui"); gtk_widget_class_bind_template_child_private (widget_class, HdyComboRow, current); gtk_widget_class_bind_template_child_private (widget_class, HdyComboRow, image); gtk_widget_class_bind_template_child_private (widget_class, HdyComboRow, list); @@ -335,12 +337,10 @@ HdyComboRowPrivate *priv = hdy_combo_row_get_instance_private (self); g_autoptr (GtkCssProvider) provider = gtk_css_provider_new (); - /* This makes the list's background transparent. */ - gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider), - "list { border-style: none; background-color: transparent; }", -1, NULL); + gtk_css_provider_load_from_resource (provider, "/sm/puri/handy/style/hdy-combo-row-list.css"); gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (priv->list)), GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + HDY_STYLE_PROVIDER_PRIORITY); } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-dialer-button.c new/libhandy-v0.0.9/src/hdy-dialer-button.c --- old/libhandy-v0.0.8/src/hdy-dialer-button.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-dialer-button.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,7 +4,8 @@ * SPDX-License-Identifier: LGPL-2.1+ */ -#include <glib/gi18n.h> +#include "config.h" +#include <glib/gi18n-lib.h> #include "hdy-dialer-button.h" @@ -219,7 +220,7 @@ g_object_class_install_properties (object_class, PROP_LAST_PROP, props); gtk_widget_class_set_template_from_resource (widget_class, - "/sm/puri/handy/dialer/ui/hdy-dialer-button.ui"); + "/sm/puri/handy/ui/hdy-dialer-button.ui"); gtk_widget_class_bind_template_child_private (widget_class, HdyDialerButton, label); gtk_widget_class_bind_template_child_private (widget_class, HdyDialerButton, secondary_label); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-dialer-cycle-button.c new/libhandy-v0.0.9/src/hdy-dialer-cycle-button.c --- old/libhandy-v0.0.8/src/hdy-dialer-cycle-button.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-dialer-cycle-button.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,7 +4,8 @@ * SPDX-License-Identifier: LGPL-2.1+ */ -#include <glib/gi18n.h> +#include "config.h" +#include <glib/gi18n-lib.h> #include "hdy-dialer-cycle-button.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-dialer.c new/libhandy-v0.0.9/src/hdy-dialer.c --- old/libhandy-v0.0.8/src/hdy-dialer.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-dialer.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,7 +4,8 @@ * SPDX-License-Identifier: LGPL-2.1+ */ -#include <glib/gi18n.h> +#include "config.h" +#include <glib/gi18n-lib.h> #include "hdy-dialer.h" #include "hdy-dialer-button.h" @@ -503,7 +504,7 @@ G_TYPE_CHAR); gtk_widget_class_set_template_from_resource (widget_class, - "/sm/puri/handy/dialer/ui/hdy-dialer.ui"); + "/sm/puri/handy/ui/hdy-dialer.ui"); for (int i=0; i < 10; i++) { g_autofree gchar *name = g_strdup_printf("btn_%d", i); g_return_if_fail (name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-dialog.c new/libhandy-v0.0.9/src/hdy-dialog.c --- old/libhandy-v0.0.8/src/hdy-dialog.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-dialog.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,7 +4,8 @@ * SPDX-License-Identifier: LGPL-2.1+ */ -#include <glib/gi18n.h> +#include "config.h" +#include <glib/gi18n-lib.h> #include "hdy-dialog.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-expander-row-arrow.css new/libhandy-v0.0.9/src/hdy-expander-row-arrow.css --- old/libhandy-v0.0.8/src/hdy-expander-row-arrow.css 1970-01-01 01:00:00.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-expander-row-arrow.css 2019-03-07 12:39:27.000000000 +0100 @@ -0,0 +1,17 @@ +/* Animate the arrow's rotation */ + +row button:checked:dir(ltr) image, +row button:checked:dir(rtl) image { + transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94); + -gtk-icon-transform: rotate(0turn); +} + +row button:not(checked):dir(ltr) image { + transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94); + -gtk-icon-transform: rotate(-0.25turn); +} + +row button:not(checked):dir(rtl) image { + transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94); + -gtk-icon-transform: rotate(0.25turn); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-expander-row.c new/libhandy-v0.0.9/src/hdy-expander-row.c --- old/libhandy-v0.0.8/src/hdy-expander-row.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-expander-row.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,9 +4,11 @@ * SPDX-License-Identifier: LGPL-2.1+ */ +#include "config.h" #include "hdy-expander-row.h" -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> +#include "hdy-style-private.h" /** * SECTION:hdy-expander-row @@ -29,6 +31,7 @@ GtkRevealer *revealer; GtkSeparator *separator; + gboolean expanded; gboolean enable_expansion; gboolean show_enable_switch; } HdyExpanderRowPrivate; @@ -37,13 +40,12 @@ enum { PROP_0, + PROP_EXPANDED, PROP_ENABLE_EXPANSION, PROP_SHOW_ENABLE_SWITCH, LAST_PROP, }; -#define ANIMATION_TRANSITION "transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);\n" - static GParamSpec *props[LAST_PROP]; static void @@ -51,37 +53,25 @@ { HdyExpanderRowPrivate *priv = hdy_expander_row_get_instance_private (self); g_autoptr (GtkCssProvider) provider = gtk_css_provider_new (); - static const gchar *style = - "row button:checked:dir(ltr) image,\n" - "row button:checked:dir(rtl) image {\n" - ANIMATION_TRANSITION - " -gtk-icon-transform: rotate(0turn);\n" - "}\n" - "row button:not(checked):dir(ltr) image {\n" - ANIMATION_TRANSITION - " -gtk-icon-transform: rotate(-0.25turn);\n" - "}\n" - "row button:not(checked):dir(rtl) image {\n" - ANIMATION_TRANSITION - " -gtk-icon-transform: rotate(0.25turn);\n" - "}"; - /* This animated the arrow's roation. */ - gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider), style, -1, NULL); + gtk_css_provider_load_from_resource (provider, "/sm/puri/handy/style/hdy-expander-row-arrow.css"); gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (priv->image)), GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + HDY_STYLE_PROVIDER_PRIORITY); } static void hdy_expander_row_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) + guint prop_id, + GValue *value, + GParamSpec *pspec) { HdyExpanderRow *self = HDY_EXPANDER_ROW (object); switch (prop_id) { + case PROP_EXPANDED: + g_value_set_boolean (value, hdy_expander_row_get_expanded (self)); + break; case PROP_ENABLE_EXPANSION: g_value_set_boolean (value, hdy_expander_row_get_enable_expansion (self)); break; @@ -95,13 +85,16 @@ static void hdy_expander_row_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint prop_id, + const GValue *value, + GParamSpec *pspec) { HdyExpanderRow *self = HDY_EXPANDER_ROW (object); switch (prop_id) { + case PROP_EXPANDED: + hdy_expander_row_set_expanded (self, g_value_get_boolean (value)); + break; case PROP_ENABLE_EXPANSION: hdy_expander_row_set_enable_expansion (self, g_value_get_boolean (value)); break; @@ -191,7 +184,7 @@ HdyExpanderRow *self = HDY_EXPANDER_ROW (row); HdyExpanderRowPrivate *priv = hdy_expander_row_get_instance_private (self); - gtk_revealer_set_reveal_child (priv->revealer, priv->enable_expansion); + hdy_expander_row_set_expanded (self, priv->enable_expansion); HDY_ACTION_ROW_CLASS (hdy_expander_row_parent_class)->activate (row); } @@ -215,6 +208,18 @@ row_class->activate = hdy_expander_row_activate; /** + * HdyExpanderRow:expanded: + * + * %TRUE if the row is expanded. + */ + props[PROP_EXPANDED] = + g_param_spec_boolean ("expanded", + _("Expanded"), + _("Whether the row is expanded"), + FALSE, + G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY); + + /** * HdyExpanderRow:enable-expansion: * * %TRUE if the expansion is enabled. @@ -241,7 +246,7 @@ g_object_class_install_properties (object_class, LAST_PROP, props); gtk_widget_class_set_template_from_resource (widget_class, - "/sm/puri/handy/dialer/ui/hdy-expander-row.ui"); + "/sm/puri/handy/ui/hdy-expander-row.ui"); gtk_widget_class_bind_template_child_private (widget_class, HdyExpanderRow, box); gtk_widget_class_bind_template_child_private (widget_class, HdyExpanderRow, button); gtk_widget_class_bind_template_child_private (widget_class, HdyExpanderRow, image); @@ -258,8 +263,8 @@ gtk_widget_init_template (GTK_WIDGET (self)); arrow_init (self); - - priv->enable_expansion = TRUE; + hdy_expander_row_set_enable_expansion (self, TRUE); + hdy_expander_row_set_expanded (self, FALSE); g_object_bind_property (self, "show-enable-switch", priv->separator, "visible", G_BINDING_SYNC_CREATE); g_object_bind_property (self, "show-enable-switch", priv->enable_switch, "visible", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); @@ -283,6 +288,40 @@ return g_object_new (HDY_TYPE_EXPANDER_ROW, NULL); } +gboolean +hdy_expander_row_get_expanded (HdyExpanderRow *self) +{ + HdyExpanderRowPrivate *priv; + + g_return_val_if_fail (HDY_IS_EXPANDER_ROW (self), FALSE); + + priv = hdy_expander_row_get_instance_private (self); + + return priv->expanded; +} + +void +hdy_expander_row_set_expanded (HdyExpanderRow *self, + gboolean expanded) +{ + HdyExpanderRowPrivate *priv; + + g_return_if_fail (HDY_IS_EXPANDER_ROW (self)); + + priv = hdy_expander_row_get_instance_private (self); + + expanded = !!expanded && priv->enable_expansion; + + if (priv->expanded == expanded) + return; + + priv->expanded = expanded; + + gtk_revealer_set_reveal_child (priv->revealer, expanded); + + g_object_notify_by_pspec (G_OBJECT (self), props[PROP_EXPANDED]); +} + /** * hdy_expander_row_get_enable_expansion: * @self: a #HdyExpanderRow @@ -329,7 +368,7 @@ priv->enable_expansion = !!enable_expansion; - gtk_revealer_set_reveal_child (priv->revealer, priv->enable_expansion); + hdy_expander_row_set_expanded (self, priv->enable_expansion); g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ENABLE_EXPANSION]); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-expander-row.h new/libhandy-v0.0.9/src/hdy-expander-row.h --- old/libhandy-v0.0.8/src/hdy-expander-row.h 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-expander-row.h 2019-03-07 12:39:27.000000000 +0100 @@ -30,6 +30,10 @@ HdyExpanderRow *hdy_expander_row_new (void); +gboolean hdy_expander_row_get_expanded (HdyExpanderRow *self); +void hdy_expander_row_set_expanded (HdyExpanderRow *self, + gboolean expanded); + gboolean hdy_expander_row_get_enable_expansion (HdyExpanderRow *self); void hdy_expander_row_set_enable_expansion (HdyExpanderRow *self, gboolean enable_expansion); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-fold.c new/libhandy-v0.0.9/src/hdy-fold.c --- old/libhandy-v0.0.8/src/hdy-fold.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-fold.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,6 +4,7 @@ * SPDX-License-Identifier: LGPL-2.1+ */ +#include "config.h" #include "hdy-fold.h" /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-header-group.c new/libhandy-v0.0.9/src/hdy-header-group.c --- old/libhandy-v0.0.8/src/hdy-header-group.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-header-group.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,7 +4,8 @@ * SPDX-License-Identifier: LGPL-2.1+ */ -#include <glib/gi18n.h> +#include "config.h" +#include <glib/gi18n-lib.h> #include "hdy-header-group.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-leaflet.c new/libhandy-v0.0.9/src/hdy-leaflet.c --- old/libhandy-v0.0.8/src/hdy-leaflet.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-leaflet.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,7 +4,8 @@ * SPDX-License-Identifier: LGPL-2.1+ */ -#include <glib/gi18n.h> +#include "config.h" +#include <glib/gi18n-lib.h> #include "gtkprogresstrackerprivate.h" #include "hdy-leaflet.h" @@ -44,7 +45,7 @@ * HdyLeafletChildTransitionType: * @HDY_LEAFLET_CHILD_TRANSITION_TYPE_NONE: No transition * @HDY_LEAFLET_CHILD_TRANSITION_TYPE_CROSSFADE: A cross-fade - * @HDY_LEAFLET_CHILD_TRANSITION_TYPE_SLIDE: Slide from left, right, up or down according to orientation, text direction and order + * @HDY_LEAFLET_CHILD_TRANSITION_TYPE_SLIDE: Slide from left, right, up or down according to the orientation, text direction and the children order * @HDY_LEAFLET_CHILD_TRANSITION_TYPE_OVER: Cover the old page or uncover the new page, sliding from or towards the end according to orientation, text direction and children order * @HDY_LEAFLET_CHILD_TRANSITION_TYPE_UNDER: Uncover the new page or cover the old page, sliding from or towards the start according to orientation, text direction and children order * @@ -119,6 +120,8 @@ GtkOrientation orientation; + gboolean move_bin_window_request; + struct { HdyLeafletModeTransitionType type; guint duration; @@ -327,6 +330,39 @@ } static void +move_resize_bin_window (HdyLeaflet *self, + GtkAllocation *allocation, + gboolean resize) +{ + HdyLeafletPrivate *priv = hdy_leaflet_get_instance_private (self); + GtkAllocation alloc; + gboolean move; + + if (priv->bin_window == NULL) + return; + + if (allocation == NULL) { + gtk_widget_get_allocation (GTK_WIDGET (self), &alloc); + allocation = &alloc; + } + + move = priv->move_bin_window_request || is_window_moving_child_transition (self); + + if (move && resize) + gdk_window_move_resize (priv->bin_window, + get_bin_window_x (self, allocation), get_bin_window_y (self, allocation), + allocation->width, allocation->height); + else if (move) + gdk_window_move (priv->bin_window, + get_bin_window_x (self, allocation), get_bin_window_y (self, allocation)); + else if (resize) + gdk_window_resize (priv->bin_window, + allocation->width, allocation->height); + + priv->move_bin_window_request = FALSE; +} + +static void hdy_leaflet_child_progress_updated (HdyLeaflet *self) { HdyLeafletPrivate *priv = hdy_leaflet_get_instance_private (self); @@ -337,12 +373,7 @@ !priv->homogeneous[HDY_FOLD_FOLDED][GTK_ORIENTATION_HORIZONTAL]) gtk_widget_queue_resize (GTK_WIDGET (self)); - if (priv->bin_window != NULL && is_window_moving_child_transition (self)) { - GtkAllocation allocation; - gtk_widget_get_allocation (GTK_WIDGET (self), &allocation); - gdk_window_move (priv->bin_window, - get_bin_window_x (self, &allocation), get_bin_window_y (self, &allocation)); - } + move_resize_bin_window (self, NULL, FALSE); if (gtk_progress_tracker_get_state (&priv->child_transition.tracker) == GTK_PROGRESS_STATE_AFTER) { if (priv->child_transition.last_visible_surface != NULL) { @@ -413,6 +444,27 @@ } static void +hdy_leaflet_stop_child_transition (HdyLeaflet *self) +{ + HdyLeafletPrivate *priv = hdy_leaflet_get_instance_private (self); + + hdy_leaflet_unschedule_child_ticks (self); + priv->child_transition.active_type = HDY_LEAFLET_CHILD_TRANSITION_TYPE_NONE; + gtk_progress_tracker_finish (&priv->child_transition.tracker); + if (priv->child_transition.last_visible_surface != NULL) { + cairo_surface_destroy (priv->child_transition.last_visible_surface); + priv->child_transition.last_visible_surface = NULL; + } + if (priv->last_visible_child != NULL) { + gtk_widget_set_child_visible (priv->last_visible_child->widget, FALSE); + priv->last_visible_child = NULL; + } + + /* Move the bin window back in place as a child transition might have moved it. */ + priv->move_bin_window_request = TRUE; +} + +static void hdy_leaflet_start_child_transition (HdyLeaflet *self, HdyLeafletChildTransitionType transition_type, guint transition_duration, @@ -679,18 +731,7 @@ /* FIXME PROP_REVEAL_CHILD needs to be implemented. */ /* g_object_notify_by_pspec (G_OBJECT (revealer), props[PROP_REVEAL_CHILD]); */ - /* Stop the ongoing child transition, */ - hdy_leaflet_unschedule_child_ticks (self); - priv->child_transition.active_type = HDY_LEAFLET_CHILD_TRANSITION_TYPE_NONE; - gtk_progress_tracker_finish (&priv->child_transition.tracker); - if (priv->child_transition.last_visible_surface != NULL) { - cairo_surface_destroy (priv->child_transition.last_visible_surface); - priv->child_transition.last_visible_surface = NULL; - } - if (priv->last_visible_child != NULL) { - gtk_widget_set_child_visible (priv->last_visible_child->widget, FALSE); - priv->last_visible_child = NULL; - } + hdy_leaflet_stop_child_transition (self); transition = priv->mode_transition.type; if (gtk_widget_get_mapped (widget) && @@ -1790,13 +1831,7 @@ gdk_window_move_resize (priv->view_window, allocation->x, allocation->y, allocation->width, allocation->height); - if (priv->bin_window != NULL && is_window_moving_child_transition (self)) - gdk_window_move_resize (priv->bin_window, - get_bin_window_x (self, allocation), get_bin_window_y (self, allocation), - allocation->width, allocation->height); - else - gdk_window_resize (priv->bin_window, - allocation->width, allocation->height); + move_resize_bin_window (self, allocation, TRUE); } /* Prepare children information. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-list-box.c new/libhandy-v0.0.9/src/hdy-list-box.c --- old/libhandy-v0.0.8/src/hdy-list-box.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-list-box.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,9 +4,10 @@ * SPDX-License-Identifier: LGPL-2.1+ */ +#include "config.h" #include "hdy-list-box.h" -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> /** * SECTION:hdy-list-box diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-main.c new/libhandy-v0.0.9/src/hdy-main.c --- old/libhandy-v0.0.8/src/hdy-main.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-main.c 2019-03-07 12:39:27.000000000 +0100 @@ -6,7 +6,7 @@ #include "config.h" #include "hdy-main-private.h" #include <gio/gio.h> -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> static gint hdy_initialized = FALSE; @@ -42,7 +42,6 @@ if (hdy_initialized) return TRUE; - textdomain (GETTEXT_PACKAGE); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); g_resources_register (hdy_get_resource ()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-search-bar.c new/libhandy-v0.0.9/src/hdy-search-bar.c --- old/libhandy-v0.0.8/src/hdy-search-bar.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-search-bar.c 2019-03-07 12:39:27.000000000 +0100 @@ -41,7 +41,8 @@ * the fork. */ -#include <glib/gi18n.h> +#include "config.h" +#include <glib/gi18n-lib.h> #include "hdy-search-bar.h" @@ -469,7 +470,7 @@ g_object_class_install_properties (object_class, LAST_PROPERTY, props); gtk_widget_class_set_template_from_resource (widget_class, - "/sm/puri/handy/dialer/ui/hdy-search-bar.ui"); + "/sm/puri/handy/ui/hdy-search-bar.ui"); gtk_widget_class_bind_template_child_private (widget_class, HdySearchBar, tool_box); gtk_widget_class_bind_template_child_private (widget_class, HdySearchBar, revealer); gtk_widget_class_bind_template_child_private (widget_class, HdySearchBar, close_button); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-style-private.h new/libhandy-v0.0.9/src/hdy-style-private.h --- old/libhandy-v0.0.8/src/hdy-style-private.h 1970-01-01 01:00:00.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-style-private.h 2019-03-07 12:39:27.000000000 +0100 @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2019 Purism SPC + * + * SPDX-License-Identifier: LGPL-2.1+ + */ + +#pragma once + +#if !defined(_HANDY_INSIDE) && !defined(HANDY_COMPILATION) +#error "Only <handy.h> can be included directly." +#endif + +#include <glib.h> + +G_BEGIN_DECLS + +/* The style provider priority to use for libhandy widgets custom styling. It is + * higher than settings but lower than applications, so application developers + * can nonetheless apply custom styling on top of it. */ +#define HDY_STYLE_PROVIDER_PRIORITY (GTK_STYLE_PROVIDER_PRIORITY_SETTINGS + 1) + +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-title-bar.c new/libhandy-v0.0.9/src/hdy-title-bar.c --- old/libhandy-v0.0.8/src/hdy-title-bar.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-title-bar.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,9 +4,10 @@ * SPDX-License-Identifier: LGPL-2.1+ */ +#include "config.h" #include "hdy-title-bar.h" -#include <glib/gi18n.h> +#include <glib/gi18n-lib.h> /** * SECTION:hdy-title-bar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/hdy-value-object.c new/libhandy-v0.0.9/src/hdy-value-object.c --- old/libhandy-v0.0.8/src/hdy-value-object.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/hdy-value-object.c 2019-03-07 12:39:27.000000000 +0100 @@ -4,7 +4,8 @@ * SPDX-License-Identifier: LGPL-2.1+ */ -#include <glib/gi18n.h> +#include "config.h" +#include <glib/gi18n-lib.h> #include <gobject/gvaluecollector.h> #include "hdy-value-object.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/src/meson.build new/libhandy-v0.0.9/src/meson.build --- old/libhandy-v0.0.8/src/meson.build 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/src/meson.build 2019-03-07 12:39:27.000000000 +0100 @@ -196,7 +196,7 @@ sources: libhandy_generated_headers + libhandy_public_headers + libhandy_public_sources, nsversion: apiversion, namespace: 'Handy', - export_packages: 'libhandy-0.0', + export_packages: 'libhandy-@0@'.format(apiversion), symbol_prefix: 'hdy', identifier_prefix: 'Hdy', link_with: libhandy, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libhandy-v0.0.8/tests/test-expander-row.c new/libhandy-v0.0.9/tests/test-expander-row.c --- old/libhandy-v0.0.8/tests/test-expander-row.c 2019-02-15 11:29:38.000000000 +0100 +++ new/libhandy-v0.0.9/tests/test-expander-row.c 2019-03-07 12:39:27.000000000 +0100 @@ -9,6 +9,24 @@ static void +test_hdy_expander_row_expanded (void) +{ + g_autoptr (HdyExpanderRow) row = NULL; + + row = g_object_ref_sink (HDY_EXPANDER_ROW (hdy_expander_row_new ())); + g_assert_nonnull (row); + + g_assert_false (hdy_expander_row_get_expanded (row)); + + hdy_expander_row_set_expanded (row, TRUE); + g_assert_true (hdy_expander_row_get_expanded (row)); + + hdy_expander_row_set_expanded (row, FALSE); + g_assert_false (hdy_expander_row_get_expanded (row)); +} + + +static void test_hdy_expander_row_enable_expansion (void) { g_autoptr (HdyExpanderRow) row = NULL; @@ -17,12 +35,21 @@ g_assert_nonnull (row); g_assert_true (hdy_expander_row_get_enable_expansion (row)); + g_assert_false (hdy_expander_row_get_expanded (row)); + + hdy_expander_row_set_expanded (row, TRUE); + g_assert_true (hdy_expander_row_get_expanded (row)); hdy_expander_row_set_enable_expansion (row, FALSE); g_assert_false (hdy_expander_row_get_enable_expansion (row)); + g_assert_false (hdy_expander_row_get_expanded (row)); + + hdy_expander_row_set_expanded (row, TRUE); + g_assert_false (hdy_expander_row_get_expanded (row)); hdy_expander_row_set_enable_expansion (row, TRUE); g_assert_true (hdy_expander_row_get_enable_expansion (row)); + g_assert_true (hdy_expander_row_get_expanded (row)); } @@ -51,6 +78,7 @@ gtk_test_init (&argc, &argv, NULL); hdy_init (&argc, &argv); + g_test_add_func("/Handy/ExpanderRow/expanded", test_hdy_expander_row_expanded); g_test_add_func("/Handy/ExpanderRow/enable_expansion", test_hdy_expander_row_enable_expansion); g_test_add_func("/Handy/ExpanderRow/show_enable_switch", test_hdy_expander_row_show_enable_switch);