[gnome-shell/wip/fmuellner/no-cairo-texture] test-theme: Stop using ClutterCairoTexture



commit ffb9aa1ace60b87e167b3704d4e23b500a8b02eb
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Feb 26 03:00:05 2019 +0100

    test-theme: Stop using ClutterCairoTexture
    
    It's deprecated, so use one of our own types for testing type
    inheritance.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/420

 src/st/test-theme.c   | 23 ++++++++++++-----------
 src/st/test-theme.css |  6 +++---
 2 files changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/src/st/test-theme.c b/src/st/test-theme.c
index 225b95fc5..a6fc9a5f5 100644
--- a/src/st/test-theme.c
+++ b/src/st/test-theme.c
@@ -22,6 +22,7 @@
 #include "st-theme.h"
 #include "st-theme-context.h"
 #include "st-label.h"
+#include "st-button.h"
 #include <math.h>
 #include <string.h>
 
@@ -37,7 +38,7 @@ static StThemeNode *group3;
 static StThemeNode *group4;
 static StThemeNode *group5;
 static StThemeNode *group6;
-static StThemeNode *cairo_texture;
+static StThemeNode *button;
 static gboolean fail;
 
 static const char *test;
@@ -280,7 +281,7 @@ test_classes (void)
 {
   test = "classes";
   /* .special-text class overrides size and style;
-   * the ClutterTexture.special-text selector doesn't match */
+   * the StBin.special-text selector doesn't match */
   assert_font (text1, "text1", "sans-serif Italic 32px");
 }
 
@@ -288,12 +289,12 @@ static void
 test_type_inheritance (void)
 {
   test = "type_inheritance";
-  /* From ClutterTexture element selector */
-  assert_length ("cairoTexture", "padding-top", 10.,
-                st_theme_node_get_padding (cairo_texture, ST_SIDE_TOP));
-  /* From ClutterCairoTexture element selector */
-  assert_length ("cairoTexture", "padding-right", 20.,
-                st_theme_node_get_padding (cairo_texture, ST_SIDE_RIGHT));
+  /* From StBin element selector */
+  assert_length ("button", "padding-top", 10.,
+                st_theme_node_get_padding (button, ST_SIDE_TOP));
+  /* From StButton element selector */
+  assert_length ("button", "padding-right", 20.,
+                st_theme_node_get_padding (button, ST_SIDE_RIGHT));
 }
 
 static void
@@ -575,8 +576,8 @@ main (int argc, char **argv)
                               CLUTTER_TYPE_TEXT, "text4", NULL, "visited hover", NULL);
   group3 = st_theme_node_new (context, group2, NULL,
                               CLUTTER_TYPE_GROUP, "group3", NULL, "hover", NULL);
-  cairo_texture = st_theme_node_new (context, root, NULL,
-                                     CLUTTER_TYPE_CAIRO_TEXTURE, "cairoTexture", NULL, NULL, NULL);
+  button = st_theme_node_new (context, root, NULL,
+                              ST_TYPE_BUTTON, "button", NULL, NULL, NULL);
 
   test_defaults ();
   test_lengths ();
@@ -592,7 +593,7 @@ main (int argc, char **argv)
   test_pseudo_class ();
   test_inline_style ();
 
-  g_object_unref (cairo_texture);
+  g_object_unref (button);
   g_object_unref (group1);
   g_object_unref (group2);
   g_object_unref (group3);
diff --git a/src/st/test-theme.css b/src/st/test-theme.css
index d1816648d..d18025564 100644
--- a/src/st/test-theme.css
+++ b/src/st/test-theme.css
@@ -26,7 +26,7 @@ stage {
     font-style: italic;
 }
 
-ClutterTexture.special-text {
+StBin.special-text {
     font-weight: bold;
 }
 
@@ -52,11 +52,11 @@ ClutterTexture.special-text {
     font-feature-settings: normal;
 }
 
-ClutterTexture {
+StBin {
     padding: 10px;
 }
 
-ClutterCairoTexture {
+StButton {
     padding-right: 20px;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]