Toggle Toolbar Labels

In DO13, what options exist to toggle toolbar labels for all buttons on a specific toolbar?

You can do it via the Customize dialog, Toolbars tab.

I am very familiar with that option, Leo.

I am interested in a toggle method that one could tie to a button or script rather than opening the Customize dialog. Is this possible?

Not directly, but it might be possible via the Evaluator now, since that can make labels conditional on, say, a variable, and could clear all the labels when the variable was set/unset. At least in theory. Not something I have tried.

Thanks, Leo.

Beyond may capability at this point, but will take a look.

Set up a button to toggle the label settings:

@if:$glob:ShowMyToolbarLabels
@set glob:ShowMyToolbarLabels=0

@if:else
@set glob:ShowMyToolbarLabels=1

@if:common
@toggle:update

Define labels in other buttons like this:

@label:Val("$glob:ShowMyToolbarLabels") ? "The visible Label" : "The invisible Label"
3 Likes

@lxp Thanks for this! I will give it a go, but it will take a while given the toolbar in question has 22 buttons.

That said, this welcome initial solution seems a bit much as a long-term solution when one has several buttons on the affected toolbar. To me, it would make more sense to include an option that gives users access via DOpus command to the Customize dialog "Label state" setting:

@Jon & @Leo please consider this a feature request.

@lxp Gave this a go as a test. Here's the set up:

Pressing the "Label Toggle" button does nothing. Not sure what I'm missing and would appreciate any insight.

The @label modifier needs to go into the function definition, ideally on the top before your button code begins.

The modifier will override the Label field, so you can leave the original content or put something else that helps with organizing the buttons.

Bonus: You can simplify the editing of your buttons by using the variable original_label. So you could use a standard line for all buttons:

@label:Val("$glob:ShowMyToolbarLabels") ? original_label : " "

Looks like you can't pass an empty string to the label modifier, so I opted to use a space. Maybe we'll find something better.

1 Like

That's it, thanks!

I had tried both in the label itself and in the function with no success. The empty string was throwing me. The space does impact the vertical toolbar on which I'm using it, but not much. Hope the team fixes the empty string at some point.

Thanks again!