forked from AuroraMiddleware/gtk
Rely only on fg/bg colors.
"foreground-color" has been renamed to just "color" as in regular CSS, and the "text-color" and "base-color" properties have been removed. The default CSS has been changed to have widgets cope with this change.
This commit is contained in:
parent
7de2cf3286
commit
8ea649e0a0
@ -97,12 +97,12 @@
|
|||||||
* <programlisting>
|
* <programlisting>
|
||||||
* /* Theme all widgets defining the class entry */
|
* /* Theme all widgets defining the class entry */
|
||||||
* .entry {
|
* .entry {
|
||||||
* foreground-color: #39f1f9;
|
* color: #39f1f9;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* /* Theme spinbuttons' entry */
|
* /* Theme spinbuttons' entry */
|
||||||
* GtkSpinButton.entry {
|
* GtkSpinButton.entry {
|
||||||
* foreground-color: #900185;
|
* color: #900185;
|
||||||
* }
|
* }
|
||||||
* </programlisting>
|
* </programlisting>
|
||||||
* </example>
|
* </example>
|
||||||
@ -117,19 +117,19 @@
|
|||||||
* <programlisting>
|
* <programlisting>
|
||||||
* /* Theme any label within a notebook */
|
* /* Theme any label within a notebook */
|
||||||
* GtkNotebook GtkLabel {
|
* GtkNotebook GtkLabel {
|
||||||
* foreground-color: #f90192;
|
* color: #f90192;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* /* Theme labels within notebook tabs */
|
* /* Theme labels within notebook tabs */
|
||||||
* GtkNotebook tab:nth-child GtkLabel {
|
* GtkNotebook tab:nth-child GtkLabel {
|
||||||
* foreground-color: #703910;
|
* color: #703910;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* /* Theme labels in the any first notebook
|
* /* Theme labels in the any first notebook
|
||||||
* tab, both selectors are equivalent */
|
* tab, both selectors are equivalent */
|
||||||
* GtkNotebook tab:nth-child(first) GtkLabel,
|
* GtkNotebook tab:nth-child(first) GtkLabel,
|
||||||
* GtkNotebook tab:first-child GtkLabel {
|
* GtkNotebook tab:first-child GtkLabel {
|
||||||
* foreground-color: #89d012;
|
* color: #89d012;
|
||||||
* }
|
* }
|
||||||
* </programlisting>
|
* </programlisting>
|
||||||
* </example>
|
* </example>
|
||||||
@ -278,24 +278,18 @@
|
|||||||
* </row>
|
* </row>
|
||||||
* <row>
|
* <row>
|
||||||
* <entry>background-color</entry>
|
* <entry>background-color</entry>
|
||||||
* <entry morerows="3"><programlisting>color</programlisting></entry>
|
* <entry morerows="1"><programlisting>color</programlisting></entry>
|
||||||
* <entry morerows="3">#GdkRGBA</entry>
|
* <entry morerows="1">#GdkRGBA</entry>
|
||||||
* <entry morerows="3">
|
* <entry morerows="1">
|
||||||
* <programlisting>
|
* <programlisting>
|
||||||
* background-color: #fff;
|
* background-color: #fff;
|
||||||
* foreground-color: @color-name;
|
* color: @color-name;
|
||||||
* text-color: shade (@color-name, 0.5);
|
* background-color: shade (@color-name, 0.5);
|
||||||
* base-color: mix (@color-name, #f0f, 0.8);</programlisting>
|
* color: mix (@color-name, #f0f, 0.8);</programlisting>
|
||||||
* </entry>
|
* </entry>
|
||||||
* </row>
|
* </row>
|
||||||
* <row>
|
* <row>
|
||||||
* <entry>foreground-color</entry>
|
* <entry>color</entry>
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>text-color</entry>
|
|
||||||
* </row>
|
|
||||||
* <row>
|
|
||||||
* <entry>base-color</entry>
|
|
||||||
* </row>
|
* </row>
|
||||||
* <row>
|
* <row>
|
||||||
* <entry>font</entry>
|
* <entry>font</entry>
|
||||||
@ -2872,38 +2866,34 @@ gtk_css_provider_get_default (void)
|
|||||||
"*,\n"
|
"*,\n"
|
||||||
"GtkTreeView > GtkButton {\n"
|
"GtkTreeView > GtkButton {\n"
|
||||||
" background-color: @bg_color;\n"
|
" background-color: @bg_color;\n"
|
||||||
" foreground-color: @fg_color;\n"
|
" color: @fg_color;\n"
|
||||||
" text-color: @text_color; \n"
|
|
||||||
" base-color: @base_color; \n"
|
|
||||||
" border-color: shade (@bg_color, 0.7);\n"
|
" border-color: shade (@bg_color, 0.7);\n"
|
||||||
" padding: 2 2; \n"
|
" padding: 2 2; \n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"*:prelight {\n"
|
"*:prelight {\n"
|
||||||
" background-color: shade (@bg_color, 2.0);\n"
|
" background-color: shade (@bg_color, 2.0);\n"
|
||||||
" foreground-color: shade (@fg_color, 1.3);\n"
|
" color: shade (@fg_color, 1.3);\n"
|
||||||
" text-color: @selected_fg_color;\n"
|
|
||||||
" base-color: @selected_bg_color;\n"
|
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"*:selected {\n"
|
"*:selected {\n"
|
||||||
" background-color: @selected_bg_color;\n"
|
" background-color: @selected_bg_color;\n"
|
||||||
" foreground-color: @selected_fg_color;\n"
|
" color: @selected_fg_color;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"*:insensitive {\n"
|
"*:insensitive {\n"
|
||||||
" background-color: shade (@bg_color, 0.7);\n"
|
" background-color: shade (@bg_color, 0.7);\n"
|
||||||
" foreground-color: shade (@fg_color, 0.7);\n"
|
" color: shade (@fg_color, 0.7);\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"GtkTreeView, GtkIconView {\n"
|
"GtkTreeView, GtkIconView, GtkTextView {\n"
|
||||||
" background-color: @base_color;\n"
|
" background-color: @base_color;\n"
|
||||||
" foreground-color: @text_color;\n"
|
" color: @text_color;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"GtkTreeView > row {\n"
|
"GtkTreeView > row {\n"
|
||||||
" background-color: @base_color;\n"
|
" background-color: @base_color;\n"
|
||||||
" foreground-color: @text_color;\n"
|
" color: @text_color;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
"GtkTreeView > row:nth-child(odd) { \n"
|
"GtkTreeView > row:nth-child(odd) { \n"
|
||||||
@ -2912,7 +2902,7 @@ gtk_css_provider_get_default (void)
|
|||||||
"\n"
|
"\n"
|
||||||
".tooltip {\n"
|
".tooltip {\n"
|
||||||
" background-color: @tooltip_bg_color; \n"
|
" background-color: @tooltip_bg_color; \n"
|
||||||
" foreground-color: @tooltip_fg_color; \n"
|
" color: @tooltip_fg_color; \n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
".button,\n"
|
".button,\n"
|
||||||
@ -2929,7 +2919,7 @@ gtk_css_provider_get_default (void)
|
|||||||
".button:prelight,\n"
|
".button:prelight,\n"
|
||||||
".slider:prelight {\n"
|
".slider:prelight {\n"
|
||||||
" background-color: @selected_bg_color;\n"
|
" background-color: @selected_bg_color;\n"
|
||||||
" foreground-color: @selected_fg_color;\n"
|
" color: @selected_fg_color;\n"
|
||||||
" border-color: shade (@selected_bg_color, 0.7);\n"
|
" border-color: shade (@selected_bg_color, 0.7);\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -2941,6 +2931,22 @@ gtk_css_provider_get_default (void)
|
|||||||
".entry {\n"
|
".entry {\n"
|
||||||
" border-style: inset;\n"
|
" border-style: inset;\n"
|
||||||
" border-width: 2;\n"
|
" border-width: 2;\n"
|
||||||
|
" background-color: @base_color;\n"
|
||||||
|
" color: @text_color;\n"
|
||||||
|
"}\n"
|
||||||
|
".check, .radio {\n"
|
||||||
|
" background-color: @base_color;\n"
|
||||||
|
" color: @text_color;\n"
|
||||||
|
"}\n"
|
||||||
|
"\n"
|
||||||
|
".menu.check,\n"
|
||||||
|
".menu.radio {\n"
|
||||||
|
" color: @fg_color;\n"
|
||||||
|
"}\n"
|
||||||
|
"\n"
|
||||||
|
".menu:hover {\n"
|
||||||
|
" background-color: @selected_bg_color;\n"
|
||||||
|
" border-style: none;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n"
|
"\n"
|
||||||
".viewport {\n"
|
".viewport {\n"
|
||||||
|
@ -655,19 +655,19 @@ set_color (GtkStyle *style,
|
|||||||
break;
|
break;
|
||||||
case GTK_RC_FG:
|
case GTK_RC_FG:
|
||||||
gtk_style_context_get (context, state,
|
gtk_style_context_get (context, state,
|
||||||
"foreground-color", &color,
|
"color", &color,
|
||||||
NULL);
|
NULL);
|
||||||
dest = &style->fg[state];
|
dest = &style->fg[state];
|
||||||
break;
|
break;
|
||||||
case GTK_RC_TEXT:
|
case GTK_RC_TEXT:
|
||||||
gtk_style_context_get (context, state,
|
gtk_style_context_get (context, state,
|
||||||
"text-color", &color,
|
"color", &color,
|
||||||
NULL);
|
NULL);
|
||||||
dest = &style->text[state];
|
dest = &style->text[state];
|
||||||
break;
|
break;
|
||||||
case GTK_RC_BASE:
|
case GTK_RC_BASE:
|
||||||
gtk_style_context_get (context, state,
|
gtk_style_context_get (context, state,
|
||||||
"base-color", &color,
|
"background-color", &color,
|
||||||
NULL);
|
NULL);
|
||||||
dest = &style->base[state];
|
dest = &style->base[state];
|
||||||
break;
|
break;
|
||||||
@ -694,11 +694,29 @@ gtk_style_update_from_context (GtkStyle *style)
|
|||||||
|
|
||||||
for (state = GTK_STATE_NORMAL; state <= GTK_STATE_INSENSITIVE; state++)
|
for (state = GTK_STATE_NORMAL; state <= GTK_STATE_INSENSITIVE; state++)
|
||||||
{
|
{
|
||||||
|
if (gtk_style_context_has_class (priv->context, "entry"))
|
||||||
|
{
|
||||||
|
gtk_style_context_save (priv->context);
|
||||||
|
gtk_style_context_remove_class (priv->context, "entry");
|
||||||
set_color (style, priv->context, state, GTK_RC_BG);
|
set_color (style, priv->context, state, GTK_RC_BG);
|
||||||
set_color (style, priv->context, state, GTK_RC_FG);
|
set_color (style, priv->context, state, GTK_RC_FG);
|
||||||
|
gtk_style_context_restore (priv->context);
|
||||||
|
|
||||||
set_color (style, priv->context, state, GTK_RC_BASE);
|
set_color (style, priv->context, state, GTK_RC_BASE);
|
||||||
set_color (style, priv->context, state, GTK_RC_TEXT);
|
set_color (style, priv->context, state, GTK_RC_TEXT);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gtk_style_context_save (priv->context);
|
||||||
|
gtk_style_context_add_class (priv->context, "entry");
|
||||||
|
set_color (style, priv->context, state, GTK_RC_BASE);
|
||||||
|
set_color (style, priv->context, state, GTK_RC_TEXT);
|
||||||
|
gtk_style_context_restore (priv->context);
|
||||||
|
|
||||||
|
set_color (style, priv->context, state, GTK_RC_BG);
|
||||||
|
set_color (style, priv->context, state, GTK_RC_FG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (style->font_desc)
|
if (style->font_desc)
|
||||||
pango_font_description_free (style->font_desc);
|
pango_font_description_free (style->font_desc);
|
||||||
@ -1831,6 +1849,8 @@ transform_detail_string (const gchar *detail,
|
|||||||
gtk_style_context_add_class (context, "slider");
|
gtk_style_context_add_class (context, "slider");
|
||||||
gtk_style_context_add_class (context, "scrollbar");
|
gtk_style_context_add_class (context, "scrollbar");
|
||||||
}
|
}
|
||||||
|
else if (strcmp (detail, "menuitem") == 0)
|
||||||
|
gtk_style_context_add_class (context, "menu");
|
||||||
else if (g_str_has_prefix (detail, "cell"))
|
else if (g_str_has_prefix (detail, "cell"))
|
||||||
{
|
{
|
||||||
GtkRegionFlags row, col;
|
GtkRegionFlags row, col;
|
||||||
|
@ -81,10 +81,8 @@ gtk_style_set_class_init (GtkStyleSetClass *klass)
|
|||||||
object_class->finalize = gtk_style_set_finalize;
|
object_class->finalize = gtk_style_set_finalize;
|
||||||
|
|
||||||
/* Initialize default property set */
|
/* Initialize default property set */
|
||||||
gtk_style_set_register_property ("foreground-color", GDK_TYPE_RGBA, NULL, NULL);
|
gtk_style_set_register_property ("color", GDK_TYPE_RGBA, NULL, NULL);
|
||||||
gtk_style_set_register_property ("background-color", GDK_TYPE_RGBA, NULL, NULL);
|
gtk_style_set_register_property ("background-color", GDK_TYPE_RGBA, NULL, NULL);
|
||||||
gtk_style_set_register_property ("text-color", GDK_TYPE_RGBA, NULL, NULL);
|
|
||||||
gtk_style_set_register_property ("base-color", GDK_TYPE_RGBA, NULL, NULL);
|
|
||||||
|
|
||||||
gtk_style_set_register_property ("font", PANGO_TYPE_FONT_DESCRIPTION, NULL, NULL);
|
gtk_style_set_register_property ("font", PANGO_TYPE_FONT_DESCRIPTION, NULL, NULL);
|
||||||
|
|
||||||
|
@ -865,7 +865,7 @@ gtk_theming_engine_render_check (GtkThemingEngine *engine,
|
|||||||
gdouble width,
|
gdouble width,
|
||||||
gdouble height)
|
gdouble height)
|
||||||
{
|
{
|
||||||
GdkRGBA *fg_color, *base_color, *text_color;
|
GdkRGBA *fg_color, *bg_color;
|
||||||
const GtkWidgetPath *path;
|
const GtkWidgetPath *path;
|
||||||
GtkStateFlags flags;
|
GtkStateFlags flags;
|
||||||
gint exterior_size, interior_size, thickness, pad;
|
gint exterior_size, interior_size, thickness, pad;
|
||||||
@ -875,9 +875,8 @@ gtk_theming_engine_render_check (GtkThemingEngine *engine,
|
|||||||
cairo_save (cr);
|
cairo_save (cr);
|
||||||
|
|
||||||
gtk_theming_engine_get (engine, flags,
|
gtk_theming_engine_get (engine, flags,
|
||||||
"foreground-color", &fg_color,
|
"color", &fg_color,
|
||||||
"base-color", &base_color,
|
"background-color", &bg_color,
|
||||||
"text-color", &text_color,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
exterior_size = MIN (width, height);
|
exterior_size = MIN (width, height);
|
||||||
@ -904,21 +903,15 @@ gtk_theming_engine_render_check (GtkThemingEngine *engine,
|
|||||||
cairo_set_line_width (cr, 1.0);
|
cairo_set_line_width (cr, 1.0);
|
||||||
|
|
||||||
cairo_rectangle (cr, x + 0.5, y + 0.5, exterior_size - 1, exterior_size - 1);
|
cairo_rectangle (cr, x + 0.5, y + 0.5, exterior_size - 1, exterior_size - 1);
|
||||||
gdk_cairo_set_source_rgba (cr, base_color);
|
gdk_cairo_set_source_rgba (cr, bg_color);
|
||||||
cairo_fill_preserve (cr);
|
cairo_fill_preserve (cr);
|
||||||
|
|
||||||
if (gtk_theming_engine_has_class (engine, "cell"))
|
|
||||||
gdk_cairo_set_source_rgba (cr, text_color);
|
|
||||||
else
|
|
||||||
gdk_cairo_set_source_rgba (cr, fg_color);
|
gdk_cairo_set_source_rgba (cr, fg_color);
|
||||||
|
|
||||||
cairo_stroke (cr);
|
cairo_stroke (cr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gtk_theming_engine_has_class (engine, "menu"))
|
|
||||||
gdk_cairo_set_source_rgba (cr, fg_color);
|
gdk_cairo_set_source_rgba (cr, fg_color);
|
||||||
else
|
|
||||||
gdk_cairo_set_source_rgba (cr, text_color);
|
|
||||||
|
|
||||||
if (flags & GTK_STATE_FLAG_INCONSISTENT)
|
if (flags & GTK_STATE_FLAG_INCONSISTENT)
|
||||||
{
|
{
|
||||||
@ -977,8 +970,6 @@ gtk_theming_engine_render_check (GtkThemingEngine *engine,
|
|||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
|
|
||||||
gdk_rgba_free (fg_color);
|
gdk_rgba_free (fg_color);
|
||||||
gdk_rgba_free (base_color);
|
|
||||||
gdk_rgba_free (text_color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -990,7 +981,7 @@ gtk_theming_engine_render_option (GtkThemingEngine *engine,
|
|||||||
gdouble height)
|
gdouble height)
|
||||||
{
|
{
|
||||||
GtkStateFlags flags;
|
GtkStateFlags flags;
|
||||||
GdkRGBA *base_color, *fg_color, *text_color;
|
GdkRGBA *fg_color, *bg_color;
|
||||||
const GtkWidgetPath *path;
|
const GtkWidgetPath *path;
|
||||||
gint exterior_size, interior_size, pad, thickness;
|
gint exterior_size, interior_size, pad, thickness;
|
||||||
gdouble radius;
|
gdouble radius;
|
||||||
@ -1002,9 +993,8 @@ gtk_theming_engine_render_option (GtkThemingEngine *engine,
|
|||||||
cairo_save (cr);
|
cairo_save (cr);
|
||||||
|
|
||||||
gtk_theming_engine_get (engine, flags,
|
gtk_theming_engine_get (engine, flags,
|
||||||
"foreground-color", &fg_color,
|
"color", &fg_color,
|
||||||
"base-color", &base_color,
|
"background-color", &bg_color,
|
||||||
"text-color", &text_color,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
exterior_size = MIN (width, height);
|
exterior_size = MIN (width, height);
|
||||||
@ -1017,7 +1007,7 @@ gtk_theming_engine_render_option (GtkThemingEngine *engine,
|
|||||||
|
|
||||||
if (!gtk_theming_engine_has_class (engine, "menu"))
|
if (!gtk_theming_engine_has_class (engine, "menu"))
|
||||||
{
|
{
|
||||||
gdk_cairo_set_source_rgba (cr, base_color);
|
gdk_cairo_set_source_rgba (cr, bg_color);
|
||||||
|
|
||||||
cairo_arc (cr,
|
cairo_arc (cr,
|
||||||
x + exterior_size / 2.,
|
x + exterior_size / 2.,
|
||||||
@ -1027,19 +1017,13 @@ gtk_theming_engine_render_option (GtkThemingEngine *engine,
|
|||||||
|
|
||||||
cairo_fill_preserve (cr);
|
cairo_fill_preserve (cr);
|
||||||
|
|
||||||
if (gtk_theming_engine_has_class (engine, "cell"))
|
|
||||||
gdk_cairo_set_source_rgba (cr, text_color);
|
|
||||||
else
|
|
||||||
gdk_cairo_set_source_rgba (cr, fg_color);
|
gdk_cairo_set_source_rgba (cr, fg_color);
|
||||||
|
|
||||||
cairo_set_line_width (cr, 1.);
|
cairo_set_line_width (cr, 1.);
|
||||||
cairo_stroke (cr);
|
cairo_stroke (cr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gtk_theming_engine_has_class (engine, "menu"))
|
|
||||||
gdk_cairo_set_source_rgba (cr, fg_color);
|
gdk_cairo_set_source_rgba (cr, fg_color);
|
||||||
else
|
|
||||||
gdk_cairo_set_source_rgba (cr, text_color);
|
|
||||||
|
|
||||||
/* FIXME: thickness */
|
/* FIXME: thickness */
|
||||||
thickness = 1;
|
thickness = 1;
|
||||||
@ -1088,8 +1072,7 @@ gtk_theming_engine_render_option (GtkThemingEngine *engine,
|
|||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
|
|
||||||
gdk_rgba_free (fg_color);
|
gdk_rgba_free (fg_color);
|
||||||
gdk_rgba_free (base_color);
|
gdk_rgba_free (bg_color);
|
||||||
gdk_rgba_free (text_color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1128,7 +1111,7 @@ gtk_theming_engine_render_arrow (GtkThemingEngine *engine,
|
|||||||
flags = gtk_theming_engine_get_state (engine);
|
flags = gtk_theming_engine_get_state (engine);
|
||||||
|
|
||||||
gtk_theming_engine_get (engine, flags,
|
gtk_theming_engine_get (engine, flags,
|
||||||
"foreground-color", &fg_color,
|
"color", &fg_color,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (flags & GTK_STATE_FLAG_INSENSITIVE)
|
if (flags & GTK_STATE_FLAG_INSENSITIVE)
|
||||||
@ -1350,7 +1333,7 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
gdouble width,
|
gdouble width,
|
||||||
gdouble height)
|
gdouble height)
|
||||||
{
|
{
|
||||||
GdkRGBA *bg_color, *base_color;
|
GdkRGBA *bg_color;
|
||||||
cairo_pattern_t *pattern;
|
cairo_pattern_t *pattern;
|
||||||
GtkStateFlags flags;
|
GtkStateFlags flags;
|
||||||
gboolean running;
|
gboolean running;
|
||||||
@ -1374,7 +1357,6 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
gtk_theming_engine_get (engine, flags,
|
gtk_theming_engine_get (engine, flags,
|
||||||
"background-image", &pattern,
|
"background-image", &pattern,
|
||||||
"background-color", &bg_color,
|
"background-color", &bg_color,
|
||||||
"base-color", &base_color,
|
|
||||||
"border-radius", &radius,
|
"border-radius", &radius,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
@ -1399,7 +1381,7 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
{
|
{
|
||||||
cairo_pattern_t *other_pattern;
|
cairo_pattern_t *other_pattern;
|
||||||
GtkStateFlags other_flags;
|
GtkStateFlags other_flags;
|
||||||
GdkRGBA *other_bg, *other_base;
|
GdkRGBA *other_bg;
|
||||||
cairo_pattern_t *new_pattern = NULL;
|
cairo_pattern_t *new_pattern = NULL;
|
||||||
|
|
||||||
if (flags & GTK_STATE_FLAG_PRELIGHT)
|
if (flags & GTK_STATE_FLAG_PRELIGHT)
|
||||||
@ -1413,7 +1395,6 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
gtk_theming_engine_get (engine, other_flags,
|
gtk_theming_engine_get (engine, other_flags,
|
||||||
"background-image", &other_pattern,
|
"background-image", &other_pattern,
|
||||||
"background-color", &other_bg,
|
"background-color", &other_bg,
|
||||||
"base-color", &other_base,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (pattern && other_pattern)
|
if (pattern && other_pattern)
|
||||||
@ -1499,7 +1480,7 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
else if (pattern || other_pattern)
|
else if (pattern || other_pattern)
|
||||||
{
|
{
|
||||||
cairo_pattern_t *p;
|
cairo_pattern_t *p;
|
||||||
GdkRGBA *c;
|
const GdkRGBA *c;
|
||||||
gdouble x0, y0, x1, y1, r0, r1;
|
gdouble x0, y0, x1, y1, r0, r1;
|
||||||
gint n, i;
|
gint n, i;
|
||||||
|
|
||||||
@ -1507,13 +1488,13 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
if (pattern)
|
if (pattern)
|
||||||
{
|
{
|
||||||
p = pattern;
|
p = pattern;
|
||||||
c = gtk_theming_engine_has_class (engine, "entry") ? other_base : other_bg;
|
c = other_bg;
|
||||||
progress = 1 - progress;
|
progress = 1 - progress;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p = other_pattern;
|
p = other_pattern;
|
||||||
c = gtk_theming_engine_has_class (engine, "entry") ? base_color : bg_color;
|
c = bg_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cairo_pattern_get_type (p) == CAIRO_PATTERN_TYPE_LINEAR)
|
if (cairo_pattern_get_type (p) == CAIRO_PATTERN_TYPE_LINEAR)
|
||||||
@ -1550,16 +1531,8 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
const GdkRGBA *color, *other_color;
|
const GdkRGBA *color, *other_color;
|
||||||
|
|
||||||
/* Merge just colors */
|
/* Merge just colors */
|
||||||
if (gtk_theming_engine_has_class (engine, "entry"))
|
|
||||||
{
|
|
||||||
color = base_color;
|
|
||||||
other_color = other_base;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
color = bg_color;
|
color = bg_color;
|
||||||
other_color = other_bg;
|
other_color = other_bg;
|
||||||
}
|
|
||||||
|
|
||||||
new_pattern = cairo_pattern_create_rgba (CLAMP (color->red + ((other_color->red - color->red) * progress), 0, 1),
|
new_pattern = cairo_pattern_create_rgba (CLAMP (color->red + ((other_color->red - color->red) * progress), 0, 1),
|
||||||
CLAMP (color->green + ((other_color->green - color->green) * progress), 0, 1),
|
CLAMP (color->green + ((other_color->green - color->green) * progress), 0, 1),
|
||||||
@ -1579,9 +1552,6 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
|
|
||||||
if (other_bg)
|
if (other_bg)
|
||||||
gdk_rgba_free (other_bg);
|
gdk_rgba_free (other_bg);
|
||||||
|
|
||||||
if (other_base)
|
|
||||||
gdk_rgba_free (other_base);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_rectangle (cr, 0, 0, 1, 1);
|
cairo_rectangle (cr, 0, 0, 1, 1);
|
||||||
@ -1591,13 +1561,8 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
cairo_set_source (cr, pattern);
|
cairo_set_source (cr, pattern);
|
||||||
cairo_pattern_destroy (pattern);
|
cairo_pattern_destroy (pattern);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (gtk_theming_engine_has_class (engine, "entry"))
|
|
||||||
gdk_cairo_set_source_rgba (cr, base_color);
|
|
||||||
else
|
else
|
||||||
gdk_cairo_set_source_rgba (cr, bg_color);
|
gdk_cairo_set_source_rgba (cr, bg_color);
|
||||||
}
|
|
||||||
|
|
||||||
if (gtk_theming_engine_has_class (engine, "tooltip"))
|
if (gtk_theming_engine_has_class (engine, "tooltip"))
|
||||||
{
|
{
|
||||||
@ -1622,7 +1587,6 @@ gtk_theming_engine_render_background (GtkThemingEngine *engine,
|
|||||||
|
|
||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
|
|
||||||
gdk_rgba_free (base_color);
|
|
||||||
gdk_rgba_free (bg_color);
|
gdk_rgba_free (bg_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1780,7 +1744,7 @@ gtk_theming_engine_render_expander (GtkThemingEngine *engine,
|
|||||||
gdouble height)
|
gdouble height)
|
||||||
{
|
{
|
||||||
GtkStateFlags flags;
|
GtkStateFlags flags;
|
||||||
GdkRGBA *bg_color, *fg_color, *base_color;
|
GdkRGBA *bg_color, *fg_color;
|
||||||
double vertical_overshoot;
|
double vertical_overshoot;
|
||||||
int diameter;
|
int diameter;
|
||||||
double radius;
|
double radius;
|
||||||
@ -1795,9 +1759,8 @@ gtk_theming_engine_render_expander (GtkThemingEngine *engine,
|
|||||||
flags = gtk_theming_engine_get_state (engine);
|
flags = gtk_theming_engine_get_state (engine);
|
||||||
|
|
||||||
gtk_theming_engine_get (engine, flags,
|
gtk_theming_engine_get (engine, flags,
|
||||||
"foreground-color", &fg_color,
|
"color", &fg_color,
|
||||||
"background-color", &bg_color,
|
"background-color", &bg_color,
|
||||||
"base-color", &base_color,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
line_width = 1;
|
line_width = 1;
|
||||||
@ -1863,10 +1826,7 @@ gtk_theming_engine_render_expander (GtkThemingEngine *engine,
|
|||||||
|
|
||||||
cairo_set_line_width (cr, line_width);
|
cairo_set_line_width (cr, line_width);
|
||||||
|
|
||||||
if (flags & GTK_STATE_FLAG_PRELIGHT)
|
|
||||||
gdk_cairo_set_source_rgba (cr, fg_color);
|
gdk_cairo_set_source_rgba (cr, fg_color);
|
||||||
else
|
|
||||||
gdk_cairo_set_source_rgba (cr, base_color);
|
|
||||||
|
|
||||||
cairo_fill_preserve (cr);
|
cairo_fill_preserve (cr);
|
||||||
|
|
||||||
@ -1875,7 +1835,6 @@ gtk_theming_engine_render_expander (GtkThemingEngine *engine,
|
|||||||
|
|
||||||
cairo_restore (cr);
|
cairo_restore (cr);
|
||||||
|
|
||||||
gdk_rgba_free (base_color);
|
|
||||||
gdk_rgba_free (fg_color);
|
gdk_rgba_free (fg_color);
|
||||||
gdk_rgba_free (bg_color);
|
gdk_rgba_free (bg_color);
|
||||||
}
|
}
|
||||||
@ -1897,7 +1856,7 @@ gtk_theming_engine_render_focus (GtkThemingEngine *engine,
|
|||||||
flags = gtk_theming_engine_get_state (engine);
|
flags = gtk_theming_engine_get_state (engine);
|
||||||
|
|
||||||
gtk_theming_engine_get (engine, flags,
|
gtk_theming_engine_get (engine, flags,
|
||||||
"foreground-color", &color,
|
"color", &color,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
gtk_theming_engine_get_style (engine,
|
gtk_theming_engine_get_style (engine,
|
||||||
@ -2044,7 +2003,7 @@ gtk_theming_engine_render_layout (GtkThemingEngine *engine,
|
|||||||
flags = gtk_theming_engine_get_state (engine);
|
flags = gtk_theming_engine_get_state (engine);
|
||||||
|
|
||||||
gtk_theming_engine_get (engine, flags,
|
gtk_theming_engine_get (engine, flags,
|
||||||
"foreground-color", &fg_color,
|
"color", &fg_color,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
screen = gtk_theming_engine_get_screen (engine);
|
screen = gtk_theming_engine_get_screen (engine);
|
||||||
|
Loading…
Reference in New Issue
Block a user