diff options
author | Nikias Bassen | 2011-01-04 19:08:09 +0100 |
---|---|---|
committer | Nikias Bassen | 2011-01-04 19:08:09 +0100 |
commit | 074960f55c0b8d192bdeffc2c80f4ddeeb67551d (patch) | |
tree | 3f53fadaca21dde8128cf6d076599d6e3a603da7 | |
parent | cb1856baae5d23edc55865bec5beb276f515a2df (diff) | |
download | sbmanager-074960f55c0b8d192bdeffc2c80f4ddeeb67551d.tar.gz sbmanager-074960f55c0b8d192bdeffc2c80f4ddeeb67551d.tar.bz2 |
Split up folderview_close_cb
This allows us to close a folderview without having to invoke the callback
function.
-rw-r--r-- | src/gui.c | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -963,16 +963,9 @@ static gboolean folderview_close_finish(gpointer user_data) return FALSE; } -static gboolean folderview_close_cb(ClutterActor *actor, ClutterButtonEvent *event, gpointer user_data) +static void folderview_close(SBItem *folderitem) { - /* discard double clicks */ - if (event->click_count > 1) { - return FALSE; - } - - SBItem *item = (SBItem*)user_data; - - clutter_actor_set_reactive(item->texture, FALSE); + clutter_actor_set_reactive(folderitem->texture, FALSE); clutter_actor_set_reactive(aniupper, FALSE); clutter_actor_set_reactive(anilower, FALSE); @@ -983,7 +976,19 @@ static gboolean folderview_close_cb(ClutterActor *actor, ClutterButtonEvent *eve clutter_actor_animate(anilower, CLUTTER_EASE_IN_OUT_QUAD, FOLDER_ANIM_DURATION, "y", 0.0, NULL); clutter_actor_animate(folder, CLUTTER_EASE_IN_OUT_QUAD, FOLDER_ANIM_DURATION, "y", split_pos, NULL); - clutter_threads_add_timeout(FOLDER_ANIM_DURATION, (GSourceFunc)folderview_close_finish, user_data); + clutter_threads_add_timeout(FOLDER_ANIM_DURATION, (GSourceFunc)folderview_close_finish, (gpointer)folderitem); +} + +static gboolean folderview_close_cb(ClutterActor *actor, ClutterButtonEvent *event, gpointer user_data) +{ + /* discard double clicks */ + if (event->click_count > 1) { + return FALSE; + } + + SBItem *item = (SBItem*)user_data; + + folderview_close(item); return TRUE; } |