How to change highlighting of a certain button?

Hi,

i´m currently using that button for toggling hidden files (Set HIDESYSTEMFILES=Toggle). The standard setting, which i prefere here, is to hide some system files & only to unhide them when needed.
The button, however, has that greenish highlighting (which i set, see the 3rd button in the image below), which only disappears either when hovering over it or setting the hidden files to be unhidden (toggling). That is unlike all other buttons, where it is exactly the other way round.

How can the button made just like the others, to be not highlighted when the files ARE hidden & only to appear like a "pushed button" (green) when system files are unhidden? If this is possible anyway.

The first line in a command determines the look of the button. Just put a comment statement on the first line to prevent the button reverting to the 'pressed' state:

// Prevent the button from being highlighted Set HIDESYSTEMFILES=Toggle

[quote="tanis"]The first line in a command determines the look of the button. Just put a comment statement on the first line to prevent the button reverting to the 'pressed' state:

// Prevent the button from being highlighted Set HIDESYSTEMFILES=Toggle[/quote]

yeah, that was it. Thank you very much! :smiley:

Just to be clear. Opus is not doing anything wrong here. It's intended that a button like Set HIDESYSTEMFILES would show as selected when the underlying functionality is selected. In other words, system files are hidden, so the button to hide system files shows as selected.

If you move the button to a menu you'll see it gets a tick next to it instead of the button highlight.

The toggle argument, perhaps, should override this behaviour as the button no longer has a logical default. Given how easy it is to fix with a comment it doesn't seem to be worth the time and effort a change in Opus would require.

This // comment trick works for all similar buttons.

Tanis, I don't want to sound dense here, but when I read the original post, I thought the OP actually wanted to invert the highlight (to make the button highlighted when NOT pressed) rather than disable the pressed state using an initial comment line.

Even though I might have misunderstood the question, would this be possible?

[quote="tanis"]Just to be clear. Opus is not doing anything wrong here. It's intended that a button like Set HIDESYSTEMFILES would show as selected when the underlying functionality is selected. In other words, system files are hidden, so the button to hide system files shows as selected.

If you move the button to a menu you'll see it gets a tick next to it instead of the button highlight.

The toggle argument, perhaps, should override this behaviour as the button no longer has a logical default. Given how easy it is to fix with a comment it doesn't seem to be worth the time and effort a change in Opus would require.

This // comment trick works for all similar buttons.[/quote]

No - the OP wanted to prevent the highlight showing all the time - as it would because the option it controls is always on for him. Therefore the comment line stops Opus from doing this.

Yes because that's what his problem was. Have a look at his screenshot in the first post - the icon he mentions is highlighted all the time.

(Note: We're not talking about the visual effect of actually pushing the button in with the mouse)

[quote]Tanis, I don't want to sound dense here, but when I read the original post, I thought the OP actually wanted to invert the highlight (to make the button highlighted when NOT pressed) rather than disable the pressed state using an initial comment line.

Even though I might have misunderstood the question, would this be possible? [/quote]

There may be a better way, but I have the same button (I use text buttons with no icon in many places) and I simply 'title' the button 'Hide System Files'.

That way, the toggle-state highlighting makes more sense.

I have thought that a nice feature at some point might be to be able to control the highlight state of a button. Some things I toggle, are not recognized by Opus as a toggle at all. Something like: '(Show) Date Columns'.

A minor thing, for sure.

Bob

There were other posts about hidden files and/or the inverted button (here and here)
But I never found a single-button-solution. Thank you! :slight_smile:

If i understand everything, and i'm happy because it was something that annoyed me, Opus only looks at the first line to know if it needs to highlight the button or not depending on the command ?

That's nice to know that, but maybe it could be a @ function : nohighlight or something like that, that could be 'smarter' than a comment. (because maybe one day, the fact that a comment stops the highlight could be changed or fixed)

Thanks anyway tanis !

And i can confirm it's not only useful with filters but with all the button that can be highlighted depending on the state of the lister

It does work for simple commands which toggle one column:

Set columnstoggle=desc

I haven't tried it with anything more complex, though.

[quote="Alan"]Tanis, I don't want to sound dense here, but when I read the original post, I thought the OP actually wanted to invert the highlight (to make the button highlighted when NOT pressed) rather than disable the pressed state using an initial comment line.

Even though I might have misunderstood the question, would this be possible?
[/quote]

No, that´s right, i asked for the "inverted" button action, although Tanis suggestion does the most important part, to avoid the permanent highlight.
It´s not really a problem here, but maybe in some cases it would be more handy to have a button remaining highlighted when toggled. If someone has an idea, i´d be interested.

Abr,

As far as I know, there's no "single-button" solution for this. But I used the following button
(until Tanis posted the single-button here; now I use the one Tanis suggested).

  • Left mouse button click = show hidden files
  • Right mouse button click = don't show hidden files

The button only remains highlighted when System/Hidden files are being displayed:

<?xml version="1.0"?> <button display="icon" icon_size="large" type="three_button"> <label>Hidden files</label> <icon1>#move</icon1> <button display="icon" icon_size="large"> <label>Hidden files</label> <tip>Show hidden files</tip> <icon1>#move</icon1> <function type="normal"> <instruction>Set HIDEFILTERATTR</instruction> </function> </button> <button display="icon" icon_size="large"> <label>Hidden files</label> <tip>Don&apos;t show hidden files</tip> <icon1>#move</icon1> <function type="normal"> <instruction>Set HIDEFILTERATTR h</instruction> </function> </button> </button>

[quote="Christiaan"]Abr,

As far as I know, there's no "single-button" solution for this. But I used the following button
(until Tanis posted the single-button here; now I use the one Tanis suggested).

  • Left mouse button click = show hidden files
  • Right mouse button click = don't show hidden files
    [/quote]

Hi, thank you very much, this button does exactly that. This is what is so very nice about Dopus, it can be customized in every imaginable way.

This is really weird, seems quite buggy. When changing drives seems like the settings are being forgotten. Also doesn't work on right list when in dual lister mode.

  1. Which button-code do you use?
    Do you use the button-code Tanis posted above? -> no problems here when I change drives or when I use dual lister mode.
    Or do you use the button I posted above? -> also no problems here when I change drives or when I use dual lister mode.

  2. How did you add the button from this forum to your toolbar?

Folder Formats can change the hide/show filters and that's almost certainly why they are changing when you change drives. (Depends which button you are using though.)

This also depends on which button you are talking about but it's probably one which only affects the active (Source) file display. If the right side is made active then the button will affect it (but not the left side), or vice versa.

No bugs there so far.

This is the button code :

<?xml version="1.0"?> <button display="both" icon_size="large" label_pos="bottom"> <label>Filters</label> <icon1>#recursivefilter</icon1> <function type="normal"> <instruction>// Prevent the button from being highlighted</instruction> <instruction>Set HIDEFILTERFOLDERS=&quot;($RECYCLE.BIN|RECYCLER|Recycled|System Volume Information)&quot;</instruction> </function> </button>

For most of my drives, the actions is correctly followed when changing drives, but when I change to drive M: (which has a different folder format, which is exactly the same as the other drives format (=default) except for a different background image. ) the hide filter becomes active, allthough it was disactivated before and worked well in all other drives/folders.

Perhaps I could create a little video to demonstrate, but I guess it's impossible since you also have to see the folder formats (default & drive m)

No need for a video, and that isn't a bug. It's how folder formats work. Read the FAQ, and the section called Changes to the Default Formats in particular.