diff options
author | Ted Gould <ted@gould.cx> | 2010-08-11 21:52:43 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-08-11 21:52:43 -0500 |
commit | 360e8a40e548f5080193dd60d9c7fd5c2fb50089 (patch) | |
tree | a9813672ae352ca3c8bef78d822b68dc2d77b89a /src | |
parent | 0db4eb579e37326484df53ff9dab3a4a6b6a8b40 (diff) | |
download | libayatana-appindicator-360e8a40e548f5080193dd60d9c7fd5c2fb50089.tar.gz libayatana-appindicator-360e8a40e548f5080193dd60d9c7fd5c2fb50089.tar.bz2 libayatana-appindicator-360e8a40e548f5080193dd60d9c7fd5c2fb50089.zip |
Simplifying the visual state to just be shown/hidden while letting the status show which icon is shown.
Diffstat (limited to 'src')
-rw-r--r-- | src/application-service-appstore.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index f5b2db4..0991286 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -64,8 +64,7 @@ struct _ApplicationServiceAppstorePrivate { typedef enum { VISIBLE_STATE_HIDDEN, - VISIBLE_STATE_NORMAL, - VISIBLE_STATE_ATTENTION + VISIBLE_STATE_SHOWN } visible_state_t; typedef struct _Approver Approver; @@ -479,11 +478,7 @@ apply_status (Application * app) if (app->status != APP_INDICATOR_STATUS_PASSIVE && g_list_length(app->approved_by) == g_list_length(priv->approvers)) { - if (app->status == APP_INDICATOR_STATUS_ACTIVE) { - goal_state = VISIBLE_STATE_NORMAL; - } else if (app->status == APP_INDICATOR_STATUS_ATTENTION) { - goal_state = VISIBLE_STATE_ATTENTION; - } + goal_state = VISIBLE_STATE_SHOWN; } /* Nothing needs to change, we're good */ @@ -503,7 +498,7 @@ apply_status (Application * app) } else { /* Figure out which icon we should be using */ gchar * newicon = app->icon; - if (goal_state == VISIBLE_STATE_ATTENTION && app->aicon != NULL && app->aicon[0] != '\0') { + if (app->status == APP_INDICATOR_STATUS_ATTENTION && app->aicon != NULL && app->aicon[0] != '\0') { newicon = app->aicon; } @@ -565,7 +560,7 @@ new_icon_cb (DBusGProxy * proxy, GValue value, GError * error, gpointer userdata if (app->icon != NULL) g_free(app->icon); app->icon = g_strdup(newicon); - if (app->visible_state == VISIBLE_STATE_NORMAL) { + if (app->visible_state == VISIBLE_STATE_SHOWN && app->status == APP_INDICATOR_STATUS_ACTIVE) { gint position = get_position(app); if (position == -1) return; @@ -603,7 +598,7 @@ new_aicon_cb (DBusGProxy * proxy, GValue value, GError * error, gpointer userdat if (app->aicon != NULL) g_free(app->aicon); app->aicon = g_strdup(newicon); - if (app->visible_state == VISIBLE_STATE_ATTENTION) { + if (app->visible_state == VISIBLE_STATE_SHOWN && app->status == APP_INDICATOR_STATUS_ATTENTION) { gint position = get_position(app); if (position == -1) return; |