Bug 17563 - Flat tool bar buttons
Summary: Flat tool bar buttons
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: Other Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 26444 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-24 03:57 EDT by Dirk Baeumer CLA
Modified: 2004-03-18 13:02 EST (History)
6 users (show)

See Also:


Attachments
eclipse.png - A screenshot of the GTK2 build (40.45 KB, image/png)
2002-07-25 14:07 EDT, Jared Burns CLA
no flags Details
redhat.png - A screenshot of Eclipse on RedHat 8.0 (28.00 KB, image/png)
2002-10-02 14:13 EDT, Jared Burns CLA
no flags Details
20021127-crux.png - A screenshot of build 20021127 (234.31 KB, image/png)
2002-12-03 12:25 EST, Jared Burns CLA
no flags Details
Patch for supporting flat toolbars (2.88 KB, patch)
2004-03-17 17:01 EST, Billy Biggs CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2002-05-24 03:57:34 EDT
F1 
 
Suse 8.0, KDE 3.0, GTK 2 
 
Having flat tool bar buttons in the view pane title bar would really improve 
the overall look of the GTK port.
Comment 1 Mike Wilson CLA 2002-05-24 09:27:35 EDT
Agreed. We've got more serious issues for R2.0, but we'll take a look at 
this if we have time.
Comment 2 Boris Shingarov CLA 2002-05-24 12:41:07 EDT
This used to be in the gtk1x version, and the code was explicitly removed.

The API for setting the "flat" toolbar style, was *removed* (not just 
deprecated) from GTK2.  The "Incompatible changes from GTK1 to GTK2" document 
explains that it is wrong for the application to change the toolbar appearance 
when the user has customized them to his/her taste.  Therefore, the flag was 
moved from the instance side to the class side.
To fight this, would be overly aggressive against the GTK UI guidelines.
Comment 3 Mike Wilson CLA 2002-05-24 12:49:54 EDT
The problem is we are "faking" other aspects of the toolbar area. For 
example, we are faking the chevron support in CoolBars (the border 
around the chevron itself looks very poor).

We should discuss this again, but I'd like to argue that the current 
appearance is poor, even if it is just a side-effect of the way the eclipse UI 
is driving GTK.

I want to revisit this post R2.0. Re-opening PR.
Comment 4 Silenio Quarti CLA 2002-06-13 11:25:08 EDT
This is fixed in F3.
Comment 5 Jared Burns CLA 2002-07-25 14:07:15 EDT
If I understand the original report correctly, this isn't fixed in 20020723.
Comment 6 Jared Burns CLA 2002-07-25 14:07:47 EDT
Created attachment 1739 [details]
eclipse.png - A screenshot of the GTK2 build
Comment 7 Silenio Quarti CLA 2002-07-25 14:30:26 EDT
Could post here which theme you are using?
Comment 8 Jared Burns CLA 2002-07-25 17:00:48 EDT
Crux, which is included with most major Linux distros. The screenshot above is 
from the Mandrake 9.0 Beta 1 which comes with Gnome2 and GTK2 by default 
(oooh... aahh).
Comment 9 Jared Burns CLA 2002-10-02 14:13:24 EDT
Created attachment 2091 [details]
redhat.png - A screenshot of Eclipse on RedHat 8.0
Comment 10 Jared Burns CLA 2002-10-02 14:16:24 EDT
The above screenshot shows what Eclipse looks like by default on RedHat 8.0.

The "Default Theme" hack worked on most systems which didn't ship with Gnome 
2.0. However, now that distros are shipping Gnome 2.0, the "GTK-Default" theme 
is being overridden by vendors, so the user doesn't get the "GTK-Default" 
theme by default. The distros are choosing default themes that look better, 
which makes Eclipse look terrible (because of this bug).
Comment 11 Boris Shingarov CLA 2002-10-02 14:21:17 EDT
The question that comes to mind immediately:  does Bluecurve use any alpha 
transparencies?  (I haven't had time to install 8.0 yet).  If the answer is 
yes, then we are screwed in a major way.
Comment 12 Jared Burns CLA 2002-10-02 17:00:49 EDT
We just played around on Mandrake 9.0 and the problem occurs with every 
theme except the Default theme.

Taking a close look at how the Eclipse toolbars compare to other GTK+2 
applications (like Nautilus in Gnome 2), I see what's happening. The 3D 
etching is actually the correct behavior. It matches the etching that is 
drawn on other toolbars. The difference is that it looks like the native 
toolbar (the correctly etched one) is being drawn inside the emulated 
toolbar and a few pixels of the emulated toolbar are visible all around the 
native bar.

A simple hack to make this look better might be to increase the width and 
height of the native toolbar to match the size of the containing emulated 
toolbar. This won't completely solve the problem, because you'll still see 
the hard left edge of the (right-justified) native toolbar in the toolbar 
of views, but it should go a long way to improving the appearance.
Comment 13 Jared Burns CLA 2002-11-15 10:13:56 EST
*** Bug 26444 has been marked as a duplicate of this bug. ***
Comment 14 Jared Burns CLA 2002-11-15 10:15:42 EST
Has anyone tried the fix I suggested?
Comment 15 Felipe Heidrich CLA 2002-11-15 15:52:30 EST
Ok Jared,

We just try your hack idea in the another way around, instead of increasing the
height of the native toolbar we decreased the height of emulated coolitem.
More precisely we got rid of the margins space (at botton and top) on the
coolitems.
fix > 20021115
Comment 16 Jared Burns CLA 2002-12-03 12:25:54 EST
Created attachment 2629 [details]
20021127-crux.png - A screenshot of build 20021127

The toolbar looks a little better in the last build, but there is still a
discernable margin surrounding the native toolbar. Notice that you can see
an etched border above the native toolbar, and the left and right of the
emulated still hang out. Also, there seems to be a bug in the far right bar
in the "CoolBar". Notice that it is drawn much smaller than the other 
toolbars.

A few suggestions:
1. Use native widgets - GTK supports movable sub-toolbars natively. I don't
think we need the emulated widgets at all.
2. Shrink the emulated widget to a better fit - The emulated widget is still
noticably larger than the native widget and the effect is still very 
unappealing.
3. Make the "CoolBars" an option that can be turned off - There may be a use
case where the CoolBars are important, but I've never seen anyone use them.
It would be nice if people who don't use this feature would be able to get
rid of the ugly side effects. Personally, I just want a simple, native
toolbar.
Comment 17 Billy Biggs CLA 2004-03-17 17:01:47 EST
Created attachment 8643 [details]
Patch for supporting flat toolbars

This patch fixes Toolbar to support SWT.FLAT.  It uses the Gtk+ RC API to
define a style specific for swt flat toolbars, and uses it to set the
shadow-type property.  Without SWT.FLAT, toolbars use whatever is default for
your current theme.  I think this is the correct behavior.

Using this patch significantly improves how coolbars look.  While this patch is
a real improvement, I think the ideal but more complicated solution would be
for the coolbar to read the style properties set in the current style for
GtkToolbar and try to honour them at the top level (for example, honouring
shadow-type on the coolbar as a whole).

This patch adds a new native method but doesn't include the metadata since I'm
still not down with that scene.
Comment 18 Silenio Quarti CLA 2004-03-18 13:02:09 EST
I have released the patch.