From 5fd266a3a5a6d9a1acb9c38e4802ff06ba38beaf Mon Sep 17 00:00:00 2001 From: drw Date: Thu, 14 Apr 2005 18:30:23 +0000 Subject: More icon sizing updates --- (limited to 'core') diff --git a/core/launcher/launchertab.cpp b/core/launcher/launchertab.cpp index 710f259..72ebf59 100644 --- a/core/launcher/launchertab.cpp +++ b/core/launcher/launchertab.cpp @@ -97,10 +97,10 @@ void LauncherTabBar::layoutTabs() if ( t != current ) { available -= hiddenTabWidth + hframe - overlap; if ( t->iconSet() != 0 ) - available -= t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); + available -= t->iconSet()->pixmap().width(); } if ( t->iconSet() != 0 ) - iw += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); + iw += t->iconSet()->pixmap().width(); required += iw; // As space gets tight, packed looks better than even. "10" must be at least 0. if ( iw >= eventabwidth-10 ) @@ -116,8 +116,8 @@ void LauncherTabBar::layoutTabs() int w = fm.width( t->text() ); int ih = 0; if ( t->iconSet() != 0 ) { - w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); - ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); + w += t->iconSet()->pixmap().width(); + ih = t->iconSet()->pixmap().height(); } int h = QMAX( fm.height(), ih ); h = QMAX( h, QApplication::globalStrut().height() ); @@ -134,8 +134,8 @@ void LauncherTabBar::layoutTabs() int w = hiddenTabWidth; int ih = 0; if ( t->iconSet() != 0 ) { - w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); - ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); + w += t->iconSet()->pixmap().width(); + ih = t->iconSet()->pixmap().height(); } int h = QMAX( fm.height(), ih ); h = QMAX( h, QApplication::globalStrut().height() ); @@ -149,7 +149,7 @@ void LauncherTabBar::layoutTabs() } else { int ih = 0; if ( t->iconSet() != 0 ) { - ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); + ih = t->iconSet()->pixmap().height(); } int h = QMAX( fm.height(), ih ); h = QMAX( h, QApplication::globalStrut().height() ); @@ -220,8 +220,8 @@ void LauncherTabBar::paint( QPainter * p, QTab * t, bool selected ) const int iw = 0; int ih = 0; if ( t->iconSet() != 0 ) { - iw = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 2; - ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); + iw = t->iconSet()->pixmap().width() + 2; + ih = t->iconSet()->pixmap().height(); } int w = iw + p->fontMetrics().width( t->text() ) + 4; int h = QMAX(p->fontMetrics().height() + 4, ih ); @@ -251,7 +251,11 @@ void LauncherTabBar::paintLabel( QPainter* p, const QRect&, QIconSet::Mode mode = (t->isEnabled() && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled; if ( mode == QIconSet::Normal && has_focus ) mode = QIconSet::Active; - QPixmap pixmap = t->iconSet()->pixmap( QIconSet::Small, mode ); + QPixmap pixmap; + if ( mode == QIconSet::Disabled ) + pixmap = t->iconSet()->pixmap( QIconSet::Automatic, mode ); + else + pixmap = t->iconSet()->pixmap(); int pixw = pixmap.width(); int pixh = pixmap.height(); p->drawPixmap( r.left() + 6, r.center().y() - pixh / 2 + 1, pixmap ); diff --git a/core/settings/launcher/menusettings.cpp b/core/settings/launcher/menusettings.cpp index 55bf358..29ce841 100644 --- a/core/settings/launcher/menusettings.cpp +++ b/core/settings/launcher/menusettings.cpp @@ -1,26 +1,26 @@ /* -                This file is part of the OPIE Project + This file is part of the OPIE Project =. Copyright (c) 2002 Trolltech AS -             .=l. Copyright (c) 2002 Robert Griebl -           .>+-= - _;:,     .>    :=|. This file is free software; you can -.> <`_,   >  .   <= redistribute it and/or modify it under -:`=1 )Y*s>-.--   : the terms of the GNU General Public -.="- .-=="i,     .._ License as published by the Free Software - - .   .-<_>     .<> Foundation; either version 2 of the License, -     ._= =}       : or (at your option) any later version. -    .%`+i>       _;_. -    .i_,=:_.      -`: PARTICULAR PURPOSE. See the GNU General -..}^=.=       =       ; Public License for more details. -++=   -.     .`     .: - :     =  ...= . :.=- You should have received a copy of the GNU - -.   .:....=;==+<; General Public License along with this file; -  -_. . .   )=.  = see the file COPYING. If not, write to the -    --        :-=` Free Software Foundation, Inc., + .=l. Copyright (c) 2002 Robert Griebl + .>+-= +_;:, .> :=|. This file is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU General Public +.="- .-=="i, .._ License as published by the Free Software +- . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -`: PARTICULAR PURPOSE. See the GNU General +..}^=.= = ; Public License for more details. +++= -. .` .: +: = ...= . :.=- You should have received a copy of the GNU +-. .:....=;==+<; General Public License along with this file; + -_. . . )=. = see the file COPYING. If not, write to the + -- :-=` Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -105,7 +105,7 @@ void MenuSettings::init ( ) else delete trans; name = iface-> name ( ); - icon = iface-> icon ( ). pixmap ( QIconSet::Small, QIconSet::Normal ); + icon = iface-> icon ( ). pixmap (); iface-> release ( ); lib-> unload ( ); -- cgit v0.9.0.2