summaryrefslogtreecommitdiff
path: root/endless/eosapplication.c
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2015-03-24 22:27:58 -0700
committerPhilip Chimento <philip@endlessm.com>2015-03-25 17:46:13 -0700
commitceeaf43e1d57a9c18ab18e45ecebad8e3c799165 (patch)
tree0ca5e353f765161939ccd27cd9fd5d1e5a16a236 /endless/eosapplication.c
parentab029d49fa0d40b027bc2a4e29defac176151eff (diff)
Make image credits discoverable
This adds a fourth topbar button, to the left of the minimize button, that is invisible by default. When you mouse over the space where it would be, it appears. When you click on it, it activates the image credits dialog. [endlessm/eos-sdk#2934]
Diffstat (limited to 'endless/eosapplication.c')
-rw-r--r--endless/eosapplication.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/endless/eosapplication.c b/endless/eosapplication.c
index 91dbd73..510ff3b 100644
--- a/endless/eosapplication.c
+++ b/endless/eosapplication.c
@@ -612,6 +612,16 @@ eos_application_class_init (EosApplicationClass *klass)
}
static void
+set_image_credits_action_enabled (EosApplication *self,
+ gboolean enabled)
+{
+ GAction *action = g_action_map_lookup_action (G_ACTION_MAP (self),
+ "image-credits");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enabled);
+ /* action map owns action */
+}
+
+static void
eos_application_init (EosApplication *self)
{
EosApplicationPrivate *priv = eos_application_get_instance_private (self);
@@ -623,6 +633,7 @@ eos_application_init (EosApplication *self)
};
g_action_map_add_action_entries (G_ACTION_MAP (self), actions,
G_N_ELEMENTS (actions), self);
+ set_image_credits_action_enabled (self, FALSE);
g_signal_connect (self, "notify::application-id",
G_CALLBACK (on_app_id_set), self);
@@ -734,11 +745,8 @@ eos_application_set_image_attribution_file (EosApplication *self,
if (priv->image_attribution_file == NULL || file == NULL)
{
- GAction *action = g_action_map_lookup_action (G_ACTION_MAP (self),
- "image-credits");
- gboolean enabled = (file == NULL);
- g_simple_action_set_enabled (G_SIMPLE_ACTION (self), enabled);
- /* action map owns action */
+ gboolean enabled = (file != NULL);
+ set_image_credits_action_enabled (self, enabled);
}
g_clear_object (&priv->image_attribution_file);