Author: sh-sh-sh
Date: Mon Sep 3 18:18:04 2007
New Revision: 40739
URL: http://svn.opensuse.org/viewcvs/yast?rev=40739&view=rev
Log:
Limit pkg popups to screen size even with substandard resolutions
Modified:
trunk/qt/VERSION
trunk/qt/package/yast2-qt.changes
trunk/qt/src/QY2LayoutUtils.cc
trunk/qt/src/QY2LayoutUtils.h
trunk/qt/src/pkg/YQPkgChangesDialog.cc
trunk/qt/src/pkg/YQPkgConflictDialog.cc
trunk/qt/src/pkg/YQPkgTextDialog.cc
Modified: trunk/qt/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/VERSION?rev=40739&r1=40738&r2=40739&view=diff
==============================================================================
--- trunk/qt/VERSION (original)
+++ trunk/qt/VERSION Mon Sep 3 18:18:04 2007
@@ -1 +1 @@
-2.15.15
+2.15.16
Modified: trunk/qt/package/yast2-qt.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/package/yast2-qt.changes?rev=40739&r1=40738&r2=40739&view=diff
==============================================================================
--- trunk/qt/package/yast2-qt.changes (original)
+++ trunk/qt/package/yast2-qt.changes Mon Sep 3 18:18:04 2007
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Sep 3 18:13:36 CEST 2007 - sh@suse.de
+
+- Limit pkg popups to screen size even with substandard resolutions
+ (bug #300632: dialogs too big on PS3)
+- V 2.15.16
+
+-------------------------------------------------------------------
Wed Aug 29 14:38:24 CEST 2007 - tgoettlicher@suse.de
- wizard shows titlebar depending on existence of title-bar-gradient.png
@@ -12,7 +19,6 @@
- V 2.15.14
-------------------------------------------------------------------
->>>>>>> .r40568
Thu Aug 23 13:25:08 CEST 2007 - kmachalkova@suse.cz
- Display repository name instead of product name in package selector
Modified: trunk/qt/src/QY2LayoutUtils.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/QY2LayoutUtils.cc?rev=40739&r1=40738&r2=40739&view=diff
==============================================================================
--- trunk/qt/src/QY2LayoutUtils.cc (original)
+++ trunk/qt/src/QY2LayoutUtils.cc Mon Sep 3 18:18:04 2007
@@ -19,6 +19,7 @@
/-*/
+#include
#include
#include "QY2LayoutUtils.h"
@@ -60,3 +61,26 @@
return spacer;
}
+
+QSize
+limitToScreenSize( const QWidget * widget, int width, int height )
+{
+ return limitToScreenSize( widget, QSize( width, height ) );
+}
+
+
+QSize
+limitToScreenSize( const QWidget * widget, const QSize & desiredSize )
+{
+ QSize availableSize = qApp->desktop()->availableGeometry( const_cast (widget) ).size();
+
+ // Subtract WM decorations. There seems to be no reliable way to tell if
+ // this is necessary at all (even fvwm2 claims it is a NETWM compliant
+ // window manager) or how large the WM decorations are.
+ // For the purpose of this function, let's assume we have to subtract the
+ // common fvwm2 decoration size. This is simplistic and should be improved.
+ availableSize -= QSize( 10, 35 );
+
+ return desiredSize.boundedTo( availableSize );
+}
+
Modified: trunk/qt/src/QY2LayoutUtils.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/QY2LayoutUtils.h?rev=40739&r1=40738&r2=40739&view=diff
==============================================================================
--- trunk/qt/src/QY2LayoutUtils.h (original)
+++ trunk/qt/src/QY2LayoutUtils.h Mon Sep 3 18:18:04 2007
@@ -45,5 +45,10 @@
**/
QWidget * addHSpacing( QWidget * parent, int width = 8 );
+/**
+ * Limit a QSize to what is available on the same screen as 'widget'.
+ **/
+QSize limitToScreenSize( const QWidget * widget, const QSize & desiredSize );
+QSize limitToScreenSize( const QWidget * widget, int width, int height );
#endif // ifndef QY2LayoutUtils_h
Modified: trunk/qt/src/pkg/YQPkgChangesDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/pkg/YQPkgChangesDialog.cc?rev=40739&r1=40738&r2=40739&view=diff
==============================================================================
--- trunk/qt/src/pkg/YQPkgChangesDialog.cc (original)
+++ trunk/qt/src/pkg/YQPkgChangesDialog.cc Mon Sep 3 18:18:04 2007
@@ -194,11 +194,7 @@
QSize
YQPkgChangesDialog::sizeHint() const
{
- QRect available = qApp->desktop()->availableGeometry( (QWidget *) this );
- QSize size = QDialog::sizeHint();
- size = size.boundedTo( QSize( available.width(), available.height() ) );
-
- return size;
+ return limitToScreenSize( this, QDialog::sizeHint() );
}
Modified: trunk/qt/src/pkg/YQPkgConflictDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/pkg/YQPkgConflictDialog.cc?rev=40739&r1=40738&r2=40739&view=diff
==============================================================================
--- trunk/qt/src/pkg/YQPkgConflictDialog.cc (original)
+++ trunk/qt/src/pkg/YQPkgConflictDialog.cc Mon Sep 3 18:18:04 2007
@@ -207,11 +207,7 @@
QSize
YQPkgConflictDialog::sizeHint() const
{
- QSize size( 550, 450 );
- QRect available = qApp->desktop()->availableGeometry( (QWidget *) this );
- size = size.boundedTo( QSize( available.width(), available.height() ) );
-
- return size;
+ return limitToScreenSize( this, 550, 450 );
}
Modified: trunk/qt/src/pkg/YQPkgTextDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/pkg/YQPkgTextDialog.cc?rev=40739&r1=40738&r2=40739&view=diff
==============================================================================
--- trunk/qt/src/pkg/YQPkgTextDialog.cc (original)
+++ trunk/qt/src/pkg/YQPkgTextDialog.cc Mon Sep 3 18:18:04 2007
@@ -141,13 +141,15 @@
{
_rejectButton = 0;
}
+
+ updateGeometry();
}
QSize
YQPkgTextDialog::sizeHint() const
{
- return QSize( 500, 450 );
+ return limitToScreenSize( this, 500, 450 );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org