Author Topic: Very strange layout problems  (Read 8305 times)

Offline Revvy

  • Multiple posting newcomer
  • *
  • Posts: 32
Very strange layout problems
« on: October 30, 2005, 06:07:52 pm »
So, I installed rc2 this morning anticipating wonderful things.  I didn't bother uninstalling rc1, I just installed over top of it (after backing up the CodeBlocks registry section first).  Now, the attached screenshot is what I saw.  You'll notice that the tab icons appear incorrectly (alpha not being drawn correctly?), the debug bar is being drawn overtop of the build target menu, and many of the buttons are larger than their frames.  I tried reopening the program, no change.  So, I figured it was probably something to do with the settings I left lying around.  In uninstalled rc2 (leaving the settings around again), and then reinstalled.  Still no dice, it looked exactly the same.  Finally, I uninstalled rc2 (and all settings), deleted the entire CodeBlocks folder and tried installing again.  Exactly the same problem.

Is anyone else getting this problem?  How do I fix it?

I also filed a bug relating to the uninstallation :)

Edit: Windows 2000 SP4, 512 mb ram, 2.4 ghz, etc etc

[attachment deleted by admin]
« Last Edit: October 30, 2005, 06:20:59 pm by Revvy »
Cheers,
Revvy

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Very strange layout problems
« Reply #1 on: October 30, 2005, 06:53:17 pm »
You'll notice that the tab icons appear incorrectly (alpha not being drawn correctly?)
Windows 2000 bug. The only workaround to get Windows 2000 to draw alpha transparency on png correctly is to use paletted images. These, however, have a significantly worse image quality (for everybody).
You may want to try these (those should work): http://sourceforge.net/tracker/?group_id=126998&atid=707418&func=detail&aid=1287929

the debug bar is being drawn overtop of the build target menu
Try going to your home directory and delete the file .cb_layout.bin.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Very strange layout problems
« Reply #2 on: October 30, 2005, 06:58:34 pm »
Quote
the debug bar is being drawn overtop of the build target menu

It seems it happens on win2000 and earlier. Something to do with wxWidgets/wxDockit, not sure which one's fault...
A "fix" is to drag the debugger's toolbar to the left so the order is MainBar-DebuggerBar-CompilerBar. At least this way the target combo will be visible...
Be patient!
This bug will be fixed soon...

Offline Revvy

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Very strange layout problems
« Reply #3 on: October 30, 2005, 07:01:12 pm »
So how come this wasn't an issue with rc1?

Edit: Also, deleting .cb_layout.bin didn't make a difference.
« Last Edit: October 30, 2005, 07:04:10 pm by Revvy »
Cheers,
Revvy

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Very strange layout problems
« Reply #4 on: October 30, 2005, 07:48:59 pm »
About the toolbar, I can't tell (don't know).

About the icons, it certainly was an issue with RC1. It has always been, because it is a bug in Windows 2000.

