[gtk+/wip/baedert/drawing: 3/8] widget: Set :focus on focus children
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing: 3/8] widget: Set :focus on focus children
- Date: Wed, 12 Jul 2017 11:25:46 +0000 (UTC)
commit c267daed80df3939559f0941d885dffe21b59ed2
Author: Timm Bäder <mail baedert org>
Date: Tue Jul 11 18:20:48 2017 +0200
widget: Set :focus on focus children
gtk/gtkwidget.c | 7 ++++++-
gtk/theme/Adwaita/_common.scss | 6 ++++--
gtk/theme/Adwaita/gtk-contained-dark.css | 4 +++-
gtk/theme/Adwaita/gtk-contained.css | 4 +++-
4 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 3357c5d..114062b 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -15343,7 +15343,6 @@ gtk_widget_snapshot (GtkWidget *widget,
cairo_destroy (cr);
}
-
if (gtk_widget_has_visible_focus (widget))
{
gtk_snapshot_offset (snapshot, margin.left, margin.top);
@@ -15632,6 +15631,12 @@ gtk_widget_set_focus_child (GtkWidget *widget,
g_return_if_fail (gtk_widget_get_parent (child) == widget);
}
+ if (priv->focus_child)
+ gtk_widget_unset_state_flags (priv->focus_child, GTK_STATE_FLAG_FOCUSED);
+
+ if (child)
+ gtk_widget_set_state_flags (child, GTK_STATE_FLAG_FOCUSED, FALSE);
+
g_set_object (&priv->focus_child, child);
if (GTK_IS_CONTAINER (widget))
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index b604c14..dea9211 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -10,6 +10,10 @@ $button_transition: all 200ms $ease-out-quad;
* {
padding: 0;
+ -gtk-secondary-caret-color: $selected_bg_color
+}
+
+*:focus {
// We use the outline properties to signal the focus properties
// to the adwaita engine: using real CSS properties is faster,
// and we don't use any outlines for now.
@@ -19,8 +23,6 @@ $button_transition: all 200ms $ease-out-quad;
outline-offset: -3px;
outline-width: 1px;
-gtk-outline-radius: 2px;
-
- -gtk-secondary-caret-color: $selected_bg_color
}
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css
index 826937d..e066a66 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
@@ -1,4 +1,6 @@
-* { padding: 0; outline-color: alpha(currentColor,0.3); outline-style: dashed; outline-offset: -3px;
outline-width: 1px; -gtk-outline-radius: 2px; -gtk-secondary-caret-color: #215d9c; }
+* { padding: 0; -gtk-secondary-caret-color: #215d9c; }
+
+*:focus { outline-color: alpha(currentColor,0.3); outline-style: dashed; outline-offset: -3px;
outline-width: 1px; -gtk-outline-radius: 2px; }
/*************** Base States * */
.background { color: #eeeeec; background-color: #33393b; }
diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css
index d94b3db..82da845 100644
--- a/gtk/theme/Adwaita/gtk-contained.css
+++ b/gtk/theme/Adwaita/gtk-contained.css
@@ -1,4 +1,6 @@
-* { padding: 0; outline-color: alpha(currentColor,0.3); outline-style: dashed; outline-offset: -3px;
outline-width: 1px; -gtk-outline-radius: 2px; -gtk-secondary-caret-color: #4a90d9; }
+* { padding: 0; -gtk-secondary-caret-color: #4a90d9; }
+
+*:focus { outline-color: alpha(currentColor,0.3); outline-style: dashed; outline-offset: -3px;
outline-width: 1px; -gtk-outline-radius: 2px; }
/*************** Base States * */
.background { color: #2e3436; background-color: #e8e8e7; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]