Summary: | Font changes size in contact list | ||
---|---|---|---|
Product: | [Applications] kopete | Reporter: | Till Gerken <till.gerken> |
Component: | general | Assignee: | Grzegorz Jaskiewicz <gj> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kopete-bugs-null |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
Correct font size
Incorrect font size |
Description
Till Gerken
2005-05-30 21:51:06 UTC
Created attachment 11268 [details]
Correct font size
Created attachment 11269 [details]
Incorrect font size
ok, I got it here. In essence it works like that: you have your font set for away messages to let's say 8 pix height verdana. (smaller than default one). someone on your list changes his away message, and new one being displayed using default settings again, rather than 8 pix verdana. Hope that's clear. anyway, confirmed, My change to display away message using DisplayNameComponent only showed that there is another problem with this component. http://www.kde.org.pl/kupa4.jpg take a look at this. The problem appears to be in DisplayNameComponent in general,not just away message. My last commit just exposed that problem, and Till have found it. SVN commit 419986 by gj: BUGFIX: Ok, this should FIX BUG 106522. there was default QFont used to repaint any text, not one used with setFont(); I wonder how it ever worked. I have to play aroud with colors, and see if they are screwed up too. Till, please test, and close the bug if you think it's OK. I am sure it is, as far as I am concerned. CCMAIL: 106522@bugs.kde.org M +7 -3 kopetelistviewitem.cpp --- trunk/KDE/kdenetwork/kopete/libkopete/ui/kopetelistviewitem.cpp #419985:419986 @@ -636,6 +636,8 @@ { public: QString text; + QColor color; + QFont font; }; DisplayNameComponent::DisplayNameComponent( ComponentBase *parent ) @@ -707,15 +709,14 @@ tokens = Kopete::Emoticons::tokenizeEmoticons( text ); ImageComponent *ic; - QFont font; - QFontMetrics fontMetrics( font ); + QFontMetrics fontMetrics( d->font ); int fontHeight = fontMetrics.height(); for ( token = tokens.begin(); token != tokens.end(); ++token ) { switch ( (*token).type ) { case Kopete::Emoticons::Text: - new TextComponent( this, font, (*token).text ); + new TextComponent( this, d->font, (*token).text ); break; case Kopete::Emoticons::Image: ic = new ImageComponent( this ); @@ -733,6 +734,8 @@ for ( uint n = 0; n < components(); ++n ) if( component( n )->rtti() == Rtti_TextComponent ) ((TextComponent*)component(n))->setFont( font ); + + d->font = font; } void DisplayNameComponent::setColor( const QColor& color ) @@ -740,6 +743,7 @@ for ( uint n = 0; n < components(); ++n ) if( component( n )->rtti() == Rtti_TextComponent ) ((TextComponent*)component(n))->setColor( color ); + d->color = color; } void DisplayNameComponent::setDefaultColor() SVN commit 420065 by gerken: Fix compilation. With previous change by Greg also fixes #106522. BUG: 106522 M +2 -1 kopetelistviewitem.cpp --- trunk/KDE/kdenetwork/kopete/libkopete/ui/kopetelistviewitem.cpp #420064:420065 @@ -708,6 +708,7 @@ tokens = Kopete::Emoticons::tokenizeEmoticons( text ); ImageComponent *ic; + TextComponent *t; QFontMetrics fontMetrics( d->font ); int fontHeight = fontMetrics.height(); @@ -716,7 +717,7 @@ switch ( (*token).type ) { case Kopete::Emoticons::Text: - TextComponent *t = new TextComponent( this, d->font, (*token).text ); + t = new TextComponent( this, d->font, (*token).text ); t->setColor( d->color ); break; case Kopete::Emoticons::Image: |