diff options
author | Tomas Chvatal <scarabeus@gentoo.org> | 2009-11-22 12:10:06 +0000 |
---|---|---|
committer | Tomas Chvatal <scarabeus@gentoo.org> | 2009-11-22 12:10:06 +0000 |
commit | 7807fb7a269db1033389f57b24981eb83c83d037 (patch) | |
tree | 8b86e74defb2e3a6ad12b60d7ff9f7339d037c46 /kde-base/marble | |
parent | Display a warning message if no site-init files were found. (diff) | |
download | gentoo-2-7807fb7a269db1033389f57b24981eb83c83d037.tar.gz gentoo-2-7807fb7a269db1033389f57b24981eb83c83d037.tar.bz2 gentoo-2-7807fb7a269db1033389f57b24981eb83c83d037.zip |
Fix world clock plasmoid. Per bug #280834.
(Portage version: 2.2_rc51/cvs/Linux x86_64)
Diffstat (limited to 'kde-base/marble')
-rw-r--r-- | kde-base/marble/ChangeLog | 9 | ||||
-rw-r--r-- | kde-base/marble/files/4.3.3-world_clock.patch | 77 | ||||
-rw-r--r-- | kde-base/marble/marble-4.3.3-r1.ebuild (renamed from kde-base/marble/marble-4.3.3.ebuild) | 6 |
3 files changed, 90 insertions, 2 deletions
diff --git a/kde-base/marble/ChangeLog b/kde-base/marble/ChangeLog index a7f5cd2118c3..88e60d2afdf7 100644 --- a/kde-base/marble/ChangeLog +++ b/kde-base/marble/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for kde-base/marble # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/marble/ChangeLog,v 1.47 2009/11/09 00:14:55 alexxy Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/marble/ChangeLog,v 1.48 2009/11/22 12:10:06 scarabeus Exp $ + +*marble-4.3.3-r1 (22 Nov 2009) + + 22 Nov 2009; Tomáš Chvátal <scarabeus@gentoo.org> + +files/4.3.3-world_clock.patch, -marble-4.3.3.ebuild, + +marble-4.3.3-r1.ebuild: + Fix world clock plasmoid. Per bug #280834. 08 Nov 2009; Alexey Shvetsov <alexxy@gentoo.org> -marble-4.3.2.ebuild: Drop KDE 4.3.2 diff --git a/kde-base/marble/files/4.3.3-world_clock.patch b/kde-base/marble/files/4.3.3-world_clock.patch new file mode 100644 index 000000000000..e0ece4d57d4a --- /dev/null +++ b/kde-base/marble/files/4.3.3-world_clock.patch @@ -0,0 +1,77 @@ +Index: branches/KDE/4.3/kdeedu/marble/src/plasmoid/worldclock.cpp +=================================================================== +--- branches/KDE/4.3/kdeedu/marble/src/plasmoid/worldclock.cpp (revision 1049583) ++++ branches/KDE/4.3/kdeedu/marble/src/plasmoid/worldclock.cpp (revision 1049584) +@@ -295,30 +295,41 @@ + locstr.remove( 0, locstr.lastIndexOf( '/' ) + 1 ).replace( '_', ' ' ); + QRect timeRect( m_points.value( "topleft" ), m_points.value( "middleright" ) ); + QRect locationRect( m_points.value( "middleleft" ), m_points.value( "bottomright" ) ); ++ ++ m_locationFont = calculateFont(locstr, locationRect); ++ m_timeFont = calculateFont(timestr, timeRect); ++} ++ ++QFont WorldClock::calculateFont(const QString &text, const QRect &boundingBox) const ++{ ++ QFont resultFont( "Helvetica", 3, QFont::Bold); ++ ++ int unscaled = 0; // Avoid infinite loops, bug 189633 ++ QRect lastBox; ++ + //we set very small defaults and then increase them +- int lastSize = 3; +- for ( int curSize = 4; ; ++curSize, ++lastSize ) { +- QFont font( "Helvetica", curSize, QFont::Bold); +- QFontMetrics metrics( font ); +- QRect rect = metrics.boundingRect( locstr ); +- if ( rect.width() > locationRect.width() || +- rect.height() > locationRect.height() ) { ++ for ( int curSize = resultFont.pointSize()+1; unscaled<100; ++curSize ) { ++ resultFont.setPointSize(curSize); ++ QFontMetrics metrics( resultFont ); ++ QRect rect = metrics.boundingRect( text ); ++ if ( rect.width() > boundingBox.width() || ++ rect.height() > boundingBox.height() ) { + break; + } +- } +- m_locationFont = QFont( "Helvetica", lastSize, QFont::Bold); +- lastSize = 3; +- for ( int curSize = 4; ; ++curSize, ++lastSize ) { +- QFont font( "Helvetica", curSize, QFont::Bold); +- QFontMetrics metrics( font ); +- QRect rect = metrics.boundingRect( timestr ); +- if ( rect.width() > timeRect.width() || +- rect.height() > timeRect.height() ) { +- break; ++ ++ if ( rect.width() > lastBox.width() || ++ rect.height() > lastBox.height() ) { ++ unscaled = 0; + } ++ else { ++ ++unscaled; ++ } ++ ++ lastBox = rect; + } +- m_timeFont = QFont( "Helvetica", lastSize, QFont::Bold); +- return; ++ ++ resultFont.setPointSize(resultFont.pointSize()-1); ++ return resultFont; + } + + void WorldClock::recalculateTranslation() +Index: branches/KDE/4.3/kdeedu/marble/src/plasmoid/worldclock.h +=================================================================== +--- branches/KDE/4.3/kdeedu/marble/src/plasmoid/worldclock.h (revision 1049583) ++++ branches/KDE/4.3/kdeedu/marble/src/plasmoid/worldclock.h (revision 1049584) +@@ -67,6 +67,7 @@ + //these are used for sizing & positioning text + void recalculatePoints(); + void recalculateFonts(); ++ QFont calculateFont(const QString &text, const QRect &boundingBox) const; + void recalculateTranslation(); + + //for changing zones based on mouse position diff --git a/kde-base/marble/marble-4.3.3.ebuild b/kde-base/marble/marble-4.3.3-r1.ebuild index f262f77f69f9..2f54e69494c4 100644 --- a/kde-base/marble/marble-4.3.3.ebuild +++ b/kde-base/marble/marble-4.3.3-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/marble/marble-4.3.3.ebuild,v 1.1 2009/11/02 22:04:20 wired Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/marble/marble-4.3.3-r1.ebuild,v 1.1 2009/11/22 12:10:06 scarabeus Exp $ EAPI="2" @@ -26,6 +26,10 @@ RDEPEND="${DEPEND} !kdeprefix? ( !sci-geosciences/marble ) " +PATCHES=( + "${FILESDIR}/${PV}-world_clock.patch" +) + src_configure() { mycmakeargs="${mycmakeargs} $(cmake-utils_use_with designer-plugin DESIGNER_PLUGIN) |