summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2021-02-07 23:21:55 +0100
committerFlorian Müllner <fmuellner@gnome.org>2021-02-08 15:41:08 +0100
commitf19c75d9c3effde50287aea5d7a87c71c2707fc2 (patch)
treeeb1485501d55914308aef598b94d32122233c6cd
parent39d5d6ad1356c485c9a822270023b39e69c3ce5f (diff)
downloadgnome-shell-f19c75d9c3effde50287aea5d7a87c71c2707fc2.tar.gz
st: Test for :insensitive styling
Commit 473e77e2c5a fixed applying the :insensitive pseudo class to initially unreactive widgets, and adjusted the style test to work with that. In hindsight, we can do better than just making the test work, and include a test case for the :insensitive styling as well (namely the issue the previous commit was fixing). Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1649>
-rw-r--r--src/st/test-theme.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/st/test-theme.c b/src/st/test-theme.c
index 6aff82b0d..1d7bf517d 100644
--- a/src/st/test-theme.c
+++ b/src/st/test-theme.c
@@ -465,8 +465,6 @@ test_pseudo_class (void)
/* Test the StWidget add/remove pseudo_class interfaces */
label = st_label_new ("foo");
- /* Make reactive, so we don't get the automatic :insensitive style */
- clutter_actor_set_reactive (CLUTTER_ACTOR (label), TRUE);
clutter_actor_add_child (stage, CLUTTER_ACTOR (label));
labelNode = st_widget_get_theme_node (label);
@@ -515,12 +513,16 @@ test_pseudo_class (void)
st_theme_node_get_border_width (labelNode, ST_SIDE_TOP));
st_widget_remove_style_pseudo_class (label, "boxed");
- g_assert (st_widget_get_style_pseudo_class (label) == NULL);
+ g_assert (!st_widget_has_style_pseudo_class (label, "boxed"));
+ g_assert (st_widget_has_style_pseudo_class (label, "insensitive"));
labelNode = st_widget_get_theme_node (label);
assert_foreground_color (labelNode, "label", 0x000000ff);
assert_text_decoration (labelNode, "label", 0);
assert_length ("label", "border-width", 0.,
st_theme_node_get_border_width (labelNode, ST_SIDE_TOP));
+
+ clutter_actor_set_reactive (CLUTTER_ACTOR (label), TRUE);
+ g_assert (st_widget_get_style_pseudo_class (label) == NULL);
}
static void