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

List:       kde-bugs-dist
Subject:    [Bug 42278] Strange layout with Kicker and custom size
From:       Dan Bullok <dan.kde () bullok ! com>
Date:       2004-05-15 21:49:37
Message-ID: 20040515214937.15019.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
      
http://bugs.kde.org/show_bug.cgi?id=42278      




------- Additional Comments From dan.kde bullok com  2004-05-15 23:49 -------
Created an attachment (id=6020)
 --> (http://bugs.kde.org/attachment.cgi?id=6020&action=view)
Patch against 3.2.2.  Fixes bug, adds control center gizmo to set options

The patch is against kdebase-3.2.2.  This fixes bug Bug 42278.	You can see
what it looks like at:
http://kde-apps.org/content/preview.php?preview=1&file=12652-1.png&name=Kicker+button+size+fix
   

I've tested it pretty thoroughly on two machines, and it works as intended. 
This was a real annoyance for me, so I hope someone can merge this for me. 
This is my first time working with KDE sources, so I may have made some noob
mistakes in my patch.  Maintainers, please give me some pointers if there's
something I've missed.	I've been using C++ for over 10 years, so hopefully
there's no problems other than not having a full grasp of KDE's structure.  

Making this fix (and making it maintainable) required some overhauling of a
couple of member functions in PanelButtonBase.	I also found a handful of files
that had kicker-related constants (min, max size, etc) hardcoded in them. 
They're not hard to find (yet).  Since I needed to use these constants, I
figured it was time to name them, because this sort of thing tends to get out
of control.  I decided to make them static member constants of the Kicker
class.	Unfortunately, dcopidl chokes on static member constants.  Instead, i
used the less preferable anonymous enum.  The only real downside to this
approach is having to use an int() cast in some templated expressions.

The only ugliness involved in this was getting these values to the kcontrol
module for kicker.  I just did #include "../../kicker/core/kicker.h", which I
fully realize is fragile, bad form, etc.  I'm counting on some advice from
someone with a better understanding of the build process.  

Here's how it works:  PanelButtonBase::configure() grabs three vars from 
KConfigGroup(KGlobal::config,"buttons"):
Constrain (bool)
MaxDimension (int)
IconMargin (int)
Everything should function as before, unless Constrain is true.  In that case,
the buttons are never longer than MaxDimension (along the long axis of the
panel).  The icon size is the largest that will fit into that space with
IconMargin pixels of space on each side.

The only thing that I really smashed up was
PanelButtonBase::calculateIconSizes().	I took out the part that determines
icon size, and rewrote part of it, so that this information could be used from
another function (preferredDimension).	I didn't see any STL in use.  Is that
frowned on in KDE because the Qt stuff is better?

There's also lots of very ugly debug statements, which I left in until someone
else tests this.
[prev in list] [next in list] [prev in thread] [next in thread] 

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