Hello community, here is the log from the commit of package libdazzle for openSUSE:Factory checked in at 2020-04-23 18:27:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libdazzle (Old) and /work/SRC/openSUSE:Factory/.libdazzle.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libdazzle" Thu Apr 23 18:27:34 2020 rev:19 rq:795231 version:3.36.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libdazzle/libdazzle.changes 2019-11-29 15:56:21.624990843 +0100 +++ /work/SRC/openSUSE:Factory/.libdazzle.new.2738/libdazzle.changes 2020-04-23 18:27:34.967759963 +0200 @@ -1,0 +2,20 @@ +Sun Mar 8 19:48:09 UTC 2020 - Bjørn Lie <bjorn....@gmail.com> + +- Update to version 3.36.0: + + Style tweaks for Adwaita. + + New translation scaffolding. + +------------------------------------------------------------------- +Wed Feb 12 22:19:41 CET 2020 - dims...@opensuse.org + +- Update to version 3.35.3: + + Support for secondary icons in suggestion rows. + + Graph model property range fixes. +- Changes from verson 3.35.2: + + Touch support for DzlSuggestionEntry. + + Column sizing improvements to DzlColumnLayout. + + Documentation improvements. + + Improved support for disabled animations. + + Improvments to when and how suggestion popups are displayed. + +------------------------------------------------------------------- Old: ---- libdazzle-3.34.1.tar.xz New: ---- libdazzle-3.36.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libdazzle.spec ++++++ --- /var/tmp/diff_new_pack.rHDpj6/_old 2020-04-23 18:27:36.311762537 +0200 +++ /var/tmp/diff_new_pack.rHDpj6/_new 2020-04-23 18:27:36.311762537 +0200 @@ -1,7 +1,7 @@ # # spec file for package libdazzle # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,13 +17,13 @@ Name: libdazzle -Version: 3.34.1 +Version: 3.36.0 Release: 0 Summary: Collection of fancy features for GLib and Gtk+ License: GPL-3.0-or-later AND LGPL-2.1-or-later Group: Development/Tools/Other URL: https://gitlab.gnome.org/GNOME/libdazzle -Source0: https://download.gnome.org/sources/libdazzle/3.34/%{name}-%{version}.tar.xz +Source0: https://download.gnome.org/sources/libdazzle/3.36/%{name}-%{version}.tar.xz BuildRequires: gtk-doc BuildRequires: meson >= 0.49.0 ++++++ libdazzle-3.34.1.tar.xz -> libdazzle-3.36.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/NEWS new/libdazzle-3.36.0/NEWS --- old/libdazzle-3.34.1/NEWS 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/NEWS 2020-03-06 21:17:59.520407400 +0100 @@ -1,10 +1,32 @@ ============== -Version 3.34.1 +Version 3.36.0 ============== Changes in this release: - • panel: hide handles when animations are disabled + • Style tweaks for Adwaita + • New translation scaffolding + +============== +Version 3.35.3 +============== + +Changes in this release: + + • Support for secondary icons in suggestion rows + • Graph model property range fixes + +============== +Version 3.35.2 +============== + +Changes in this release: + + • Touch support for DzlSuggestionEntry + • Column sizing improvements to DzlColumnLayout + • Documentation improvements + • Improved support for disabled animations + • Improvments to when and how suggestion popups are displayed ============== Version 3.34.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/data/themes/shared/shared-preferences.css new/libdazzle-3.36.0/data/themes/shared/shared-preferences.css --- old/libdazzle-3.34.1/data/themes/shared/shared-preferences.css 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/data/themes/shared/shared-preferences.css 2020-03-06 21:17:59.521407600 +0100 @@ -1,13 +1,13 @@ entry.preferences-search { border: none; - border-right: 1px solid alpha(@borders, 0.55); - border-bottom: 1px solid alpha(@borders, 0.55); + border-right: 1px solid @borders; + border-bottom: 1px solid @borders; border-radius: 0; } dzlpreferencesview stacksidebar list { background-color: @content_view_bg; - border-right: 1px solid alpha(@borders, 0.55); + border-right: 1px solid @borders; } dzlpreferencesview stacksidebar list separator { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/data/themes/shared/shared-suggestions.css new/libdazzle-3.36.0/data/themes/shared/shared-suggestions.css --- old/libdazzle-3.34.1/data/themes/shared/shared-suggestions.css 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/data/themes/shared/shared-suggestions.css 2020-03-06 21:17:59.522407500 +0100 @@ -37,7 +37,7 @@ color: @theme_fg_color; } -dzlsuggestionpopover > revealer > box > elastic > scrolledwindow > viewport > list > row box.vertical .subtitle { +dzlsuggestionpopover > revealer > box > elastic > scrolledwindow > viewport > list > row.vertical .subtitle { margin-left: 12px; } @@ -46,7 +46,7 @@ margin-right: 12px; } -dzlsuggestionpopover > revealer > box > elastic > scrolledwindow > viewport > list > row > box { +dzlsuggestionpopover > revealer > box > elastic > scrolledwindow > viewport > list > row > grid { margin: 4px 8px; } @@ -55,7 +55,7 @@ margin-bottom: 3px; } -dzlsuggestionpopover > revealer > box > elastic > scrolledwindow > viewport > list > row > box > image:first-child { +dzlsuggestionpopover > revealer > box > elastic > scrolledwindow > viewport > list > row > grid > image:first-child { min-width: 16px; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/meson.build new/libdazzle-3.36.0/meson.build --- old/libdazzle-3.34.1/meson.build 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/meson.build 2020-03-06 21:17:59.524407600 +0100 @@ -1,5 +1,5 @@ project('libdazzle', 'c', - version: '3.34.1', + version: '3.36.0', license: 'GPLv3+', meson_version: '>= 0.49.0', default_options: [ 'warning_level=1', 'buildtype=debugoptimized', 'c_std=gnu11' ], @@ -28,8 +28,10 @@ darwin_versions = [current + 1, '@0@.@1@'.format(current + 1, revision)] +package_string = 'libdazzle-@0@'.format(apiversion) + config_h = configuration_data() -config_h.set_quoted('GETTEXT_PACKAGE', 'libdazzle') +config_h.set_quoted('GETTEXT_PACKAGE', package_string) config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir'))) add_project_arguments([ @@ -169,11 +171,13 @@ configuration: config_h, ) +i18n = import('i18n') gnome = import('gnome') subdir('src') subdir('tools') subdir('tests') +subdir('po') subdir('examples/app') if get_option('enable_gtk_doc') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/po/LINGUAS new/libdazzle-3.36.0/po/LINGUAS --- old/libdazzle-3.34.1/po/LINGUAS 1970-01-01 01:00:00.000000000 +0100 +++ new/libdazzle-3.36.0/po/LINGUAS 2020-03-06 21:17:59.524407600 +0100 @@ -0,0 +1 @@ +# Please keep this list sorted alphabetically diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/po/POTFILES.in new/libdazzle-3.36.0/po/POTFILES.in --- old/libdazzle-3.34.1/po/POTFILES.in 1970-01-01 01:00:00.000000000 +0100 +++ new/libdazzle-3.36.0/po/POTFILES.in 2020-03-06 21:17:59.524407600 +0100 @@ -0,0 +1,43 @@ +# List of source files containing translatable strings. +# Please keep this file sorted alphabetically. +src/animation/dzl-animation.c +src/animation/dzl-box-theatric.c +src/bindings/dzl-binding-group.c +src/bindings/dzl-signal-group.c +src/cache/dzl-task-cache.c +src/files/dzl-directory-model.c +src/graphing/dzl-cpu-graph.c +src/graphing/dzl-graph-column.c +src/graphing/dzl-graph-line-renderer.c +src/graphing/dzl-graph-model.c +src/graphing/dzl-graph-view.c +src/prefs/dzl-preferences-entry.c +src/prefs/dzl-preferences-page.c +src/prefs/dzl-preferences-view.c +src/search/dzl-trie.c +src/settings/dzl-settings-sandwich.c +src/shortcuts/dzl-shortcut-accel-dialog.c +src/shortcuts/dzl-shortcut-manager.c +src/shortcuts/dzl-shortcut-theme-editor.c +src/shortcuts/dzl-shortcuts-group.c +src/shortcuts/dzl-shortcuts-section.c +src/shortcuts/dzl-shortcuts-shortcut.c +src/shortcuts/dzl-shortcuts-window.c +src/statemachine/dzl-state-machine-buildable.c +src/statemachine/dzl-state-machine.c +src/suggestions/dzl-suggestion-entry.c +src/suggestions/dzl-suggestion-popover.c +src/theming/dzl-css-provider.c +src/tree/dzl-tree-builder.c +src/tree/dzl-tree-node.c +src/tree/dzl-tree.c +src/util/dzl-date-time.c +src/util/dzl-file-manager.c +src/widgets/dzl-bolding-label.c +src/widgets/dzl-box.c +src/widgets/dzl-file-chooser-entry.c +src/widgets/dzl-pill-box.c +src/widgets/dzl-rect-helper.c +src/widgets/dzl-search-bar.c +src/widgets/dzl-slider.c +src/widgets/dzl-stack-list.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/po/POTFILES.skip new/libdazzle-3.36.0/po/POTFILES.skip --- old/libdazzle-3.34.1/po/POTFILES.skip 1970-01-01 01:00:00.000000000 +0100 +++ new/libdazzle-3.36.0/po/POTFILES.skip 2020-03-06 21:17:59.524407600 +0100 @@ -0,0 +1,3 @@ +# List of source files to skip. +# Please keep this file sorted alphabetically. +examples/app/example-window.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/po/meson.build new/libdazzle-3.36.0/po/meson.build --- old/libdazzle-3.34.1/po/meson.build 1970-01-01 01:00:00.000000000 +0100 +++ new/libdazzle-3.36.0/po/meson.build 2020-03-06 21:17:59.524407600 +0100 @@ -0,0 +1,4 @@ +i18n.gettext( + package_string, + preset: 'glib', +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/dzl-init.c new/libdazzle-3.36.0/src/dzl-init.c --- old/libdazzle-3.34.1/src/dzl-init.c 1970-01-01 01:00:00.000000000 +0100 +++ new/libdazzle-3.36.0/src/dzl-init.c 2020-03-06 21:17:59.530407700 +0100 @@ -0,0 +1,41 @@ +/* dzl-init.c + * + * Copyright 2020 Christian Hergert <cherg...@redhat.com> + * + * 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, see <http://www.gnu.org/licenses/>. + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#include "config.h" + +#include <glib/gi18n.h> + +#include "gconstructor.h" + +#if defined (G_HAS_CONSTRUCTORS) +# ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA +# pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(dzl_init_ctor) +# endif +G_DEFINE_CONSTRUCTOR(dzl_init_ctor) +#else +# error Your platform/compiler is missing constructor support +#endif + +static void +dzl_init_ctor (void) +{ + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/dzl-version-macros.h new/libdazzle-3.36.0/src/dzl-version-macros.h --- old/libdazzle-3.34.1/src/dzl-version-macros.h 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/src/dzl-version-macros.h 2020-03-06 21:17:59.530407700 +0100 @@ -45,6 +45,7 @@ #define DZL_VERSION_3_30 (G_ENCODE_VERSION (3, 30)) #define DZL_VERSION_3_32 (G_ENCODE_VERSION (3, 32)) #define DZL_VERSION_3_34 (G_ENCODE_VERSION (3, 34)) +#define DZL_VERSION_3_36 (G_ENCODE_VERSION (3, 36)) #if (DZL_MINOR_VERSION == 99) # define DZL_VERSION_CUR_STABLE (G_ENCODE_VERSION (DZL_MAJOR_VERSION + 1, 0)) @@ -173,4 +174,10 @@ # define DZL_AVAILABLE_IN_3_34 _DZL_EXTERN #endif +#if DZL_VERSION_MAX_ALLOWED < DZL_VERSION_3_36 +# define DZL_AVAILABLE_IN_3_36 DZL_UNAVAILABLE(3, 36) +#else +# define DZL_AVAILABLE_IN_3_36 _DZL_EXTERN +#endif + #endif /* DZL_VERSION_MACROS_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/gconstructor.h new/libdazzle-3.36.0/src/gconstructor.h --- old/libdazzle-3.34.1/src/gconstructor.h 1970-01-01 01:00:00.000000000 +0100 +++ new/libdazzle-3.36.0/src/gconstructor.h 2020-03-06 21:17:59.532407500 +0100 @@ -0,0 +1,94 @@ +/* + If G_HAS_CONSTRUCTORS is true then the compiler support *both* constructors and + destructors, in a sane way, including e.g. on library unload. If not you're on + your own. + + Some compilers need #pragma to handle this, which does not work with macros, + so the way you need to use this is (for constructors): + + #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA + #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(my_constructor) + #endif + G_DEFINE_CONSTRUCTOR(my_constructor) + static void my_constructor(void) { + ... + } + +*/ + +#ifndef __GTK_DOC_IGNORE__ + +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) + +#define G_HAS_CONSTRUCTORS 1 + +#define G_DEFINE_CONSTRUCTOR(_func) static void __attribute__((constructor)) _func (void); +#define G_DEFINE_DESTRUCTOR(_func) static void __attribute__((destructor)) _func (void); + +#elif defined (_MSC_VER) && (_MSC_VER >= 1500) +/* Visual studio 2008 and later has _Pragma */ + +#define G_HAS_CONSTRUCTORS 1 + +#define G_DEFINE_CONSTRUCTOR(_func) \ + static void _func(void); \ + static int _func ## _wrapper(void) { _func(); return 0; } \ + __pragma(section(".CRT$XCU",read)) \ + __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _wrapper; + +#define G_DEFINE_DESTRUCTOR(_func) \ + static void _func(void); \ + static int _func ## _constructor(void) { atexit (_func); return 0; } \ + __pragma(section(".CRT$XCU",read)) \ + __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor; + +#elif defined (_MSC_VER) + +#define G_HAS_CONSTRUCTORS 1 + +/* Pre Visual studio 2008 must use #pragma section */ +#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1 +#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1 + +#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \ + section(".CRT$XCU",read) +#define G_DEFINE_CONSTRUCTOR(_func) \ + static void _func(void); \ + static int _func ## _wrapper(void) { _func(); return 0; } \ + __declspec(allocate(".CRT$XCU")) static int (*p)(void) = _func ## _wrapper; + +#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \ + section(".CRT$XCU",read) +#define G_DEFINE_DESTRUCTOR(_func) \ + static void _func(void); \ + static int _func ## _constructor(void) { atexit (_func); return 0; } \ + __declspec(allocate(".CRT$XCU")) static int (* _array ## _func)(void) = _func ## _constructor; + +#elif defined(__SUNPRO_C) + +/* This is not tested, but i believe it should work, based on: + * http://opensource.apple.com/source/OpenSSL098/OpenSSL098-35/src/fips/fips_premain.c + */ + +#define G_HAS_CONSTRUCTORS 1 + +#define G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA 1 +#define G_DEFINE_DESTRUCTOR_NEEDS_PRAGMA 1 + +#define G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(_func) \ + init(_func) +#define G_DEFINE_CONSTRUCTOR(_func) \ + static void _func(void); + +#define G_DEFINE_DESTRUCTOR_PRAGMA_ARGS(_func) \ + fini(_func) +#define G_DEFINE_DESTRUCTOR(_func) \ + static void _func(void); + +#else + +/* constructors not supported for this compiler */ + +#endif + +#endif /* __GTK_DOC_IGNORE__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/graphing/dzl-graph-model.c new/libdazzle-3.36.0/src/graphing/dzl-graph-model.c --- old/libdazzle-3.34.1/src/graphing/dzl-graph-model.c 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/src/graphing/dzl-graph-model.c 2020-03-06 21:17:59.533407700 +0100 @@ -577,7 +577,7 @@ g_param_spec_double ("value-max", "Value Max", "Value Max", - -G_MINDOUBLE, G_MAXDOUBLE, + -G_MAXDOUBLE, G_MAXDOUBLE, 100.0, (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); @@ -585,7 +585,7 @@ g_param_spec_double ("value-min", "Value Min", "Value Min", - -G_MINDOUBLE, G_MAXDOUBLE, + -G_MAXDOUBLE, G_MAXDOUBLE, 100.0, (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/meson.build new/libdazzle-3.36.0/src/meson.build --- old/libdazzle-3.34.1/src/meson.build 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/src/meson.build 2020-03-06 21:17:59.534407600 +0100 @@ -80,6 +80,7 @@ libdazzle_public_sources, libdazzle_private_sources, libdazzle_resources, + 'dzl-init.c', ] libdazzle_deps = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/suggestions/dzl-suggestion-entry.c new/libdazzle-3.36.0/src/suggestions/dzl-suggestion-entry.c --- old/libdazzle-3.34.1/src/suggestions/dzl-suggestion-entry.c 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/src/suggestions/dzl-suggestion-entry.c 2020-03-06 21:17:59.547407600 +0100 @@ -37,6 +37,7 @@ DzlSuggestionPopover *popover; DzlSuggestionEntryBuffer *buffer; GListModel *model; + GtkGesture *press_gesture; gulong changed_handler; @@ -46,6 +47,7 @@ guint activate_on_single_click : 1; guint compact : 1; + guint allow_touch_selection : 1; gint in_key_press; gint in_move_by; @@ -173,6 +175,7 @@ _dzl_suggestion_popover_set_focused (priv->popover, FALSE); g_signal_emit (self, signals [HIDE_SUGGESTIONS], 0); + priv->allow_touch_selection = TRUE; return GTK_WIDGET_CLASS (dzl_suggestion_entry_parent_class)->focus_out_event (widget, event); } @@ -435,6 +438,7 @@ gtk_widget_destroy (GTK_WIDGET (priv->popover)); g_clear_object (&priv->model); + g_clear_object (&priv->press_gesture); g_assert (priv->popover == NULL); @@ -689,6 +693,48 @@ } static void +dzl_suggestion_entry_set_selection_bounds (GtkEditable *editable, + gint start_pos, + gint end_pos) +{ + DzlSuggestionEntry *self = (DzlSuggestionEntry *)editable; + DzlSuggestionEntryPrivate *priv = dzl_suggestion_entry_get_instance_private (self); + + g_assert (DZL_IS_SUGGESTION_ENTRY (self)); + + g_signal_handler_block (self, priv->changed_handler); + + if (end_pos < 0) + end_pos = gtk_entry_buffer_get_length (GTK_ENTRY_BUFFER (priv->buffer)); + + if (end_pos > (gint)dzl_suggestion_entry_buffer_get_typed_length (priv->buffer)) + dzl_suggestion_entry_buffer_commit (priv->buffer); + + editable_parent_iface->set_selection_bounds (editable, start_pos, end_pos); + + g_signal_handler_unblock (self, priv->changed_handler); +} + +static void +dzl_suggestion_entry_gesture_released (DzlSuggestionEntry *self, + gint n_press, + gdouble x, + gdouble y, + GtkGestureMultiPress *gesture) +{ + DzlSuggestionEntryPrivate *priv = dzl_suggestion_entry_get_instance_private (self); + + g_assert (GTK_IS_GESTURE_MULTI_PRESS (gesture)); + g_assert (DZL_IS_SUGGESTION_ENTRY (self)); + + if (n_press == 1 && priv->allow_touch_selection) + { + priv->allow_touch_selection = FALSE; + dzl_suggestion_entry_set_selection_bounds (GTK_EDITABLE (self), 0, -1); + } +} + +static void dzl_suggestion_entry_init (DzlSuggestionEntry *self) { DzlSuggestionEntryPrivate *priv = dzl_suggestion_entry_get_instance_private (self); @@ -727,6 +773,14 @@ "suggestion"); priv->buffer = dzl_suggestion_entry_buffer_new (); + + priv->press_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (self)); + gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->press_gesture), TRUE); + g_signal_connect_object (priv->press_gesture, + "released", + G_CALLBACK (dzl_suggestion_entry_gesture_released), + self, + G_CONNECT_SWAPPED); } GtkWidget * @@ -756,29 +810,6 @@ } static void -dzl_suggestion_entry_set_selection_bounds (GtkEditable *editable, - gint start_pos, - gint end_pos) -{ - DzlSuggestionEntry *self = (DzlSuggestionEntry *)editable; - DzlSuggestionEntryPrivate *priv = dzl_suggestion_entry_get_instance_private (self); - - g_assert (DZL_IS_SUGGESTION_ENTRY (self)); - - g_signal_handler_block (self, priv->changed_handler); - - if (end_pos < 0) - end_pos = gtk_entry_buffer_get_length (GTK_ENTRY_BUFFER (priv->buffer)); - - if (end_pos > (gint)dzl_suggestion_entry_buffer_get_typed_length (priv->buffer)) - dzl_suggestion_entry_buffer_commit (priv->buffer); - - editable_parent_iface->set_selection_bounds (editable, start_pos, end_pos); - - g_signal_handler_unblock (self, priv->changed_handler); -} - -static void editable_iface_init (GtkEditableInterface *iface) { editable_parent_iface = g_type_interface_peek_parent (iface); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/suggestions/dzl-suggestion-popover.c new/libdazzle-3.36.0/src/suggestions/dzl-suggestion-popover.c --- old/libdazzle-3.34.1/src/suggestions/dzl-suggestion-popover.c 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/src/suggestions/dzl-suggestion-popover.c 2020-03-06 21:17:59.547407600 +0100 @@ -823,7 +823,8 @@ return; } - if (gtk_widget_get_mapped (GTK_WIDGET (self))) + if (gtk_widget_get_mapped (GTK_WIDGET (self)) && + gtk_revealer_get_reveal_child (self->revealer)) return; if (self->relative_to != NULL) @@ -964,8 +965,10 @@ DZL_EXIT; } - if (gtk_widget_get_mapped (GTK_WIDGET (self))) - return; + if (gtk_widget_get_mapped (GTK_WIDGET (self)) && + gtk_revealer_get_child_revealed (self->revealer) && + gtk_revealer_get_reveal_child (self->revealer)) + DZL_EXIT; /* * If we are currently animating in the initial view of the popover, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/suggestions/dzl-suggestion-row.c new/libdazzle-3.36.0/src/suggestions/dzl-suggestion-row.c --- old/libdazzle-3.34.1/src/suggestions/dzl-suggestion-row.c 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/src/suggestions/dzl-suggestion-row.c 2020-03-06 21:17:59.547407600 +0100 @@ -30,12 +30,14 @@ GtkOrientation orientation; gulong notify_icon_handler; + gulong notify_secondary_icon_handler; GtkImage *image; + GtkImage *secondary_image; GtkLabel *title; GtkLabel *separator; GtkLabel *subtitle; - GtkLabel *box; + GtkGrid *grid; } DzlSuggestionRowPrivate; enum { @@ -63,8 +65,10 @@ return; dzl_clear_signal_handler (priv->suggestion, &priv->notify_icon_handler); + dzl_clear_signal_handler (priv->suggestion, &priv->notify_secondary_icon_handler); g_object_set (priv->image, "icon-name", NULL, NULL); + g_object_set (priv->secondary_image, "icon-name", NULL, NULL); gtk_label_set_label (priv->title, NULL); gtk_label_set_label (priv->subtitle, NULL); } @@ -93,6 +97,69 @@ } static void +on_notify_secondary_icon_cb (DzlSuggestionRow *self, + GParamSpec *pspec, + DzlSuggestion *suggestion) +{ + DzlSuggestionRowPrivate *priv = dzl_suggestion_row_get_instance_private (self); + cairo_surface_t *surface; + + g_assert (DZL_IS_SUGGESTION_ROW (self)); + g_assert (DZL_IS_SUGGESTION (suggestion)); + + if ((surface = dzl_suggestion_get_secondary_icon_surface (suggestion, GTK_WIDGET (priv->secondary_image)))) + { + gtk_image_set_from_surface (priv->secondary_image, surface); + cairo_surface_destroy (surface); + } + else + { + g_autoptr(GIcon) icon = dzl_suggestion_get_secondary_icon (suggestion); + gtk_image_set_from_gicon (priv->secondary_image, icon, GTK_ICON_SIZE_MENU); + } +} + +static void +dzl_suggestion_set_orientation (DzlSuggestionRowPrivate *priv) +{ + const gchar *subtitle; + + subtitle = dzl_suggestion_get_subtitle (priv->suggestion); + + gtk_widget_set_visible (GTK_WIDGET (priv->separator), + priv->orientation != GTK_ORIENTATION_VERTICAL); + + g_object_ref (priv->image); + g_object_ref (priv->title); + g_object_ref (priv->subtitle); + + gtk_container_remove (GTK_CONTAINER (priv->grid), GTK_WIDGET (priv->image)); + gtk_container_remove (GTK_CONTAINER (priv->grid), GTK_WIDGET (priv->title)); + gtk_container_remove (GTK_CONTAINER (priv->grid), GTK_WIDGET (priv->subtitle)); + + if (priv->orientation == GTK_ORIENTATION_VERTICAL) + { + gtk_grid_attach (priv->grid, GTK_WIDGET (priv->image), 0, 0, 1, 1); + gtk_grid_attach (priv->grid, GTK_WIDGET (priv->title), 1, 0, 1, 1); + gtk_grid_attach (priv->grid, GTK_WIDGET (priv->subtitle), 1, 1, 1, 1); + + gtk_widget_set_visible (GTK_WIDGET (priv->separator), FALSE); + } + else + { + gtk_grid_attach (priv->grid, GTK_WIDGET (priv->image), 0, 0, 1, 2); + gtk_grid_attach (priv->grid, GTK_WIDGET (priv->title), 1, 0, 1, 1); + gtk_grid_attach (priv->grid, GTK_WIDGET (priv->subtitle), 3, 0, 1, 1); + + gtk_widget_set_visible (GTK_WIDGET (priv->separator), !!subtitle); + } + + g_object_unref (priv->subtitle); + g_object_unref (priv->title); + g_object_unref (priv->image); +} + +static void dzl_suggestion_row_connect (DzlSuggestionRow *self) { DzlSuggestionRowPrivate *priv = dzl_suggestion_row_get_instance_private (self); @@ -108,19 +175,22 @@ self, G_CONNECT_SWAPPED); + priv->notify_secondary_icon_handler = + g_signal_connect_object (priv->suggestion, + "notify::secondary-icon", + G_CALLBACK (on_notify_secondary_icon_cb), + self, + G_CONNECT_SWAPPED); + on_notify_icon_cb (self, NULL, priv->suggestion); + on_notify_secondary_icon_cb (self, NULL, priv->suggestion); gtk_label_set_label (priv->title, dzl_suggestion_get_title (priv->suggestion)); subtitle = dzl_suggestion_get_subtitle (priv->suggestion); gtk_label_set_label (priv->subtitle, subtitle); - if (priv->orientation == GTK_ORIENTATION_VERTICAL) - gtk_widget_set_visible (GTK_WIDGET (priv->separator), FALSE); - else - gtk_widget_set_visible (GTK_WIDGET (priv->separator), !!subtitle); - - gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), priv->orientation); + dzl_suggestion_set_orientation (priv); } static void @@ -181,9 +251,7 @@ if (priv->orientation != g_value_get_enum (value)) { priv->orientation = g_value_get_enum (value); - gtk_widget_set_visible (GTK_WIDGET (priv->separator), - priv->orientation != GTK_ORIENTATION_VERTICAL); - gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), priv->orientation); + dzl_suggestion_set_orientation (priv); } break; @@ -221,10 +289,11 @@ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/dazzle/ui/dzl-suggestion-row.ui"); gtk_widget_class_bind_template_child_private (widget_class, DzlSuggestionRow, image); + gtk_widget_class_bind_template_child_private (widget_class, DzlSuggestionRow, secondary_image); gtk_widget_class_bind_template_child_private (widget_class, DzlSuggestionRow, title); gtk_widget_class_bind_template_child_private (widget_class, DzlSuggestionRow, subtitle); gtk_widget_class_bind_template_child_private (widget_class, DzlSuggestionRow, separator); - gtk_widget_class_bind_template_child_private (widget_class, DzlSuggestionRow, box); + gtk_widget_class_bind_template_child_private (widget_class, DzlSuggestionRow, grid); } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/suggestions/dzl-suggestion-row.ui new/libdazzle-3.36.0/src/suggestions/dzl-suggestion-row.ui --- old/libdazzle-3.34.1/src/suggestions/dzl-suggestion-row.ui 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/src/suggestions/dzl-suggestion-row.ui 2020-03-06 21:17:59.548407600 +0100 @@ -1,73 +1,90 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> <interface> + <requires lib="gtk+" version="3.0"/> <template class="DzlSuggestionRow" parent="DzlListBoxRow"> + <property name="can_focus">False</property> <child> - <object class="GtkBox"> - <property name="orientation">horizontal</property> - <property name="visible">true</property> + <object class="GtkGrid" id="grid"> + <property name="visible">True</property> + <property name="can_focus">False</property> <child> <object class="GtkImage" id="image"> - <property name="pixel-size">16</property> - <property name="hexpand">false</property> - <property name="visible">true</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="hexpand">False</property> + <property name="pixel_size">16</property> </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> </child> <child> - <object class="GtkBox" id="box"> - <property name="orientation">horizontal</property> - <property name="visible">true</property> - <child> - <object class="GtkLabel" id="title"> - <property name="hexpand">false</property> - <property name="visible">true</property> - <property name="xalign">0.0</property> - <property name="use-markup">true</property> - <property name="ellipsize">end</property> - <style> - <class name="title"/> - </style> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="separator"> - <property name="hexpand">false</property> - <property name="label">—</property> - <property name="visible">true</property> - <style> - <class name="separator"/> - <class name="dim-label"/> - </style> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="subtitle"> - <property name="hexpand">true</property> - <property name="visible">true</property> - <property name="xalign">0.0</property> - <property name="use-markup">true</property> - <property name="ellipsize">end</property> - <style> - <class name="dim-label"/> - <class name="subtitle"/> - </style> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> + <object class="GtkLabel" id="subtitle"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="use_markup">True</property> + <property name="ellipsize">end</property> + <property name="xalign">0</property> + <style> + <class name="dim-label"/> + <class name="subtitle"/> + </style> </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="separator"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">False</property> + <property name="label">—</property> + <style> + <class name="separator"/> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="title"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">False</property> + <property name="use_markup">True</property> + <property name="ellipsize">end</property> + <property name="xalign">0</property> + <style> + <class name="title"/> + </style> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="secondary_image"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="valign">center</property> + <property name="hexpand">False</property> + <property name="pixel_size">16</property> + <property name="margin-start">6</property> + </object> + <packing> + <property name="left_attach">4</property> + <property name="top_attach">0</property> + </packing> </child> </object> </child> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/suggestions/dzl-suggestion.c new/libdazzle-3.36.0/src/suggestions/dzl-suggestion.c --- old/libdazzle-3.34.1/src/suggestions/dzl-suggestion.c 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/src/suggestions/dzl-suggestion.c 2020-03-06 21:17:59.548407600 +0100 @@ -31,14 +31,18 @@ /* interned string */ const gchar *icon_name; + const gchar *secondary_icon_name; GIcon *icon; + GIcon *secondary_icon; } DzlSuggestionPrivate; enum { PROP_0, PROP_ICON_NAME, PROP_ICON, + PROP_SECONDARY_ICON_NAME, + PROP_SECONDARY_ICON, PROP_ID, PROP_SUBTITLE, PROP_TITLE, @@ -69,6 +73,19 @@ return NULL; } +static GIcon * +dzl_suggestion_real_get_secondary_icon (DzlSuggestion *self) +{ + DzlSuggestionPrivate *priv = dzl_suggestion_get_instance_private (self); + + g_assert (DZL_IS_SUGGESTION (self)); + + if (priv->secondary_icon_name != NULL) + return g_icon_new_for_string (priv->secondary_icon_name, NULL); + + return NULL; +} + static void dzl_suggestion_finalize (GObject *object) { @@ -106,6 +123,14 @@ g_value_take_object (value, dzl_suggestion_get_icon (self)); break; + case PROP_SECONDARY_ICON_NAME: + g_value_set_static_string (value, dzl_suggestion_get_secondary_icon_name (self)); + break; + + case PROP_SECONDARY_ICON: + g_value_take_object (value, dzl_suggestion_get_secondary_icon (self)); + break; + case PROP_TITLE: g_value_set_string (value, dzl_suggestion_get_title (self)); break; @@ -133,6 +158,10 @@ dzl_suggestion_set_icon_name (self, g_value_get_string (value)); break; + case PROP_SECONDARY_ICON_NAME: + dzl_suggestion_set_secondary_icon_name (self, g_value_get_string (value)); + break; + case PROP_ID: dzl_suggestion_set_id (self, g_value_get_string (value)); break; @@ -160,6 +189,7 @@ object_class->set_property = dzl_suggestion_set_property; klass->get_icon = dzl_suggestion_real_get_icon; + klass->get_secondary_icon = dzl_suggestion_real_get_secondary_icon; properties [PROP_ID] = g_param_spec_string ("id", @@ -182,6 +212,20 @@ NULL, (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS)); + properties [PROP_SECONDARY_ICON] = + g_param_spec_object ("secondary-icon", + "Secondary Icon", + "The secondary GIcon for the suggestion on the right", + G_TYPE_ICON, + (G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS)); + + properties [PROP_SECONDARY_ICON_NAME] = + g_param_spec_string ("secondary-icon-name", + "Secondary Icon Name", + "The name of the secondary icon to display", + NULL, + (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS)); + properties [PROP_TITLE] = g_param_spec_string ("title", "Title", @@ -241,6 +285,16 @@ } const gchar * +dzl_suggestion_get_secondary_icon_name (DzlSuggestion *self) +{ + DzlSuggestionPrivate *priv = dzl_suggestion_get_instance_private (self); + + g_return_val_if_fail (DZL_IS_SUGGESTION (self), NULL); + + return priv->secondary_icon_name; +} + +const gchar * dzl_suggestion_get_title (DzlSuggestion *self) { DzlSuggestionPrivate *priv = dzl_suggestion_get_instance_private (self); @@ -278,6 +332,23 @@ } void +dzl_suggestion_set_secondary_icon_name (DzlSuggestion *self, + const gchar *icon_name) +{ + DzlSuggestionPrivate *priv = dzl_suggestion_get_instance_private (self); + + g_return_if_fail (DZL_IS_SUGGESTION (self)); + + icon_name = g_intern_string (icon_name); + + if (priv->secondary_icon_name != icon_name) + { + priv->secondary_icon_name = icon_name; + g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SECONDARY_ICON_NAME]); + } +} + +void dzl_suggestion_set_id (DzlSuggestion *self, const gchar *id) { @@ -431,3 +502,49 @@ return NULL; } + +/** + * dzl_suggestion_get_secondary_icon: + * @self: a #DzlSuggestion + * + * Gets the secondary icon for the suggestion, if any. + * + * Returns: (transfer full) (nullable): a #GIcon or %NULL + * + * Since: 3.36 + */ +GIcon * +dzl_suggestion_get_secondary_icon (DzlSuggestion *self) +{ + g_return_val_if_fail (DZL_IS_SUGGESTION (self), NULL); + + return DZL_SUGGESTION_GET_CLASS (self)->get_secondary_icon (self); +} + +/** + * dzl_suggestion_get_secondary_icon_surface: + * @self: a #DzlSuggestion + * @widget: a widget that may contain the surface + * + * This function allows subclasses to dynamicly generate content for the + * suggestion such as may be required when integrating with favicons or + * similar. + * + * @widget is provided so that the implementation may determine scale or + * any other style-specific settings from the style context. + * + * Returns: (transfer full) (nullable): a #cairo_surface_t or %NULL + * + * Since: 3.36 + */ +cairo_surface_t * +dzl_suggestion_get_secondary_icon_surface (DzlSuggestion *self, + GtkWidget *widget) +{ + g_return_val_if_fail (DZL_IS_SUGGESTION (self), NULL); + + if (DZL_SUGGESTION_GET_CLASS (self)->get_secondary_icon_surface) + return DZL_SUGGESTION_GET_CLASS (self)->get_secondary_icon_surface (self, widget); + + return NULL; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/suggestions/dzl-suggestion.h new/libdazzle-3.36.0/src/suggestions/dzl-suggestion.h --- old/libdazzle-3.34.1/src/suggestions/dzl-suggestion.h 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/src/suggestions/dzl-suggestion.h 2020-03-06 21:17:59.548407600 +0100 @@ -42,9 +42,9 @@ GIcon *(*get_icon) (DzlSuggestion *self); cairo_surface_t *(*get_icon_surface) (DzlSuggestion *self, GtkWidget *widget); - - gpointer _reserved3; - gpointer _reserved4; + GIcon *(*get_secondary_icon) (DzlSuggestion *self); + cairo_surface_t *(*get_secondary_icon_surface) (DzlSuggestion *self, + GtkWidget *widget); }; DZL_AVAILABLE_IN_ALL @@ -80,6 +80,17 @@ DZL_AVAILABLE_IN_3_30 cairo_surface_t *dzl_suggestion_get_icon_surface (DzlSuggestion *self, GtkWidget *widget); +DZL_AVAILABLE_IN_3_36 +const gchar *dzl_suggestion_get_secondary_icon_name (DzlSuggestion *self); +DZL_AVAILABLE_IN_3_36 +void dzl_suggestion_set_secondary_icon_name (DzlSuggestion *self, + const gchar *icon_name); + +DZL_AVAILABLE_IN_3_36 +GIcon *dzl_suggestion_get_secondary_icon (DzlSuggestion *self); +DZL_AVAILABLE_IN_3_36 +cairo_surface_t *dzl_suggestion_get_secondary_icon_surface (DzlSuggestion *self, + GtkWidget *widget); G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdazzle-3.34.1/src/widgets/dzl-column-layout.c new/libdazzle-3.36.0/src/widgets/dzl-column-layout.c --- old/libdazzle-3.34.1/src/widgets/dzl-column-layout.c 2019-10-05 03:00:44.000000000 +0200 +++ new/libdazzle-3.36.0/src/widgets/dzl-column-layout.c 2020-03-06 21:17:59.551407600 +0100 @@ -18,6 +18,8 @@ #include "config.h" +#include <math.h> + #define G_LOG_DOMAIN "dzl-column-layout" #include "util/dzl-macros.h" @@ -120,9 +122,22 @@ } if (total_height <= height) - n_columns = 1; + { + n_columns = 1; + } else - n_columns = MAX (1, (width - (border_width * 2)) / (priv->column_width + priv->column_spacing)); + { + int estimated_cols; + int leftover; + + estimated_cols = round(width / priv->column_width); + leftover = (width % priv->column_width) - (border_width * 2) - (priv->column_spacing * (estimated_cols - 1)); + + if (leftover >= 0) + n_columns = estimated_cols; + else + n_columns = MAX(1, (estimated_cols - 1)); + } if (priv->max_columns > 0) n_columns = MIN (n_columns, (gint)priv->max_columns);