Currently ctbicon() has icon and background as one field, so you can't set/change those individually.
Would be good to have background separated into 2nd parameter after comma, and current shape/darkmode param moved to 3rd one.
Ctbicon() separate icon and background colour.
Ctbicon() separate icon and background colour.
Win 7 SP1 x64 100% 1366x768|1900x1080
-
admin
- Site Admin
- Posts: 65397
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Ctbicon() separate icon and background colour.
You can't set/change those individually? Why not? They are separated by an asterisk instead of a comma, who cares?
I can't change the syntax anyway. Would break old code.
I can't change the syntax anyway. Would break old code.
FAQ | XY News RSS | XY X
Re: Ctbicon() separate icon and background colour.
Well, i can't do this
You can't change syntax to keep old code intact, but maybe you can add an enhancement, that if there is nothing before asterisk the icon is kept as is?(not erased with background solely)
ctbicon(*#F6F6F6,r) to simply add background to button's icon without changing icon. You can't change syntax to keep old code intact, but maybe you can add an enhancement, that if there is nothing before asterisk the icon is kept as is?(not erased with background solely)
Win 7 SP1 x64 100% 1366x768|1900x1080
-
klownboy
- Posts: 4430
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7462 at 100% 2560x1440
Re: Ctbicon() separate icon and background colour.
Hi eil, thanks for bringing this topic up. I played around with the subject feature this morning because honestly I forgot changing the icon background was possible. You do have to specify the icon you're dealing with (the original) (or change the icon) when changing the background using a format like the following in a script,
Edit: I suppose the most important factor is when changing the background using the above, I haven't noticed any flashing or the icon itself being redrawn. It may be that XY is so fast that I can't see it or it's smart enough to know not to redraw the icon when you're simply changing the background.
ctbicon("APPLE_HALF.ICO*#F6F6F6,rd", 36); and in the Edit User Button dialog something like this works without quoting, APPLE_HALF.ICO*#F6F6F6,rd It might be handy to accentuate a state change or left vs right action.Edit: I suppose the most important factor is when changing the background using the above, I haven't noticed any flashing or the icon itself being redrawn. It may be that XY is so fast that I can't see it or it's smart enough to know not to redraw the icon when you're simply changing the background.
-
admin
- Site Admin
- Posts: 65397
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Ctbicon() separate icon and background colour.
Good idea, next beta.eil wrote: ↑16 Jan 2026 13:04 Well, i can't do thisctbicon(*#F6F6F6,r)to simply add background to button's icon without changing icon.
You can't change syntax to keep old code intact, but maybe you can add an enhancement, that if there is nothing before asterisk the icon is kept as is?(not erased with background solely)
FAQ | XY News RSS | XY X
-
klownboy
- Posts: 4430
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7462 at 100% 2560x1440
Re: Ctbicon() separate icon and background colour.
Eil and Don, that was a good idea (implemented in v28.10.0410). Hopefully I didn't come across as negative to it by making the above comment.
Don, I assume that
Don, I assume that
"*#F6A6F6,r" by itself will not work in the Edit User Button dialog. It's only intended to be used with SC ctbicon as the beta notes state.-
admin
- Site Admin
- Posts: 65397
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Ctbicon() separate icon and background colour.
Looks like it does not work in the Edit User Button dialog. But maybe it should. I'll consider it.
...
Well, I don't think it should work from there.
...
Well, I don't think it should work from there.
FAQ | XY News RSS | XY X
-
klownboy
- Posts: 4430
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.7462 at 100% 2560x1440
Re: Ctbicon() separate icon and background colour.
I was only asking. I agree that it really doesn't need to. From there (Edit User Button) you specify the icon and someone shouldn't expect XYplorer to remember what it was previously (in my opinion).
XYplorer Beta Club