[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    conceptual changes to toolbars
From:       Kurt Granroth <granroth () kde ! org>
Date:       2000-03-01 21:10:00
[Download RAW message or body]

I've made some rather major changes to KToolBar and related classes
that don't change the API very much but do change how the toolbar
behave somewhat.

The core conceptual change is that toolbar buttons now have a LOT more
control over their own size.  This makes sense.  The buttons know how
big their pixmaps are and how big their text is.. it's silly to have
the toolbar (which knows *neither* size) to dictate the proper size.

The second conceptual change came after studying other toolbars
(netscape, windows, macos) and I noticed two things: all buttons are
the same size and most buttons are square (equal width and height).
Those that aren't square have a wider width then height.  So now our
toolbar does that also.  HOWEVER, I'm sure that that isn't the
greatest idea for all toolbars, so right now, it only applies to the
"main" toolbar (those that use honor_mode)

The third conceptual change is related to button states.  There are
now three states -- disabled, default, and active.  The default state
is the icon either desaturated or greyscale... muted somehow.  The
active state (when the mouse is over the icon) is the normal look of
the icon.  Disabled state is obvious.  This is also inspired by other
mainstream toolbars (and discussions with tackat)

The actual desaturation effect is commented out right now.
Unfortunately, there are some nasty Qt and png interaction errors that
produce very strange results with our toolbar buttons.

You'll notice that TONS of code is touched in the toolbar code.. much
more then is absolutely necessary.  This was because while I was
making the changes, I found it hard to actually find where to look for
things.  So I cleaned things up.

A list of the major changes:
o Removed item_size parameter from toolbar constructor
o Renamed 'beToggle' to 'setToggle' (more consistant)
o Completely rearranged KToolBarButton code
o Removed references to menus in KToolBarButton
o Added setIcon() to KToolBarButton, allowing it to load its own icon.
  It will default to Medium for "normal" toolbars and whatever the
  global setting is for "main" toolbars
o Added methods to allow name-based icons to be used in KToolBar

A list of the not-so-major changes
o Added (and used extensively in some cases) private data classes for
  all toolbar classes
o Cleaned up enums in KToolBarItem
o Added Separator item to KToolBarItem
o Added itemType() function to KToolBarItem (not sure why it was never
  there before)
o We don't want our item list to be publicly available in KToolBar

And one tiny bug fix
o Separators work correctly after flattening and unflattening the
  toolbars

And probably a bit more that I've forgotten.
-- 
Kurt Granroth            | http://www.granroth.org
KDE Developer/Evangelist | SuSE Labs Open Source Developer
granroth@kde.org         | granroth@suse.com
           KDE -- Putting a Friendly Face on Unix

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic