Is there a way to set tooltip text or label for action?

In my app, enum all action via SimpleActionGroup.list_actions, then show them and set a shortcut for them, its data is too simple, is there a way to set tooltip text or label for action?
image

var pref_group = new Hdy.PreferencesGroup();
pref_group.title = action_group.title;
pref_group.description = action_group.description;

foreach (var action in action_group.group.list_actions()) {
    full_action = "%s.%s".printf(action_group.name, action);
    accel_array = KApplication.singleton.get_accels_for_action(full_action);
    if (1 < accel_array.length) {
        expand_row = new Hdy.ExpanderRow();
        expand_row.title = full_action;
        expand_row.expanded = true;
        for (int i = 0; i < accel_array.length; i++) {
            accelerator = accel_array[i];
            expand_row.add(this.build_shortcut_row(full_action, accelerator));
        }
        pref_group.add(expand_row);
    } else {
        accelerator = (0 < accel_array.length) ? accel_array[0] : "";
        pref_group.add(this.build_shortcut_row(full_action, accelerator));
    }
}

page.add(pref_group);

BTW

It’s better if GAction has a member to get activated object.

No, there isn’t.

GAction/GMenu separates the presentation data from the action implementation.

GAction is just the action part.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.