Skip to content
Snippets Groups Projects
Commit 5e05c763 authored by Bruce Cowan's avatar Bruce Cowan :airplane:
Browse files

Some theming changes

parent 2d2e4fe7
No related branches found
No related tags found
No related merge requests found
......@@ -17,9 +17,9 @@ struct _RugbyCellRendererScorePrivate
};
/* Style classes for the different types of score */
#define RUGBY_STYLE_CLASS_TRY "try"
#define RUGBY_STYLE_CLASS_UTRY "utry"
#define RUGBY_STYLE_CLASS_KICK "kick"
#define RUGBY_STYLE_CLASS_TRY "score-try"
#define RUGBY_STYLE_CLASS_UTRY "score-utry"
#define RUGBY_STYLE_CLASS_KICK "score-kick"
G_DEFINE_TYPE (RugbyCellRendererScore, rugby_cell_renderer_score, GTK_TYPE_CELL_RENDERER)
......@@ -136,7 +136,7 @@ render_bar (GtkStyleContext *context,
break;
}
gtk_render_activity (context, cr, x, y, width, height);
gtk_render_background (context, cr, x, y, width, height);
gtk_style_context_restore (context);
}
......@@ -153,7 +153,7 @@ rugby_cell_renderer_score_render (GtkCellRenderer *cell,
GtkStyleContext *context;
gint xpad, ypad;
gdouble x, y, total_w, w, h;
GtkBorder padding, border;
GtkBorder border;
gint tries, utries, kicks;
gint total;
gint i;
......@@ -166,29 +166,25 @@ rugby_cell_renderer_score_render (GtkCellRenderer *cell,
total_w = cell_area->width - xpad * 2;
h = cell_area->height - ypad * 2;
//gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TROUGH);
gtk_style_context_add_class (context, "level-cell");
gtk_render_background (context, cr, x, y, total_w, h);
gtk_render_frame (context, cr, x, y, total_w, h);
gtk_style_context_get_border (context, GTK_STATE_FLAG_NORMAL, &border);
gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL, &padding);
x += border.left + padding.left;
y += border.top + padding.top;
total_w -= border.left + border.right + padding.left + padding.right;
h -= border.top + border.bottom + padding.top + padding.bottom;
gtk_style_context_restore (context);
tries = priv->tries;
utries = priv->utries;
kicks = priv->kicks;
total = tries * TRY_POINTS + utries * UTRY_POINTS + kicks * KICK_POINTS;
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
gtk_style_context_get_border (context, GTK_STATE_FLAG_NORMAL, &border);
x += border.left;
y += border.top;
total_w -= border.left + border.right;
h -= border.top + border.bottom;
gtk_style_context_add_class (context, "fill-block");
w = total_w / (total / 7.0);
for (i = 0; i < tries; i++)
......
.try
.cell.level-cell.fill-block.score-try
{
/* Scarlet red */
background-image: -gtk-gradient (linear,
left top, left bottom,
from (#ef2929),
to (#a40000));
background-color: #cc0000;
}
.utry
.cell.level-cell.fill-block.score-utry
{
/* Chameleon */
background-image: -gtk-gradient (linear,
left top, left bottom,
from (#8ae234),
to (#4e9a06));
background-color: #edd400;
}
.kick
.cell.level-cell.fill-block.score-kick
{
/* Butter */
background-image: -gtk-gradient (linear,
left top, left bottom,
from (#fce94f),
to (#c4a000));
background-color: #73d216;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment