| 1 |
/* |
| 2 |
* Copyright (C) 2016 Red Hat Inc. |
| 3 |
* |
| 4 |
* Author: |
| 5 |
* Matthias Clasen <[email protected]> |
| 6 |
* |
| 7 |
* This library is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU Library General Public |
| 9 |
* License as published by the Free Software Foundation; either |
| 10 |
* version 2 of the License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* This library is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
* Library General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU Library General Public |
| 18 |
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
#include "config.h" |
| 22 |
|
| 23 |
#include <gtk/gtk.h> |
| 24 |
|
| 25 |
#include "gtk-reftest.h" |
| 26 |
|
| 27 |
static gboolean |
| 28 |
unblock (gpointer data) |
| 29 |
{ |
| 30 |
reftest_uninhibit_snapshot (); |
| 31 |
return G_SOURCE_REMOVE; |
| 32 |
} |
| 33 |
|
| 34 |
G_MODULE_EXPORT void |
| 35 |
strip_attributes_if_no_animation (GtkWidget *widget) |
| 36 |
{ |
| 37 |
gboolean enabled; |
| 38 |
|
| 39 |
g_object_get (gtk_widget_get_settings (widget), "gtk-enable-animations", &enabled, NULL); |
| 40 |
if (enabled) |
| 41 |
return; |
| 42 |
|
| 43 |
g_message ("Unsetting text attributes because animation is disabled."); |
| 44 |
|
| 45 |
reftest_inhibit_snapshot (); |
| 46 |
gtk_label_set_attributes (GTK_LABEL (widget), NULL); |
| 47 |
g_timeout_add (500, unblock, NULL); |
| 48 |
} |