[libgd] GdTaggedEntryTag: Fix close button states
- From: Volker Sobek <vsobek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd] GdTaggedEntryTag: Fix close button states
- Date: Thu, 19 Dec 2013 22:53:51 +0000 (UTC)
commit 0a9a80e4d38cd9a9e75e5438c7585d765689065f
Author: Volker Sobek <reklov live com>
Date: Thu Dec 19 20:07:40 2013 +0100
GdTaggedEntryTag: Fix close button states
When clicking on a tag's close button, the close buttons of all tags
where drawn with the active state (well, except the button you
actually clicked on, which kept showing the hover state), because
of a wrong if-clause and setting two states at the same time.
I'm not sure if it is necessary to avoid setting GTK_STATE_FLAG_ACTIVE
and GTK_STATE_FLAG_PRELIGHT at the same time on the tag buttons, I
guess ACTIVE should take precedence here, but I'll leave that to the
CSS experts to figure out.
https://bugzilla.gnome.org/show_bug.cgi?id=720764
libgd/gd-tagged-entry.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/libgd/gd-tagged-entry.c b/libgd/gd-tagged-entry.c
index 023a82b..42cdb9e 100644
--- a/libgd/gd-tagged-entry.c
+++ b/libgd/gd-tagged-entry.c
@@ -217,12 +217,14 @@ gd_tagged_entry_tag_get_button_state (GdTaggedEntryTag *tag,
{
GtkStateFlags state = GTK_STATE_FLAG_NORMAL;
- if (entry->priv->in_child == tag &&
- entry->priv->in_child_button)
- state |= GTK_STATE_FLAG_PRELIGHT;
+ if (entry->priv->in_child == tag)
+ {
+ if (entry->priv->in_child_button_active)
+ state |= GTK_STATE_FLAG_ACTIVE;
- if (entry->priv->in_child_button_active)
- state |= GTK_STATE_FLAG_ACTIVE;
+ else if (entry->priv->in_child_button)
+ state |= GTK_STATE_FLAG_PRELIGHT;
+ }
return state;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]