diff options
author | Dan Winship <danw@src.gnome.org> | 2001-02-21 09:42:12 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-02-21 09:42:12 +0800 |
commit | 33041e67fcbf0e88b449ea4991d6648b51a84b38 (patch) | |
tree | 2f424511831e28538e1624aeedb19237352f9505 /shell/e-folder.c | |
parent | f0e49c7c18dff132093b74ae794f53675ac2d3d0 (diff) | |
download | gsoc2013-evolution-33041e67fcbf0e88b449ea4991d6648b51a84b38.tar.gz gsoc2013-evolution-33041e67fcbf0e88b449ea4991d6648b51a84b38.tar.zst gsoc2013-evolution-33041e67fcbf0e88b449ea4991d6648b51a84b38.zip |
split "highlighted" into self_highlight and child_highligh.
* e-folder.c (_EFolderPrivate): split "highlighted" into
self_highlight and child_highligh.
(e_folder_get_highlighted): Return TRUE if either self_highlight
is true or any child is highlighted.
(e_folder_set_child_highlight): New function to tell the folder
about a child highlight change.
* e-storage.c (folder_changed_cb): Update child highlights
correctly on folders so that folders will be highlighted whenever
their children are.
svn path=/trunk/; revision=8311
Diffstat (limited to 'shell/e-folder.c')
-rw-r--r-- | shell/e-folder.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/shell/e-folder.c b/shell/e-folder.c index bad986fac6..f76829b0d4 100644 --- a/shell/e-folder.c +++ b/shell/e-folder.c @@ -41,7 +41,8 @@ struct _EFolderPrivate { char *type; char *description; char *physical_uri; - gboolean highlighted; + gboolean self_highlight; + int child_highlight; }; #define EF_CLASS(obj) \ @@ -142,11 +143,12 @@ init (EFolder *folder) EFolderPrivate *priv; priv = g_new (EFolderPrivate, 1); - priv->type = NULL; - priv->name = NULL; - priv->description = NULL; - priv->physical_uri = NULL; - priv->highlighted = FALSE; + priv->type = NULL; + priv->name = NULL; + priv->description = NULL; + priv->physical_uri = NULL; + priv->self_highlight = FALSE; + priv->child_highlight = 0; folder->priv = priv; } @@ -235,7 +237,7 @@ e_folder_get_highlighted (EFolder *folder) g_return_val_if_fail (folder != NULL, FALSE); g_return_val_if_fail (E_IS_FOLDER (folder), FALSE); - return folder->priv->highlighted; + return folder->priv->self_highlight || folder->priv->child_highlight; } @@ -302,7 +304,22 @@ e_folder_set_highlighted (EFolder *folder, g_return_if_fail (folder != NULL); g_return_if_fail (E_IS_FOLDER (folder)); - folder->priv->highlighted = highlighted; + folder->priv->self_highlight = highlighted; + + gtk_signal_emit (GTK_OBJECT (folder), signals[CHANGED]); +} + +void +e_folder_set_child_highlight (EFolder *folder, + gboolean highlighted) +{ + g_return_if_fail (folder != NULL); + g_return_if_fail (E_IS_FOLDER (folder)); + + if (highlighted) + folder->priv->child_highlight++; + else + folder->priv->child_highlight--; gtk_signal_emit (GTK_OBJECT (folder), signals[CHANGED]); } |