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

Handle dark theme for blob border colours

parent afac1c2a
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@
#include <config.h>
#include <adwaita.h>
#include "rugby-possibility-widget.h"
struct _RugbyPossibilityWidget
......@@ -74,7 +76,8 @@ rugby_possibility_widget_set_property (GObject *object,
}
static void
render_bar (GtkSnapshot *snapshot,
render_bar (GtkWidget *widget,
GtkSnapshot *snapshot,
float x,
float w,
float h,
......@@ -93,11 +96,17 @@ render_bar (GtkSnapshot *snapshot,
&area);
gtk_snapshot_pop (snapshot);
GdkRGBA black = { 0.0, 0.0, 0.0, 0.2 };
GtkStyleContext *ctx = gtk_widget_get_style_context (widget);
GdkRGBA border_colour;
gtk_style_context_lookup_color (ctx, "card_fg_color", &border_colour);
gtk_snapshot_append_border (snapshot,
&rounded,
(float[]) { 2.0, 2.0, 2.0, 2.0 },
(GdkRGBA[]) { black, black, black, black });
(GdkRGBA[]) { border_colour,
border_colour,
border_colour,
border_colour });
}
static void
......@@ -130,7 +139,7 @@ rugby_possibility_widget_snapshot (GtkWidget *widget,
for (int i = 0; i < tries; i++)
{
gtk_style_context_lookup_color (ctx, "green_3", &rgba);
render_bar (snapshot, x, w, height, rgba);
render_bar (widget, snapshot, x, w, height, rgba);
x += w;
}
......@@ -139,7 +148,7 @@ rugby_possibility_widget_snapshot (GtkWidget *widget,
for (int i = 0; i < utries; i++)
{
gtk_style_context_lookup_color (ctx, "red_3", &rgba);
render_bar (snapshot, x, w, height, rgba);
render_bar (widget, snapshot, x, w, height, rgba);
x += w;
}
......@@ -148,7 +157,7 @@ rugby_possibility_widget_snapshot (GtkWidget *widget,
for (int i = 0; i < kicks; i++)
{
gtk_style_context_lookup_color (ctx, "yellow_3", &rgba);
render_bar (snapshot, x, w, height, rgba);
render_bar (widget, snapshot, x, w, height, rgba);
x += w;
}
}
......
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