Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Images for disabled button in "Classic" style
Images for disabled button in "Classic" style [message #26098] Thu, 01 April 2010 09:26 Go to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

It looks like images for disabled controls in "classic" theming style are calculated in strange manner. Just look at the same buttons in XP and classic themes:
index.php?t=getfile&id=2452&private=0

You may try it yourself in WinXP, switching to classic theme and back. If my help is needed here, I'll try to dig into the code and make patch.
  • Attachment: upp-dis.png
    (Size: 8.04KB, Downloaded 484 times)
Re: Images for disabled button in "Classic" style [message #26099 is a reply to message #26098] Thu, 01 April 2010 12:47 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Looks fine to me:
index.php?t=getfile&id=2454&private=0
Test case?
  • Attachment: classic.png
    (Size: 2.32KB, Downloaded 714 times)
Re: Images for disabled button in "Classic" style [message #26105 is a reply to message #26099] Thu, 01 April 2010 14:19 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Please try this image for button.
It looks like some transparency issues.
  • Attachment: attach.png
    (Size: 0.53KB, Downloaded 217 times)
Re: Images for disabled button in "Classic" style [message #26107 is a reply to message #26105] Thu, 01 April 2010 14:54 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Yes, it is a transparency issue. This is the filter being used for DisabledImage with XP classic:

RGBA sEtchFilter::operator()(const RGBA **mx)
{
	RGBA t;
	RGBA s = mx[1][1];
	if(s.a == 255 && s.r + s.g + s.b < 400) {
		t.r = t.g = t.b = 128;
		t.a = 255;
		return t;
	}
	s = mx[0][0];
	if(s.a == 255 && s.r + s.g + s.b < 400) {
		t.r = t.g = t.b = t.a = 255;
		return t;
	}
	Zero(t);
	return t;
}
ImageOp.cpp
The alpha limit is there because you don't want to etch invisible pixels, it would look wierd.

IMO a good compromise would be this version that checks for alpha > 128:
RGBA sEtchFilter::operator()(const RGBA **mx)
{
	RGBA t;
	RGBA s = mx[1][1];
	if(s.a & 0x80 && s.r + s.g + s.b < 400) {
		t.r = t.g = t.b = 128;
		t.a = s.a;
		return t;
	}
	s = mx[0][0];
	if(s.a & 0x80 && s.r + s.g + s.b < 400) {
		t.r = t.g = t.b = 255;
		t.a = s.a;
		return t;
	}
	Zero(t);
	return t;
}

[Updated on: Thu, 01 April 2010 15:13]

Report message to a moderator

Re: Images for disabled button in "Classic" style [message #26112 is a reply to message #26107] Thu, 01 April 2010 18:28 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Tested your patch with some semi-transparent images.
All of them look good enough, also (s.a & 0x80) is a quick enough comparison.
Finally I agree with your proposal. Can you please publish it on SVN? Or else we should ask Mirek.

P.S. Why don't you use the same "transparency" method for classic theme disabled image?

[Updated on: Thu, 01 April 2010 18:32]

Report message to a moderator

Re: Images for disabled button in "Classic" style [message #26123 is a reply to message #26112] Fri, 02 April 2010 11:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Thu, 01 April 2010 12:28

Tested your patch with some semi-transparent images.
All of them look good enough, also (s.a & 0x80) is a quick enough comparison.
Finally I agree with your proposal. Can you please publish it on SVN? Or else we should ask Mirek.



Patch applited, thanks.

Quote:


P.S. Why don't you use the same "transparency" method for classic theme disabled image?



Well, maybe we should. Back in days of Classic glory, this is how disabled icons looked like.

(BTW, I have just switched Win7 to classic and invoked WordPad to find out how MS manages disabled icons today. And guess what - they simply ignore the issue, WordPad still has fancy blue Aero buttons... Smile

Re: Images for disabled button in "Classic" style [message #26202 is a reply to message #26123] Mon, 12 April 2010 16:37 Go to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Of course. There is no need to make app uglier if it may look great )) I vote for switching XP-style disabling for images for classic theme. I also believe that it will not lead to any incompatibility even on Win98.
Previous Topic: ButtonOption bug? Centering QTF string
Next Topic: WhenSelected callback to DropList
Goto Forum:
  


Current Time: Fri Mar 29 07:44:37 CET 2024

Total time taken to generate the page: 0.01969 seconds