Author: coolo
Date: Wed Dec 19 17:31:27 2007
New Revision: 43191
URL: http://svn.opensuse.org/viewcvs/yast?rev=43191&view=rev
Log:
restore a good height for Frame now that Jiri mentioned it
Modified:
trunk/qt/src/YQCheckBoxFrame.cc
trunk/qt/src/YQFrame.cc
Modified: trunk/qt/src/YQCheckBoxFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQCheckBoxFrame.cc?rev=43191&r1=43190&r2=43191&view=diff
==============================================================================
--- trunk/qt/src/YQCheckBoxFrame.cc (original)
+++ trunk/qt/src/YQCheckBoxFrame.cc Wed Dec 19 17:31:27 2007
@@ -169,9 +169,7 @@
int left, top, right, bottom;
getContentsMargins( &left, &top, &right, &bottom );
- preferredWidth += left + right;
-
- return preferredWidth;
+ return preferredWidth + left + right;
}
@@ -181,9 +179,7 @@
int left, top, right, bottom;
getContentsMargins( &left, &top, &right, &bottom );
- preferredHeight += top + left;
-
- return preferredHeight;
+ return preferredHeight + top + left;
}
Modified: trunk/qt/src/YQFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQFrame.cc?rev=43191&r1=43190&r2=43191&view=diff
==============================================================================
--- trunk/qt/src/YQFrame.cc (original)
+++ trunk/qt/src/YQFrame.cc Wed Dec 19 17:31:27 2007
@@ -21,7 +21,7 @@
#include
#include "YQUI.h"
#include "utf8.h"
-//Added by qt3to4:
+#include <QDebug>
using std::max;
@@ -58,13 +58,15 @@
if ( hasChildren() )
{
- int newChildWidth = max ( 0, newWidth - 2 * 11 - 1 );
- int newChildHeight = max ( 0, newHeight - 11 - fontMetrics().height() - 1 );
+ int left, top, right, bottom;
+ getContentsMargins( &left, &top, &right, &bottom );
+ int newChildWidth = newWidth - left - right;
+ int newChildHeight = newHeight - bottom - top;
firstChild()->setSize( newChildWidth, newChildHeight );
QWidget * qChild = (QWidget *) firstChild()->widgetRep();
- qChild->move( 11, fontMetrics().height() );
+ qChild->move( left, top );
}
}
@@ -79,24 +81,21 @@
int YQFrame::preferredWidth()
{
- int preferredWidth;
- int childPreferredWidth = hasChildren() ? firstChild()->preferredWidth() : 0;
-
- preferredWidth = max( childPreferredWidth,
- (10 + fontMetrics().width( title() ) ) );
- preferredWidth += 2*11 + 1;
-
- return preferredWidth;
+ int preferredWidth = hasChildren() ? firstChild()->preferredWidth() : 0;
+ int left, top, right, bottom;
+ getContentsMargins( &left, &top, &right, &bottom );
+ return preferredWidth + left + right;
}
int YQFrame::preferredHeight()
{
int preferredHeight = hasChildren() ? firstChild()->preferredHeight() : 0;
- preferredHeight += 11 + fontMetrics().height() + 1;
+ int left, top, right, bottom;
+ getContentsMargins( &left, &top, &right, &bottom );
- return preferredHeight;
+ return preferredHeight + top + left;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org