- Use bold and a bit bigger font.

- Use correct KColorScheme ctor, not the deprecated one

svn path=/trunk/KDE/kdebase/workspace/; revision=707988
icc-effect-5.14.5
Rivo Laks 2007-09-03 15:02:26 +00:00
parent e6069e9cf6
commit 8246723251
2 changed files with 17 additions and 9 deletions

View File

@ -91,9 +91,7 @@ void BoxSwitchEffect::paintScreen( int mask, QRegion region, ScreenPaintData& da
paintWindowThumbnail( w );
paintWindowIcon( w );
}
int maxwidth = text_area.width();
QColor color = KColorScheme( KColorScheme::Window ).foreground();
effects->paintText( selected_window->caption(), text_area.center(), maxwidth, color );
paintText( selected_window->caption() );
}
else
{
@ -110,9 +108,7 @@ void BoxSwitchEffect::paintScreen( int mask, QRegion region, ScreenPaintData& da
paintDesktopThumbnail( painting_desktop );
}
int maxwidth = text_area.width();
QColor color = KColorScheme( KColorScheme::Window ).foreground();
effects->paintText( effects->desktopName( selected_desktop ), text_area.center(), maxwidth, color );
paintText( effects->desktopName( selected_desktop ));
painting_desktop = 0;
}
}
@ -381,7 +377,9 @@ void BoxSwitchEffect::calculateFrameSize()
item_max_size.setHeight( 200 );
}
// How much height to reserve for a one-line text label
text_area.setHeight( int( kapp->fontMetrics().height() * 1.2 ));
text_font.setBold( true );
text_font.setPointSize( 12 );
text_area.setHeight( QFontMetrics( text_font ).height() * 1.2 );
// Shrink the size until all windows/desktops can fit onscreen
frame_area.setWidth( frame_margin * 2 + itemcount * item_max_size.width());
while( frame_area.width() > displayWidth())
@ -432,7 +430,7 @@ void BoxSwitchEffect::calculateItemSizes()
void BoxSwitchEffect::paintFrame()
{
QColor color = KColorScheme( KColorScheme::Window ).background();
QColor color = KColorScheme( QPalette::Active, KColorScheme::Window ).background();
color.setAlphaF( 0.9 );
#ifdef HAVE_OPENGL
if( effects->compositingType() == OpenGLCompositing )
@ -467,7 +465,7 @@ void BoxSwitchEffect::paintFrame()
void BoxSwitchEffect::paintHighlight( QRect area )
{
QColor color = KColorScheme( KColorScheme::Selection ).background();
QColor color = KColorScheme( QPalette::Active, KColorScheme::Selection ).background();
color.setAlphaF( 0.9 );
#ifdef HAVE_OPENGL
if( effects->compositingType() == OpenGLCompositing )
@ -619,4 +617,11 @@ void BoxSwitchEffect::paintWindowIcon( EffectWindow* w )
#endif
}
void BoxSwitchEffect::paintText( const QString& text )
{
int maxwidth = text_area.width();
QColor color = KColorScheme( QPalette::Active, KColorScheme::Window ).foreground();
effects->paintText( text, text_area.center(), maxwidth, color, text_font );
}
} // namespace

View File

@ -18,6 +18,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include <QRect>
#include <QRegion>
#include <QSize>
#include <QFont>
#include <kwinglutils.h>
@ -59,6 +60,7 @@ class BoxSwitchEffect
void paintWindowThumbnail( EffectWindow* w );
void paintDesktopThumbnail( int iDesktop );
void paintWindowIcon( EffectWindow* w );
void paintText( const QString& text );
bool mActivated;
Window mInput;
@ -69,6 +71,7 @@ class BoxSwitchEffect
int highlight_margin; // TODO graphical background
QSize item_max_size; // maximum item display size (including highlight)
QRect text_area;
QFont text_font;
QHash< EffectWindow*, ItemInfo* > windows;
EffectWindowList original_windows;