Bug 112991

Summary: classifier widget in class diagram width is to large
Product: [Applications] umbrello Reporter: Peter Soetens <peter.soetens>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: PATCH: calculate correct class widget size

Description Peter Soetens 2005-09-21 10:41:21 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.3 
OS:                Linux

For most font types the width is to large when operations are shown that are not italic. I have a patch for this bug.
Comment 1 Peter Soetens 2005-09-21 10:52:54 UTC
Created attachment 12644 [details]
PATCH: calculate correct class widget size

This patch will 'break' the layout of some class diagrams since the width of
classes will shrink. This can only be fixed in turn by storing the 'center'
position of a widget instead of the topleft corner.
Comment 2 Oliver Kellogg 2005-09-21 19:39:44 UTC
SVN commit 462672 by okellogg:

calculateSize(): The font for displaying non-abstract operations is FT_NORMAL.
Thanks to Peter Soetens <peter.soetens_AT_mech.kuleuven.be> for the fix.
BUG:112991


 M  +1 -1      classifierwidget.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/classifierwidget.cpp #462671:462672
@@ -375,7 +375,7 @@
                 continue;
             const QString displayedOp = op->toString(m_ShowOpSigs);
             UMLWidget::FontType oft;
-            oft = (op->getAbstract() ? UMLWidget::FT_ITALIC : UMLWidget::FT_BOLD);
+            oft = (op->getAbstract() ? UMLWidget::FT_ITALIC : UMLWidget::FT_NORMAL);
             const int w = UMLWidget::getFontMetrics(oft).size(0,displayedOp).width();
             if (w > width)
                 width = w;