Commit 100623e4 authored by Benjamin Otte's avatar Benjamin Otte

colorswatch: Render focus with gtk_render_focus()

parent be19ee29
......@@ -171,18 +171,6 @@ swatch_draw (GtkWidget *widget,
gtk_render_frame (context, cr, 0, 0, width, height);
if (gtk_widget_has_visible_focus (widget))
{
cairo_set_line_width (cr, 2);
if (swatch->priv->has_color && INTENSITY (swatch->priv->color.red, swatch->priv->color.green, swatch->priv->color.blue) < 0.5)
cairo_set_source_rgba (cr, 1., 1., 1., 0.4);
else
cairo_set_source_rgba (cr, 0., 0., 0., 0.4);
_gtk_rounded_box_shrink (&background.padding_box, 3, 3, 3, 3);
_gtk_rounded_box_path (&background.padding_box, cr);
cairo_stroke (cr);
}
if (swatch->priv->icon)
{
icon_info = gtk_icon_theme_lookup_icon (theme, swatch->priv->icon, PIXBUF_SIZE,
......@@ -240,6 +228,11 @@ swatch_draw (GtkWidget *widget,
cairo_restore (cr);
gtk_style_context_restore (context);
if (gtk_widget_has_visible_focus (widget))
{
gtk_render_focus (context, cr, 0, 0, width, height);
}
return FALSE;
}
......
......@@ -2786,6 +2786,7 @@ GtkColorSwatch {
}
&.color-light {
outline-color: transparentize(black,0.7);
&:hover {
background-image: linear-gradient(to bottom,
transparentize(white, 1) 40%,
......@@ -2794,6 +2795,7 @@ GtkColorSwatch {
}
}
&.color-dark {
outline-color: transparentize(white,0.5);
&:hover {
background-image: linear-gradient(to bottom,
transparentize(white, 1) 40%,
......
......@@ -4161,10 +4161,14 @@ GtkColorSwatch {
border: 1px solid;
border-color: #1c1f1f;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4); }
GtkColorSwatch.color-light {
outline-color: rgba(0, 0, 0, 0.3); }
GtkColorSwatch.color-light:hover {
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.4)); }
GtkColorSwatch.color-light:hover:backdrop {
background-image: none; }
GtkColorSwatch.color-dark {
outline-color: rgba(255, 255, 255, 0.5); }
GtkColorSwatch.color-dark:hover {
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.2)); }
GtkColorSwatch.color-dark:hover:backdrop {
......
......@@ -4322,10 +4322,14 @@ GtkColorSwatch {
border: 1px solid;
border-color: rgba(0, 0, 0, 0.3);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); }
GtkColorSwatch.color-light {
outline-color: rgba(0, 0, 0, 0.3); }
GtkColorSwatch.color-light:hover {
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.4)); }
GtkColorSwatch.color-light:hover:backdrop {
background-image: none; }
GtkColorSwatch.color-dark {
outline-color: rgba(255, 255, 255, 0.5); }
GtkColorSwatch.color-dark:hover {
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.2)); }
GtkColorSwatch.color-dark:hover:backdrop {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment