]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkthemingengine.c
spinbutton: don't override initial text in non-numeric-only spin buttons
[~andy/gtk] / gtk / gtkthemingengine.c
index 0c74afbd64430c7a5a505dc7388086e93f56db88..8a0ae4700c65f1ebeef0c0247c051a1dcaf084a0 100644 (file)
@@ -35,6 +35,7 @@
 #include "gtkcssrgbavalueprivate.h"
 #include "gtkcssshadowsvalueprivate.h"
 #include "gtkcsstypesprivate.h"
+#include "gtkhslaprivate.h"
 #include "gtkthemingengineprivate.h"
 #include "gtkroundedboxprivate.h"
 #include "gtkthemingbackgroundprivate.h"
@@ -354,16 +355,6 @@ _gtk_theming_engine_peek_property (GtkThemingEngine *engine,
   return _gtk_style_context_peek_property (engine->priv->context, property_id);
 }
 
-double
-_gtk_theming_engine_get_number (GtkThemingEngine *engine,
-                                guint             property_id,
-                                double            one_hundred_percent)
-{
-  g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), 0.0);
-
-  return _gtk_style_context_get_number (engine->priv->context, property_id, one_hundred_percent);
-}
-
 /**
  * gtk_theming_engine_get_property:
  * @engine: a #GtkThemingEngine
@@ -679,6 +670,10 @@ gtk_theming_engine_has_region (GtkThemingEngine *engine,
  * Returns: the widget direction
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: Use gtk_theming_engine_get_state() and
+ *   check for #GTK_STATE_FLAG_DIR_LTR and
+ *   #GTK_STATE_FLAG_DIR_RTL instead.
  **/
 GtkTextDirection
 gtk_theming_engine_get_direction (GtkThemingEngine *engine)
@@ -688,7 +683,9 @@ gtk_theming_engine_get_direction (GtkThemingEngine *engine)
   g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), GTK_TEXT_DIR_LTR);
 
   priv = engine->priv;
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
   return gtk_style_context_get_direction (priv->context);
+  G_GNUC_END_IGNORE_DEPRECATIONS;
 }
 
 /**
@@ -862,6 +859,8 @@ gtk_theming_engine_get_margin (GtkThemingEngine *engine,
  *          freed.
  *
  * Since: 3.0
+ *
+ * Deprecated: 3.8: Use gtk_theming_engine_get()
  **/
 const PangoFontDescription *
 gtk_theming_engine_get_font (GtkThemingEngine *engine,
@@ -871,8 +870,10 @@ gtk_theming_engine_get_font (GtkThemingEngine *engine,
 
   g_return_val_if_fail (GTK_IS_THEMING_ENGINE (engine), NULL);
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
   priv = engine->priv;
   return gtk_style_context_get_font (priv->context, state);
+  G_GNUC_END_IGNORE_DEPRECATIONS;
 }
 
 /* GtkThemingModule */
@@ -1339,14 +1340,11 @@ color_shade (const GdkRGBA *color,
              gdouble        factor,
              GdkRGBA       *color_return)
 {
-  GtkSymbolicColor *literal, *shade;
+  GtkHSLA hsla;
 
-  literal = gtk_symbolic_color_new_literal (color);
-  shade = gtk_symbolic_color_new_shade (literal, factor);
-  gtk_symbolic_color_unref (literal);
-
-  gtk_symbolic_color_resolve (shade, NULL, color_return);
-  gtk_symbolic_color_unref (shade);
+  _gtk_hsla_init_from_rgba (&hsla, color);
+  _gtk_hsla_shade (&hsla, &hsla, factor);
+  _gdk_rgba_init_from_hsla (color_return, &hsla);
 }
 
 static void
@@ -1658,6 +1656,7 @@ render_border (cairo_t       *cr,
                                      2 * other_border[GTK_CSS_LEFT]);
             render_frame_fill (cr, &other_box, other_border, colors, dont_draw);
           }
+          break;
         case GTK_BORDER_STYLE_GROOVE:
         case GTK_BORDER_STYLE_RIDGE:
           {
@@ -1815,7 +1814,7 @@ gtk_theming_engine_render_expander (GtkThemingEngine *engine,
   gtk_theming_engine_get_color (engine, flags, &fg_color);
   gtk_theming_engine_get_border_color (engine, flags, &outline_color);
 
-  is_rtl = (gtk_theming_engine_get_direction (engine) == GTK_TEXT_DIR_RTL);
+  is_rtl = (gtk_theming_engine_get_state (engine) & GTK_STATE_FLAG_DIR_RTL);
   line_width = 1;
   progress = (flags & GTK_STATE_FLAG_ACTIVE) ? 1 : 0;