The icons are png images with a separate 8 bit alpha channel. Windows 2000 does not handle this correctly. The files from the patch I pointed out use an 8 bit palette, which has one value defined as transparent. Obviously, there is a great loss in visual quality when using this kind of image (which is why they're not used by default).

To explain the difference, look at the magnified flag icon:


As you can see, the 8-bit paletted image only knows two transparency levels: opaque and fully transparent. The good thing is that even Windows 2000 can handle it. The bad thing is that it has a very poor image quality.
Matte colour could be used to hide this deficiency, but this would require beforehand knowledge about the widget's background colour (matte against the wrong background looks a lot worse!). Since widget colours are customisable by the user, this is a very bad idea.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Very strange layout problems
« Reply #5 on: October 30, 2005, 08:09:58 pm »
So how come this wasn't an issue with rc1?

1.0rc1 didin't use wxDockit (docking lib). It was only one (big) toolbar.
Be patient!
This bug will be fixed soon...

Offline Revvy

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Very strange layout problems
« Reply #6 on: October 30, 2005, 08:17:38 pm »
The toolbar icons certainly didn't look this way in rc1.
Cheers,
Revvy

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Very strange layout problems
« Reply #7 on: October 30, 2005, 08:27:07 pm »
If you were using Windows 2000, yes.

http://forums.codeblocks.org/index.php/topic,361.0.html

This post dates back to May 2005, referring to the beta version (thus, even before RC1). There have been several follow-ups on the same issue, but that one is the earliest I remember.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Revvy

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Very strange layout problems
« Reply #8 on: October 30, 2005, 08:44:01 pm »
Exhibit A: CodeBlocks rc1-1 on Windows 2000.  Notice the smooth, beautiful tab icons.

[attachment deleted by admin]
Cheers,
Revvy

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Very strange layout problems
« Reply #9 on: October 31, 2005, 12:30:45 am »
Showing Exhibit A: CodeBlocks rc1-1 on Windows 2000 enlarged.



Very obviously, this version uses the forementioned 8 bit paletted images (compare to above image), as can be seen on the poor flag contours.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Very strange layout problems
« Reply #10 on: October 31, 2005, 01:04:11 am »
That should be easy... you could paste the transparent image over a canvas whose collor would be EXACTLY the same than the one used, and make the image 8 bit.

Thomas, your image editing abilities are impressive. Mind doing us the favor? :)

And personally, i don't see that much of a quality difference. Sure, the icons may look *a bit* pixelated, but they don't look as ugly as that black background.

Offline Revvy

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Very strange layout problems
« Reply #11 on: October 31, 2005, 01:16:01 am »
Ok, thanks for pointing that out.  I tried the link that you gave earlier, and it seems like the notepad icon isn't quite right.  There's some black on part of the icon still showing, but otherwise they look fine.  I may just try copying the rc1.1 icons and adding them to rc2.
Cheers,
Revvy

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Very strange layout problems
« Reply #12 on: October 31, 2005, 01:39:47 am »
Unluckily, it is not that easy, Rick. Your proposal is basically something like a matte colour. As opposed to matte, which only influences pixels with 0 < alpha < 1 , your approach fills a bounding box.
The problem with both matte colour and your approach is that they depend on knowledge of the widget background colour - and you really don't know it! You cannot assume that the background is grey. The user can set an arbitrary colour as dialog background colour, and that one will be used for tabs just like for everything. So your approach would result in a visible box around all icons (in the colour that you have chosen) for everybody who uses a custom colour scheme - very bad. Apart from that, many platforms draw their widgets with gradients rather than solid colours, a bounding box or matte gives very unpleasant artifacts here.

It is nevertheless possible to configure the installer to install the lower quality images only for Windows 2000. In my opinion, this would be the most acceptable compromise for everybody.
Forcing everybody to live with a lower quality only because one single platform does not properly work with alpha does not seem right to me personally (I think that was the reason why Yiannis decided against the 8bit images when packaging RC2, too). I really perceive the quality as disturbing. Not only the flag, but look at the blue gear. At larger bitmap sizes, this does not matter at all, but in 16x16, it makes a big difference.

Making 8 bit paletted versions of all images is technically not a big problem really, you can feed imagemagick from a bash script, all you need to do is grep the filenames right. I did that for the files which are in the patch, takes a few minutes. But you have to sort them and configure the installer properly! This means a lot of extra grief for the poor guy who must package the releases (Yiannis in this case).

What about the startup screen? It displays fine in Windows 98, so what about Windows 2000? If that does not work either, we would consequently have to change that too. This, however, would mean to move a compile-time conditional to runtime and check against W2K, displaying the non-transparent screen for W2K only. So we are getting one ugly hack after the other...

Yet another issue are plugins. Most of them come with icons too.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Revvy

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Very strange layout problems
« Reply #13 on: October 31, 2005, 01:47:57 am »
Splash screen looks fine to me.  Why not make the icons a self-installing archive that comes with C::B?  Have the FAQ/manual or whatever include an entry about ugly icons, and tell users to open that.
Cheers,
Revvy

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Very strange layout problems
« Reply #14 on: October 31, 2005, 01:52:03 am »
Now there is an idea. That would work fine for everyone, I guess.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."