Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 7 of 7

Hybrid View

  1. #1
    Senior Member Aesculus's Avatar
    Join Date
    Jan 2008
    Posts
    433

    Setting Disabled State on Menu Item

    I am creating plugin menu items like:

    push @menu, {
    text => $client->string('PLUGIN_DENONAVPCONTROL_AUDIO4'),
    id => 'nightmode',
    "icon" => $dynamicVolIcon,
    actions => {
    go => {
    player => 0,
    cmd => [ 'avpNM' ],
    params => {
    menu => 'avpNM',
    },
    },
    },
    };

    I would like to know how I can toggle the state of the menu item between disabled and normal.
    Chris

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,601

    Setting Disabled State on Menu Item

    > I would like to know how I can toggle the state of the menu item between
    > disabled and normal.


    On the fly? I don't know. What's the UX you're trying to achieve?

  3. #3
    Senior Member Aesculus's Avatar
    Join Date
    Jan 2008
    Posts
    433
    Quote Originally Posted by mherger View Post
    > I would like to know how I can toggle the state of the menu item between
    > disabled and normal.


    On the fly? I don't know. What's the UX you're trying to achieve?
    This is in my plugin - DenonAvpControl that shows up in apps like iPeng and Squeezer but also on the Touch screen.

    I have some related features that only work when a certain setting is turned on. Formally I did not show that menu item but that is sort of confusing (even for myself) and felt it would be better if it was just disabled but still appeared during these conditions.

    In PERL I have seen mention of "disabled" and "normal" states for menu items, but I was uncertain if this was just a particular UI tool or in general. It was the "state" feature of a menu item.
    Last edited by Aesculus; 2021-04-16 at 09:54.
    Chris

  4. #4
    Senior Member Aesculus's Avatar
    Join Date
    Jan 2008
    Posts
    433
    Well it turns out that just eliminating the "do=>" in actions will create a disabled menu item. The downside is that the state is not visible to the user.

    So now I need to find a way to "gray out" the text for an menu item that has no "do" action.

    EDIT: Perhaps removing the "action" area is probably the same. I'll try that.
    Chris

  5. #5
    Senior Member Aesculus's Avatar
    Join Date
    Jan 2008
    Posts
    433
    Well perhaps my goal of changing the text color is not achievable?

    https://forums.slimdevices.com/showt...ont#post830111
    Chris

  6. #6
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,601
    Such a change is unlikely going to happen. Maybe if you describe your use case we can find some kind of workaround?
    Michael

    "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
    (LMS: Settings/Information)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •