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, ...@@ -171,18 +171,6 @@ swatch_draw (GtkWidget *widget,
gtk_render_frame (context, cr, 0, 0, width, height); 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) if (swatch->priv->icon)
{ {
icon_info = gtk_icon_theme_lookup_icon (theme, swatch->priv->icon, PIXBUF_SIZE, icon_info = gtk_icon_theme_lookup_icon (theme, swatch->priv->icon, PIXBUF_SIZE,
...@@ -240,6 +228,11 @@ swatch_draw (GtkWidget *widget, ...@@ -240,6 +228,11 @@ swatch_draw (GtkWidget *widget,
cairo_restore (cr); cairo_restore (cr);
gtk_style_context_restore (context); gtk_style_context_restore (context);
if (gtk_widget_has_visible_focus (widget))
{
gtk_render_focus (context, cr, 0, 0, width, height);
}
return FALSE; return FALSE;
} }
......
...@@ -2786,6 +2786,7 @@ GtkColorSwatch { ...@@ -2786,6 +2786,7 @@ GtkColorSwatch {
} }
&.color-light { &.color-light {
outline-color: transparentize(black,0.7);
&:hover { &:hover {
background-image: linear-gradient(to bottom, background-image: linear-gradient(to bottom,
transparentize(white, 1) 40%, transparentize(white, 1) 40%,
...@@ -2794,6 +2795,7 @@ GtkColorSwatch { ...@@ -2794,6 +2795,7 @@ GtkColorSwatch {
} }
} }
&.color-dark { &.color-dark {
outline-color: transparentize(white,0.5);
&:hover { &:hover {
background-image: linear-gradient(to bottom, background-image: linear-gradient(to bottom,
transparentize(white, 1) 40%, transparentize(white, 1) 40%,
......
...@@ -4161,14 +4161,18 @@ GtkColorSwatch { ...@@ -4161,14 +4161,18 @@ GtkColorSwatch {
border: 1px solid; border: 1px solid;
border-color: #1c1f1f; border-color: #1c1f1f;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4); } box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.4); }
GtkColorSwatch.color-light:hover { GtkColorSwatch.color-light {
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.4)); } outline-color: rgba(0, 0, 0, 0.3); }
GtkColorSwatch.color-light:hover:backdrop { GtkColorSwatch.color-light:hover {
background-image: none; } background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.4)); }
GtkColorSwatch.color-dark:hover { GtkColorSwatch.color-light:hover:backdrop {
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.2)); } background-image: none; }
GtkColorSwatch.color-dark:hover:backdrop { GtkColorSwatch.color-dark {
background-image: none; } 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 {
background-image: none; }
GtkColorSwatch:hover { GtkColorSwatch:hover {
border-color: #1e2222; } border-color: #1e2222; }
GtkColorSwatch:backdrop { GtkColorSwatch:backdrop {
......
...@@ -4322,14 +4322,18 @@ GtkColorSwatch { ...@@ -4322,14 +4322,18 @@ GtkColorSwatch {
border: 1px solid; border: 1px solid;
border-color: rgba(0, 0, 0, 0.3); border-color: rgba(0, 0, 0, 0.3);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); } box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); }
GtkColorSwatch.color-light:hover { GtkColorSwatch.color-light {
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.4)); } outline-color: rgba(0, 0, 0, 0.3); }
GtkColorSwatch.color-light:hover:backdrop { GtkColorSwatch.color-light:hover {
background-image: none; } background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.4)); }
GtkColorSwatch.color-dark:hover { GtkColorSwatch.color-light:hover:backdrop {
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.2)); } background-image: none; }
GtkColorSwatch.color-dark:hover:backdrop { GtkColorSwatch.color-dark {
background-image: none; } 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 {
background-image: none; }
GtkColorSwatch:hover { GtkColorSwatch:hover {
border-color: rgba(0, 0, 0, 0.5); } border-color: rgba(0, 0, 0, 0.5); }
GtkColorSwatch:backdrop { GtkColorSwatch: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