diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-11-13 10:07:17 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-11-13 10:07:17 +0100 |
commit | d744550b20db48ebf0be5ab91a5ccd4786290f55 (patch) | |
tree | 976f26aab824c4567d5e0cda30192cf8ddc04c20 | |
parent | 8038312a40a90a91298b518a5c253d796d28fc2e (diff) | |
parent | ddb607383e79c642d24f793a2ec7f97d2284d469 (diff) | |
download | ayatana-indicator-power-d744550b20db48ebf0be5ab91a5ccd4786290f55.tar.gz ayatana-indicator-power-d744550b20db48ebf0be5ab91a5ccd4786290f55.tar.bz2 ayatana-indicator-power-d744550b20db48ebf0be5ab91a5ccd4786290f55.zip |
Merge branch 'tari01-pr/fix-auto-brightness-toggle'
Attributes GH PR #71: https://github.com/AyatanaIndicators/ayatana-indicator-power/pull/71
-rw-r--r-- | src/service.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/service.c b/src/service.c index 61a945c..2731508 100644 --- a/src/service.c +++ b/src/service.c @@ -666,7 +666,7 @@ create_phone_settings_section(IndicatorPowerService * self) if (ab_supported) { - item = g_menu_item_new(_("Adjust brightness automatically"), "indicator.auto-brightness"); + item = g_menu_item_new(_("Adjust brightness automatically"), "indicator.auto-brightness(true)"); g_menu_item_set_attribute(item, "x-ayatana-type", "s", "org.ayatana.indicator.switch"); g_menu_append_item(section, item); g_object_unref(item); @@ -915,7 +915,9 @@ init_gactions (IndicatorPowerService * self) p->device_state_action = a; /* add the auto-brightness action */ - a = g_simple_action_new_stateful("auto-brightness", NULL, g_variant_new_boolean(FALSE)); + GVariantType *pType = g_variant_type_new ("b"); + a = g_simple_action_new_stateful ("auto-brightness", pType, g_variant_new_boolean (FALSE)); + g_variant_type_free (pType); g_object_bind_property_full(p->brightness, "auto-brightness", a, "state", G_BINDING_SYNC_CREATE|G_BINDING_BIDIRECTIONAL, @@ -925,7 +927,7 @@ init_gactions (IndicatorPowerService * self) g_action_map_add_action(G_ACTION_MAP(p->actions), G_ACTION(a)); /* add the flashlight action */ - GVariantType *pType = g_variant_type_new ("b"); + pType = g_variant_type_new ("b"); a = g_simple_action_new_stateful ("flashlight", pType, g_variant_new_boolean (FALSE)); g_variant_type_free (pType); g_action_map_add_action (G_ACTION_MAP(p->actions), G_ACTION(a)); |