* Part 2/2 of Chakra patches

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1172713 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent f815711d03
commit e2e6ec17cf

@ -57,6 +57,7 @@
#include <ktextedit.h> #include <ktextedit.h>
#include <kurl.h> // KNewStuff #include <kurl.h> // KNewStuff
#include <kurlrequesterdlg.h> #include <kurlrequesterdlg.h>
#include <kurlrequester.h>
#include <krun.h> #include <krun.h>
#include <kfiledialog.h> #include <kfiledialog.h>
@ -263,6 +264,8 @@ AppearanceConfig::AppearanceConfig(TQWidget *parent, const char* /*name*/, const
this, TQT_SLOT(emitChanged())); this, TQT_SLOT(emitChanged()));
connect(d->mPrfsContactList->mIconMode, TQT_SIGNAL(toggled(bool)), connect(d->mPrfsContactList->mIconMode, TQT_SIGNAL(toggled(bool)),
this, TQT_SLOT(emitChanged())); this, TQT_SLOT(emitChanged()));
connect(d->mPrfsContactList->mThemeURL, TQT_SIGNAL(textChanged(const TQString&)),
this, TQT_SLOT(emitChanged()));
connect(d->mPrfsContactList->mAnimateChanges, TQT_SIGNAL(toggled(bool)), connect(d->mPrfsContactList->mAnimateChanges, TQT_SIGNAL(toggled(bool)),
this, TQT_SLOT(emitChanged())); this, TQT_SLOT(emitChanged()));
connect(d->mPrfsContactList->mFadeVisibility, TQT_SIGNAL(toggled(bool)), connect(d->mPrfsContactList->mFadeVisibility, TQT_SIGNAL(toggled(bool)),
@ -307,6 +310,8 @@ AppearanceConfig::AppearanceConfig(TQWidget *parent, const char* /*name*/, const
this, TQT_SLOT(emitChanged())); this, TQT_SLOT(emitChanged()));
connect(d->mPrfsColors->mNormalFont, TQT_SIGNAL(fontSelected(const TQFont &)), connect(d->mPrfsColors->mNormalFont, TQT_SIGNAL(fontSelected(const TQFont &)),
this, TQT_SLOT(emitChanged())); this, TQT_SLOT(emitChanged()));
connect(d->mPrfsColors->mGroupFont, TQT_SIGNAL(fontSelected(const TQFont &)),
this, TQT_SLOT(emitChanged()));
connect(d->mPrfsColors->mGroupNameColor, TQT_SIGNAL(changed(const TQColor &)), connect(d->mPrfsColors->mGroupNameColor, TQT_SIGNAL(changed(const TQColor &)),
this, TQT_SLOT(emitChanged())); this, TQT_SLOT(emitChanged()));
@ -364,6 +369,7 @@ void AppearanceConfig::save()
} }
// "Contact List" TAB ======================================================= // "Contact List" TAB =======================================================
p->setThemeURL(d->mPrfsContactList->mThemeURL->url());
p->setTreeView(d->mPrfsContactList->mTreeContactList->isChecked()); p->setTreeView(d->mPrfsContactList->mTreeContactList->isChecked());
p->setSortByGroup(d->mPrfsContactList->mSortByGroup->isChecked()); p->setSortByGroup(d->mPrfsContactList->mSortByGroup->isChecked());
p->setContactListIndentContacts(d->mPrfsContactList->mIndentContacts->isChecked()); p->setContactListIndentContacts(d->mPrfsContactList->mIndentContacts->isChecked());
@ -385,6 +391,7 @@ void AppearanceConfig::save()
p->setContactListUseCustomFonts(d->mPrfsColors->mUseCustomFonts->isChecked()); p->setContactListUseCustomFonts(d->mPrfsColors->mUseCustomFonts->isChecked());
p->setContactListCustomSmallFont(d->mPrfsColors->mSmallFont->font()); p->setContactListCustomSmallFont(d->mPrfsColors->mSmallFont->font());
p->setContactListCustomNormalFont(d->mPrfsColors->mNormalFont->font()); p->setContactListCustomNormalFont(d->mPrfsColors->mNormalFont->font());
p->setContactListCustomGroupFont(d->mPrfsColors->mGroupFont->font());
p->setContactListGroupNameColor(d->mPrfsColors->mGroupNameColor->color()); p->setContactListGroupNameColor(d->mPrfsColors->mGroupNameColor->color());
p->setContactListAutoHide(d->mPrfsContactList->mAutoHide->isChecked()); p->setContactListAutoHide(d->mPrfsContactList->mAutoHide->isChecked());
p->setContactListAutoHideTimeout(d->mPrfsContactList->mAutoHideTimeout->value()); p->setContactListAutoHideTimeout(d->mPrfsContactList->mAutoHideTimeout->value());
@ -417,6 +424,7 @@ void AppearanceConfig::load()
slotLoadChatStyles(); slotLoadChatStyles();
// "Contact List" TAB ======================================================= // "Contact List" TAB =======================================================
d->mPrfsContactList->mThemeURL->setURL(p->themeURL());
d->mPrfsContactList->mTreeContactList->setChecked( p->treeView() ); d->mPrfsContactList->mTreeContactList->setChecked( p->treeView() );
d->mPrfsContactList->mSortByGroup->setChecked( p->sortByGroup() ); d->mPrfsContactList->mSortByGroup->setChecked( p->sortByGroup() );
d->mPrfsContactList->mIndentContacts->setChecked( p->contactListIndentContacts() ); d->mPrfsContactList->mIndentContacts->setChecked( p->contactListIndentContacts() );
@ -453,6 +461,7 @@ void AppearanceConfig::load()
d->mPrfsColors->mUseCustomFonts->setChecked(p->contactListUseCustomFonts()); d->mPrfsColors->mUseCustomFonts->setChecked(p->contactListUseCustomFonts());
d->mPrfsColors->mSmallFont->setFont(p->contactListCustomSmallFont()); d->mPrfsColors->mSmallFont->setFont(p->contactListCustomSmallFont());
d->mPrfsColors->mNormalFont->setFont(p->contactListCustomNormalFont()); d->mPrfsColors->mNormalFont->setFont(p->contactListCustomNormalFont());
d->mPrfsColors->mGroupFont->setFont(p->contactListCustomGroupFont());
d->mPrfsColors->mGroupNameColor->setColor(p->contactListGroupNameColor()); d->mPrfsColors->mGroupNameColor->setColor(p->contactListGroupNameColor());
d->mPrfsColors->mBgOverride->setChecked( p->bgOverride() ); d->mPrfsColors->mBgOverride->setChecked( p->bgOverride() );

@ -1,4 +1,4 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>AppearanceConfig_Colors</class> <class>AppearanceConfig_Colors</class>
<widget class="QWidget"> <widget class="QWidget">
<property name="name"> <property name="name">
@ -8,8 +8,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>595</width> <width>618</width>
<height>606</height> <height>594</height>
</rect> </rect>
</property> </property>
<property name="caption"> <property name="caption">
@ -203,7 +203,7 @@
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="QLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout5</cstring> <cstring>layout9</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
@ -222,38 +222,56 @@
<property name="sizeHint"> <property name="sizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>0</height> <height>16</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLayoutWidget"> <widget class="QLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout4</cstring> <cstring>layout8</cstring>
</property> </property>
<grid> <vbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel" row="1" column="0"> <widget class="QLayoutWidget">
<property name="name"> <property name="name">
<cstring>mSmallFontLabel</cstring> <cstring>layout5</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>mGroupFontLabel</cstring>
</property> </property>
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="text"> <property name="text">
<string>Small font:</string> <string>Group font:</string>
</property> </property>
</widget> </widget>
<widget class="KFontRequester" row="0" column="1"> <widget class="KFontRequester">
<property name="name"> <property name="name">
<cstring>mNormalFont</cstring> <cstring>mGroupFont</cstring>
</property> </property>
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="0"> </hbox>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout6</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name"> <property name="name">
<cstring>mNormalFontLabel</cstring> <cstring>mNormalFontLabel</cstring>
</property> </property>
@ -264,7 +282,36 @@
<string>Normal font:</string> <string>Normal font:</string>
</property> </property>
</widget> </widget>
<widget class="KFontRequester" row="1" column="1"> <widget class="KFontRequester">
<property name="name">
<cstring>mNormalFont</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout7</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>mSmallFontLabel</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Small font:</string>
</property>
</widget>
<widget class="KFontRequester">
<property name="name"> <property name="name">
<cstring>mSmallFont</cstring> <cstring>mSmallFont</cstring>
</property> </property>
@ -272,7 +319,9 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</grid> </hbox>
</widget>
</vbox>
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
@ -342,8 +391,6 @@
</spacer> </spacer>
</vbox> </vbox>
</widget> </widget>
<customwidgets>
</customwidgets>
<connections> <connections>
<connection> <connection>
<sender>mUseCustomFonts</sender> <sender>mUseCustomFonts</sender>
@ -375,6 +422,18 @@
<receiver>idleContactColor</receiver> <receiver>idleContactColor</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
</connection> </connection>
<connection>
<sender>mUseCustomFonts</sender>
<signal>toggled(bool)</signal>
<receiver>mGroupFontLabel</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>mUseCustomFonts</sender>
<signal>toggled(bool)</signal>
<receiver>mGroupFont</receiver>
<slot>setEnabled(bool)</slot>
</connection>
</connections> </connections>
<tabstops> <tabstops>
<tabstop>bgColor</tabstop> <tabstop>bgColor</tabstop>
@ -391,6 +450,7 @@
<includehint>kfontrequester.h</includehint> <includehint>kfontrequester.h</includehint>
<includehint>kfontrequester.h</includehint> <includehint>kfontrequester.h</includehint>
<includehint>kfontrequester.h</includehint> <includehint>kfontrequester.h</includehint>
<includehint>kfontrequester.h</includehint>
<includehint>kcolorbutton.h</includehint> <includehint>kcolorbutton.h</includehint>
<includehint>kcolorbutton.h</includehint> <includehint>kcolorbutton.h</includehint>
</includehints> </includehints>

@ -9,17 +9,25 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>707</width> <width>707</width>
<height>445</height> <height>507</height>
</rect> </rect>
</property> </property>
<property name="caption"> <property name="caption">
<string>Contact List Appearance</string> <string>Contact List Appearance</string>
</property> </property>
<grid> <vbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QGroupBox" row="0" column="0"> <widget class="QLayoutWidget">
<property name="name">
<cstring>layout4</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QGroupBox">
<property name="name"> <property name="name">
<cstring>groupBox1</cstring> <cstring>groupBox1</cstring>
</property> </property>
@ -83,7 +91,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QGroupBox" row="0" column="1"> <widget class="QGroupBox">
<property name="name"> <property name="name">
<cstring>groupBox10</cstring> <cstring>groupBox10</cstring>
</property> </property>
@ -112,6 +120,9 @@
<property name="text"> <property name="text">
<string>&amp;Classic, left-aligned status icons</string> <string>&amp;Classic, left-aligned status icons</string>
</property> </property>
<property name="accel">
<string>Alt+C</string>
</property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -123,6 +134,9 @@
<property name="text"> <property name="text">
<string>&amp;Right-aligned status icons</string> <string>&amp;Right-aligned status icons</string>
</property> </property>
<property name="accel">
<string>Alt+R</string>
</property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="QRadioButton">
<property name="name"> <property name="name">
@ -131,6 +145,9 @@
<property name="text"> <property name="text">
<string>Detailed &amp;view</string> <string>Detailed &amp;view</string>
</property> </property>
<property name="accel">
<string>Alt+V</string>
</property>
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
@ -144,7 +161,70 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="2"> </hbox>
</widget>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox5</cstring>
</property>
<property name="title">
<string>Displayed Theme Path</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="KURLRequester">
<property name="name">
<cstring>mThemeURL</cstring>
</property>
<property name="mode">
<number>15</number>
</property>
</widget>
</vbox>
</widget>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox2</cstring>
</property>
<property name="title">
<string>Contact List Animations</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>mAnimateChanges</cstring>
</property>
<property name="text">
<string>&amp;Animate changes to contact list items</string>
</property>
<property name="accel">
<string>Alt+A</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>mFadeVisibility</cstring>
</property>
<property name="text">
<string>Fade in / out contacts as the&amp;y appear / disappear</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>mFoldVisibility</cstring>
</property>
<property name="text">
<string>Fo&amp;ld in / out contacts as they appear / disappear</string>
</property>
</widget>
</vbox>
</widget>
<widget class="QGroupBox">
<property name="name"> <property name="name">
<cstring>groupBox3</cstring> <cstring>groupBox3</cstring>
</property> </property>
@ -246,44 +326,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QGroupBox" row="1" column="0" rowspan="1" colspan="2"> <widget class="QLayoutWidget">
<property name="name">
<cstring>groupBox2</cstring>
</property>
<property name="title">
<string>Contact List Animations</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>mAnimateChanges</cstring>
</property>
<property name="text">
<string>&amp;Animate changes to contact list items</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>mFadeVisibility</cstring>
</property>
<property name="text">
<string>Fade in / out contacts as the&amp;y appear / disappear</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>mFoldVisibility</cstring>
</property>
<property name="text">
<string>Fo&amp;ld in / out contacts as they appear / disappear</string>
</property>
</widget>
</vbox>
</widget>
<widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>layout8</cstring> <cstring>layout8</cstring>
</property> </property>
@ -318,7 +361,7 @@
</spacer> </spacer>
</hbox> </hbox>
</widget> </widget>
<spacer row="4" column="0" rowspan="1" colspan="2"> <spacer>
<property name="name"> <property name="name">
<cstring>spacer15</cstring> <cstring>spacer15</cstring>
</property> </property>
@ -335,7 +378,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
</grid> </vbox>
</widget> </widget>
<connections> <connections>
<connection> <connection>
@ -346,4 +389,9 @@
</connection> </connection>
</connections> </connections>
<layoutdefaults spacing="6" margin="11"/> <layoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kurlrequester.h</includehint>
<includehint>klineedit.h</includehint>
<includehint>kpushbutton.h</includehint>
</includehints>
</UI> </UI>

@ -38,8 +38,9 @@
class KopeteGroupViewItem::Private class KopeteGroupViewItem::Private
{ {
public: public:
Kopete::UI::ListView::GroupBoxComponent *hbox;
Kopete::UI::ListView::ImageComponent *image; Kopete::UI::ListView::ImageComponent *image;
Kopete::UI::ListView::DisplayNameComponent *name; Kopete::UI::ListView::TextComponent *name;
Kopete::UI::ListView::TextComponent *count; Kopete::UI::ListView::TextComponent *count;
std::auto_ptr<Kopete::UI::ListView::ToolTipSource> toolTipSource; std::auto_ptr<Kopete::UI::ListView::ToolTipSource> toolTipSource;
}; };
@ -93,12 +94,14 @@ void KopeteGroupViewItem::initLVI()
d->toolTipSource.reset( new Kopete::UI::ListView::GroupToolTipSource( this ) ); d->toolTipSource.reset( new Kopete::UI::ListView::GroupToolTipSource( this ) );
using namespace Kopete::UI::ListView; using namespace Kopete::UI::ListView;
Component *hbox = new BoxComponent( this, BoxComponent::Horizontal ); d->hbox = new GroupBoxComponent( this, BoxComponent::Horizontal );
d->image = new ImageComponent( hbox );
d->name = new DisplayNameComponent( hbox ); Component *hbox = d->hbox;
//d->image = new ImageComponent( hbox );
d->name = new TextComponent( hbox );
d->count = new TextComponent( hbox ); d->count = new TextComponent( hbox );
d->image->setToolTipSource( d->toolTipSource.get() ); // d->image->setToolTipSource( d->toolTipSource.get() );
d->name->setToolTipSource( d->toolTipSource.get() ); d->name->setToolTipSource( d->toolTipSource.get() );
d->count->setToolTipSource( d->toolTipSource.get() ); d->count->setToolTipSource( d->toolTipSource.get() );
@ -131,17 +134,20 @@ TQString KopeteGroupViewItem::toolTip() const
void KopeteGroupViewItem::slotConfigChanged() void KopeteGroupViewItem::slotConfigChanged()
{ {
updateIcon(); if (d->hbox != NULL)
d->hbox->reloadTheme();
// updateIcon();
updateVisibility(); updateVisibility();
d->name->setColor( KopetePrefs::prefs()->contactListGroupNameColor() ); d->name->setColor( KopetePrefs::prefs()->contactListGroupNameColor() );
d->count->setColor( KopetePrefs::prefs()->contactListGroupNameColor() );
TQFont font = listView()->font(); TQFont font = listView()->font();
if ( KopetePrefs::prefs()->contactListUseCustomFonts() ) if ( KopetePrefs::prefs()->contactListUseCustomFonts() )
font = KopetePrefs::prefs()->contactListCustomNormalFont(); font = KopetePrefs::prefs()->contactListCustomGroupFont();
d->name->setFont( font ); d->name->setFont( font );
d->count->setFont( font );
d->count->setFont( KopetePrefs::prefs()->contactListSmallFont() );
} }
void KopeteGroupViewItem::refreshDisplayName() void KopeteGroupViewItem::refreshDisplayName()
@ -242,7 +248,7 @@ void KopeteGroupViewItem::updateIcon()
else else
open = SmallIcon( KOPETE_GROUP_DEFAULT_OPEN_ICON ); open = SmallIcon( KOPETE_GROUP_DEFAULT_OPEN_ICON );
d->image->setPixmap( open ); // d->image->setPixmap( open );
} }
else else
{ {
@ -251,7 +257,7 @@ void KopeteGroupViewItem::updateIcon()
else else
closed = SmallIcon( KOPETE_GROUP_DEFAULT_CLOSED_ICON ); closed = SmallIcon( KOPETE_GROUP_DEFAULT_CLOSED_ICON );
d->image->setPixmap( closed ); // d->image->setPixmap( closed );
} }
} }

@ -149,8 +149,9 @@ class KopeteMetaContactLVI::Private
{ {
public: public:
Private() : metaContactIcon( 0L ), nameText( 0L ), extraText( 0L ), contactIconBox( 0L ), Private() : metaContactIcon( 0L ), nameText( 0L ), extraText( 0L ), contactIconBox( 0L ),
currentMode( -1 ), currentIconMode( -1 ) {} currentMode( -1 ), currentIconMode( -1 ), hbox(NULL) {}
ListView::ImageComponent *metaContactIcon; ListView::ContactBoxComponent *hbox;
ListView::FaceComponent *metaContactIcon;
ListView::DisplayNameComponent *nameText; ListView::DisplayNameComponent *nameText;
ListView::DisplayNameComponent *extraText; ListView::DisplayNameComponent *extraText;
ListView::BoxComponent *contactIconBox; ListView::BoxComponent *contactIconBox;
@ -649,6 +650,9 @@ void KopeteMetaContactLVI::slotAddToNewGroup()
void KopeteMetaContactLVI::slotConfigChanged() void KopeteMetaContactLVI::slotConfigChanged()
{ {
if (d->hbox != NULL)
d->hbox->reloadTheme();
setDisplayMode( KopetePrefs::prefs()->contactListDisplayMode(), setDisplayMode( KopetePrefs::prefs()->contactListDisplayMode(),
KopetePrefs::prefs()->contactListIconMode() ); KopetePrefs::prefs()->contactListIconMode() );
@ -720,13 +724,15 @@ void KopeteMetaContactLVI::setDisplayMode( int mode, int iconmode )
// generate our contents // generate our contents
using namespace ListView; using namespace ListView;
Component *hbox = new BoxComponent( this, BoxComponent::Horizontal ); d->hbox = new ContactBoxComponent( this, BoxComponent::Horizontal );
d->hbox->reloadTheme();
Component *hbox = d->hbox;
d->spacerBox = new BoxComponent( hbox, BoxComponent::Horizontal ); d->spacerBox = new BoxComponent( hbox, BoxComponent::Horizontal );
if (iconmode == KopetePrefs::PhotoPic) { if (iconmode == KopetePrefs::PhotoPic) {
Component *imageBox = new BoxComponent( hbox, BoxComponent::Vertical ); Component *imageBox = new BoxComponent( hbox, BoxComponent::Vertical );
new VSpacerComponent( imageBox ); new VSpacerComponent( imageBox );
d->metaContactIcon = new ImageComponent( imageBox, d->iconSize + 2 , d->iconSize + 2 ); d->metaContactIcon = new FaceComponent( imageBox, d->iconSize , d->iconSize );
new VSpacerComponent( imageBox ); new VSpacerComponent( imageBox );
if(!metaContact()->photoSource() && !Kopete::KABCPersistence::self()->addressBook()->findByUid( metaContact()->metaContactId() ).isEmpty() ) if(!metaContact()->photoSource() && !Kopete::KABCPersistence::self()->addressBook()->findByUid( metaContact()->metaContactId() ).isEmpty() )
{ //if the photo is the one of the kaddressbook, track every change in the adressbook, it might be the photo of our contact. { //if the photo is the one of the kaddressbook, track every change in the adressbook, it might be the photo of our contact.
@ -734,9 +740,11 @@ void KopeteMetaContactLVI::setDisplayMode( int mode, int iconmode )
this , TQT_SLOT(slotPhotoChanged())); this , TQT_SLOT(slotPhotoChanged()));
} }
} else { } else {
d->metaContactIcon = new ImageComponent( hbox ); d->metaContactIcon = new FaceComponent( hbox );
} }
new SpacerComponent(hbox, 8, 8);
if( mode == KopetePrefs::Detailed ) if( mode == KopetePrefs::Detailed )
{ {
d->contactIconSize = IconSize( KIcon::Small ); d->contactIconSize = IconSize( KIcon::Small );

@ -13,7 +13,7 @@ SUBDIRS = $(COMPAT_DIR) private ui . avdevice
METASOURCES = AUTO METASOURCES = AUTO
AM_CPPFLAGS = -DKDE_NO_COMPAT -DQT_NO_COMPAT -DQT_NO_CAST_ASCII -DQT_NO_ASCII_CAST \ AM_CPPFLAGS = -DKDE_NO_COMPAT -DQT_NO_COMPAT \
$(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private \ $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private \
-I$(top_srcdir)/kopete/libkopete/ui $(all_includes) -I$(top_srcdir)/kopete/libkopete/ui $(all_includes)

@ -127,6 +127,7 @@ void KopetePrefs::load()
} }
config->setGroup("ContactList"); config->setGroup("ContactList");
setThemeURL(config->readEntry("ThemeURL"));
int n = metaObject()->findProperty( "contactListDisplayMode" ); int n = metaObject()->findProperty( "contactListDisplayMode" );
TQString value = config->readEntry("DisplayMode",TQString::fromLatin1("Default")); TQString value = config->readEntry("DisplayMode",TQString::fromLatin1("Default"));
mContactListDisplayMode = (ContactDisplayMode)metaObject()->property( n )->keyToValue( value.latin1() ); mContactListDisplayMode = (ContactDisplayMode)metaObject()->property( n )->keyToValue( value.latin1() );
@ -137,6 +138,7 @@ void KopetePrefs::load()
mContactListIndentContacts = config->readBoolEntry("IndentContacts", false); mContactListIndentContacts = config->readBoolEntry("IndentContacts", false);
mContactListUseCustomFonts = config->readBoolEntry("UseCustomFonts", false); mContactListUseCustomFonts = config->readBoolEntry("UseCustomFonts", false);
TQFont font = KGlobalSettings::generalFont(); TQFont font = KGlobalSettings::generalFont();
mContactListGroupFont = config->readFontEntry("GroupFont", &font);
mContactListNormalFont = config->readFontEntry("NormalFont", &font); mContactListNormalFont = config->readFontEntry("NormalFont", &font);
if ( font.pixelSize() != -1 ) if ( font.pixelSize() != -1 )
font.setPixelSize( (font.pixelSize() * 3) / 4 ); font.setPixelSize( (font.pixelSize() * 3) / 4 );
@ -226,12 +228,14 @@ void KopetePrefs::save()
config->writeEntry("ToolTipContents", mToolTipContents); config->writeEntry("ToolTipContents", mToolTipContents);
config->setGroup("ContactList"); config->setGroup("ContactList");
config->writeEntry("ThemeURL", mThemeURL);
int n = metaObject()->findProperty( "contactListDisplayMode" ); int n = metaObject()->findProperty( "contactListDisplayMode" );
config->writeEntry("DisplayMode", metaObject()->property( n )->valueToKey( mContactListDisplayMode )); config->writeEntry("DisplayMode", metaObject()->property( n )->valueToKey( mContactListDisplayMode ));
n = metaObject()->findProperty( "contactListIconMode" ); n = metaObject()->findProperty( "contactListIconMode" );
config->writeEntry("IconMode", metaObject()->property( n )->valueToKey( mContactListIconMode )); config->writeEntry("IconMode", metaObject()->property( n )->valueToKey( mContactListIconMode ));
config->writeEntry("IndentContacts", mContactListIndentContacts); config->writeEntry("IndentContacts", mContactListIndentContacts);
config->writeEntry("UseCustomFonts", mContactListUseCustomFonts); config->writeEntry("UseCustomFonts", mContactListUseCustomFonts);
config->writeEntry("GroupFont", mContactListGroupFont);
config->writeEntry("NormalFont", mContactListNormalFont); config->writeEntry("NormalFont", mContactListNormalFont);
config->writeEntry("SmallFont", mContactListSmallFont); config->writeEntry("SmallFont", mContactListSmallFont);
config->writeEntry("GroupNameColor", mContactListGroupNameColor); config->writeEntry("GroupNameColor", mContactListGroupNameColor);
@ -414,6 +418,12 @@ void KopetePrefs::setSoundIfAway(bool value)
mSoundIfAway = value; mSoundIfAway = value;
} }
void KopetePrefs::setThemeURL(const TQString &path)
{
if( path != mThemeURL ) mContactListAppearanceChanged = true;
mThemeURL = path;
}
void KopetePrefs::setStylePath(const TQString &stylePath) void KopetePrefs::setStylePath(const TQString &stylePath)
{ {
if(mStylePath != stylePath) mStylePathChanged = true; if(mStylePath != stylePath) mStylePathChanged = true;
@ -584,6 +594,12 @@ void KopetePrefs::setContactListUseCustomFonts( bool v )
mContactListUseCustomFonts = v; mContactListUseCustomFonts = v;
} }
void KopetePrefs::setContactListCustomGroupFont( const TQFont & v )
{
if( v != mContactListGroupFont ) mContactListAppearanceChanged = true;
mContactListGroupFont = v;
}
void KopetePrefs::setContactListCustomNormalFont( const TQFont & v ) void KopetePrefs::setContactListCustomNormalFont( const TQFont & v )
{ {
if( v != mContactListNormalFont ) mContactListAppearanceChanged = true; if( v != mContactListNormalFont ) mContactListAppearanceChanged = true;

@ -107,6 +107,8 @@ public:
TQStringList toolTipContents() const { return mToolTipContents; } TQStringList toolTipContents() const { return mToolTipContents; }
TQString themeURL() const { return mThemeURL; }
/// ///
enum ContactDisplayMode { Classic, RightAligned, Detailed, Yagami, Default = Classic }; enum ContactDisplayMode { Classic, RightAligned, Detailed, Yagami, Default = Classic };
/// ///
@ -115,6 +117,7 @@ public:
ContactDisplayMode contactListDisplayMode() const { return mContactListDisplayMode; } ContactDisplayMode contactListDisplayMode() const { return mContactListDisplayMode; }
IconDisplayMode contactListIconMode() const { return mContactListIconMode; } IconDisplayMode contactListIconMode() const { return mContactListIconMode; }
bool contactListUseCustomFonts() const { return mContactListUseCustomFonts; } bool contactListUseCustomFonts() const { return mContactListUseCustomFonts; }
TQFont contactListCustomGroupFont() const { return mContactListGroupFont; }
TQFont contactListCustomNormalFont() const { return mContactListNormalFont; } TQFont contactListCustomNormalFont() const { return mContactListNormalFont; }
TQFont contactListCustomSmallFont() const { return mContactListSmallFont; } TQFont contactListCustomSmallFont() const { return mContactListSmallFont; }
TQFont contactListSmallFont() const; TQFont contactListSmallFont() const;
@ -156,6 +159,7 @@ public:
void setSoundIfAway(bool); void setSoundIfAway(bool);
void setBeepNotify(bool); void setBeepNotify(bool);
void setChatWindowPolicy(int); void setChatWindowPolicy(int);
void setThemeURL(const TQString &);
void setStylePath(const TQString &); void setStylePath(const TQString &);
void setStyleVariant(const TQString &); void setStyleVariant(const TQString &);
void setChatViewBufferSize(int); void setChatViewBufferSize(int);
@ -179,6 +183,7 @@ public:
void setContactListDisplayMode( ContactDisplayMode v ); void setContactListDisplayMode( ContactDisplayMode v );
void setContactListIconMode( IconDisplayMode v ); void setContactListIconMode( IconDisplayMode v );
void setContactListUseCustomFonts( bool v ); void setContactListUseCustomFonts( bool v );
void setContactListCustomGroupFont( const TQFont & v );
void setContactListCustomNormalFont( const TQFont & v ); void setContactListCustomNormalFont( const TQFont & v );
void setContactListCustomSmallFont( const TQFont & v ); void setContactListCustomSmallFont( const TQFont & v );
void setContactListGroupNameColor( const TQColor & v ); void setContactListGroupNameColor( const TQColor & v );
@ -287,6 +292,7 @@ private:
// xhtml+css // xhtml+css
//for Adium (xhtml+css) //for Adium (xhtml+css)
TQString mThemeURL;
TQString mStylePath; TQString mStylePath;
TQString mStyleVariant; TQString mStyleVariant;
bool mStylePathChanged; bool mStylePathChanged;
@ -298,6 +304,7 @@ private:
ContactDisplayMode mContactListDisplayMode; ContactDisplayMode mContactListDisplayMode;
IconDisplayMode mContactListIconMode; IconDisplayMode mContactListIconMode;
bool mContactListUseCustomFonts; bool mContactListUseCustomFonts;
TQFont mContactListGroupFont;
TQFont mContactListNormalFont; TQFont mContactListNormalFont;
TQFont mContactListSmallFont; TQFont mContactListSmallFont;
TQColor mContactListGroupNameColor; TQColor mContactListGroupNameColor;

@ -1,5 +1,5 @@
METASOURCES = AUTO METASOURCES = AUTO
AM_CPPFLAGS = -DKDE_NO_COMPAT -DQT_NO_COMPAT -DQT_NO_CAST_ASCII -DQT_NO_ASCII_CAST \ AM_CPPFLAGS = -DKDE_NO_COMPAT -DQT_NO_COMPAT \
$(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private $(all_includes) $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private $(all_includes)
noinst_LTLIBRARIES = libkopeteui.la noinst_LTLIBRARIES = libkopeteui.la

@ -20,6 +20,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include "kopeteprefs.h"
#include "kopetecontact.h" #include "kopetecontact.h"
#include "kopetelistviewitem.h" #include "kopetelistviewitem.h"
#include "kopeteemoticons.h" #include "kopeteemoticons.h"
@ -291,7 +292,7 @@ public:
Private( BoxComponent::Direction dir ) : direction( dir ) {} Private( BoxComponent::Direction dir ) : direction( dir ) {}
BoxComponent::Direction direction; BoxComponent::Direction direction;
static const int padding = 2; static const int padding = 0;
}; };
BoxComponent::BoxComponent( ComponentBase *parent, Direction dir ) BoxComponent::BoxComponent( ComponentBase *parent, Direction dir )
@ -459,6 +460,284 @@ void BoxComponent::componentResized( Component *component )
calcMinSize(); calcMinSize();
} }
/*= ContactBoxComponent =====================================================*/
class ContactBoxComponent::Private
{
public:
TQRect sub;
TQPixmap back_pixmap;
TQPixmap corner_tl_pixmap;
TQPixmap corner_bl_pixmap;
TQPixmap corner_tr_pixmap;
TQPixmap corner_br_pixmap;
TQPixmap top_pixmap;
TQPixmap left_pixmap;
TQPixmap right_pixmap;
TQPixmap bottom_pixmap;
};
ContactBoxComponent::ContactBoxComponent(ComponentBase *parent, Direction dir)
: BoxComponent(parent, dir), d(new Private())
{}
ContactBoxComponent::~ContactBoxComponent()
{
delete d;
}
void ContactBoxComponent::reloadTheme()
{
TQString path = KopetePrefs::prefs()->themeURL();
TQString str;
str = path + "ContactBackground.png";
d->back_pixmap.load(str);
str = path + "ContactTopLeft.png";
d->corner_tl_pixmap.load(str);
str = path + "ContactBottomLeft.png";
d->corner_bl_pixmap.load(str);
str = path + "ContactTopRight.png";
d->corner_tr_pixmap.load(str);
str = path + "ContactBottomRight.png";
d->corner_br_pixmap.load(str);
str = path + "ContactTop.png";
d->top_pixmap.load(str);
str = path + "ContactLeft.png";
d->left_pixmap.load(str);
str = path + "ContactRight.png";
d->right_pixmap.load(str);
str = path + "ContactBottom.png";
d->bottom_pixmap.load(str);
}
void ContactBoxComponent::layout(const TQRect &rect)
{
d->sub.setLeft(rect.left() +
d->left_pixmap.width());
d->sub.setTop(rect.top() +
d->top_pixmap.height());
d->sub.setRight(rect.right() -
d->right_pixmap.width());
d->sub.setBottom(rect.bottom() -
d->bottom_pixmap.height());
BoxComponent::layout(d->sub);
Component::layout(rect);
}
int ContactBoxComponent::widthForHeight(int height)
{
return BoxComponent::widthForHeight(height) +
d->left_pixmap.width() +
d->right_pixmap.width();
}
int ContactBoxComponent::heightForWidth(int width)
{
return BoxComponent::heightForWidth(width) +
d->top_pixmap.height() +
d->bottom_pixmap.height();
}
void ContactBoxComponent::paint(TQPainter *painter, const TQColorGroup &cg)
{
painter->drawPixmap(0,
0,
d->corner_tl_pixmap);
painter->drawPixmap(0,
d->sub.bottom()+1,
d->corner_bl_pixmap);
painter->drawPixmap(d->sub.right()+1,
0,
d->corner_tr_pixmap);
painter->drawPixmap(d->sub.right()+1,
d->sub.bottom()+1,
d->corner_br_pixmap);
painter->drawTiledPixmap(0,
d->sub.top(),
d->left_pixmap.width(),
d->sub.height(),
d->left_pixmap);
painter->drawTiledPixmap(d->sub.left(),
0,
d->sub.width(),
d->top_pixmap.height(),
d->top_pixmap);
painter->drawTiledPixmap(d->sub.left(),
d->sub.bottom()+1,
d->sub.width(),
d->bottom_pixmap.height(),
d->bottom_pixmap);
painter->drawTiledPixmap(d->sub.right()+1,
d->sub.top(),
d->right_pixmap.width(),
d->sub.height(),
d->right_pixmap);
painter->drawTiledPixmap(d->sub,
d->back_pixmap);
return BoxComponent::paint(painter, cg);
}
/*= GroupBoxComponent =======================================================*/
class GroupBoxComponent::Private
{
public:
TQRect sub;
TQPixmap back_pixmap;
TQPixmap open_pixmap;
TQPixmap closed_pixmap;
TQPixmap corner_tl_pixmap;
TQPixmap corner_bl_pixmap;
TQPixmap corner_tr_pixmap;
TQPixmap corner_br_pixmap;
TQPixmap top_pixmap;
TQPixmap left_pixmap;
TQPixmap right_pixmap;
TQPixmap bottom_pixmap;
};
GroupBoxComponent::GroupBoxComponent(ComponentBase *parent, Direction dir)
: BoxComponent(parent, dir), d(new Private())
{}
GroupBoxComponent::~GroupBoxComponent()
{
delete d;
}
void GroupBoxComponent::reloadTheme()
{
TQString path = KopetePrefs::prefs()->themeURL();
TQString str;
str = path + "GroupBackground.png";
d->back_pixmap.load(str);
str = path + "GroupOpen.png";
d->open_pixmap.load(str);
str = path + "GroupClosed.png";
d->closed_pixmap.load(str);
str = path + "GroupTopLeft.png";
d->corner_tl_pixmap.load(str);
str = path + "GroupBottomLeft.png";
d->corner_bl_pixmap.load(str);
str = path + "GroupTopRight.png";
d->corner_tr_pixmap.load(str);
str = path + "GroupBottomRight.png";
d->corner_br_pixmap.load(str);
str = path + "GroupTop.png";
d->top_pixmap.load(str);
str = path + "GroupLeft.png";
d->left_pixmap.load(str);
str = path + "GroupRight.png";
d->right_pixmap.load(str);
str = path + "GroupBottom.png";
d->bottom_pixmap.load(str);
}
void GroupBoxComponent::layout(const TQRect &rect)
{
d->sub.setLeft(rect.left() +
d->left_pixmap.width());
d->sub.setTop(rect.top() +
d->top_pixmap.height());
d->sub.setRight(rect.right() -
d->right_pixmap.width());
d->sub.setBottom(rect.bottom() -
d->bottom_pixmap.height());
BoxComponent::layout(d->sub);
Component::layout(rect);
}
int GroupBoxComponent::widthForHeight(int height)
{
return BoxComponent::widthForHeight(height) +
d->left_pixmap.width() +
d->right_pixmap.width();
}
int GroupBoxComponent::heightForWidth( int width )
{
return BoxComponent::heightForWidth(width) +
d->top_pixmap.height() +
d->bottom_pixmap.height();
}
void GroupBoxComponent::paint( TQPainter *painter, const TQColorGroup &cg )
{
painter->drawPixmap(0,
0,
d->corner_tl_pixmap);
painter->drawPixmap(0,
d->sub.bottom()+1,
d->corner_bl_pixmap);
painter->drawPixmap(d->sub.right()+1,
0,
d->corner_tr_pixmap);
painter->drawPixmap(d->sub.right()+1,
d->sub.bottom()+1,
d->corner_br_pixmap);
painter->drawTiledPixmap(0,
d->sub.top(),
d->left_pixmap.width(),
d->sub.height(),
d->left_pixmap);
painter->drawTiledPixmap(d->sub.left(),
0,
d->sub.width(),
d->top_pixmap.height(),
d->top_pixmap);
painter->drawTiledPixmap(d->sub.left(),
d->sub.bottom()+1,
d->sub.width(),
d->bottom_pixmap.height(),
d->bottom_pixmap);
painter->drawTiledPixmap(d->sub.right()+1,
d->sub.top(),
d->right_pixmap.width(),
d->sub.height(),
d->right_pixmap);
painter->drawTiledPixmap(d->sub,
d->back_pixmap);
return BoxComponent::paint(painter, cg);
}
// ImageComponent -------- // ImageComponent --------
class ImageComponent::Private class ImageComponent::Private
@ -492,33 +771,21 @@ TQPixmap ImageComponent::pixmap()
return d->image; return d->image;
} }
void ImageComponent::setPixmap( const TQPixmap &img, bool adjustSize) void ImageComponent::setPixmap( const TQPixmap &img, bool)
{ {
d->image = img; d->image = img;
if ( adjustSize ) setMinWidth(d->image.width());
{ setMinHeight(d->image.height());
setMinWidth( img.width() );
setMinHeight( img.height() );
}
repaint();
}
static TQPoint operator+( const TQPoint &pt, const TQSize &sz ) repaint();
{
return TQPoint( pt.x() + sz.width(), pt.y() + sz.height() );
} }
/*static TQPoint operator+( const TQSize &sz, const TQPoint &pt )
{
return pt + sz;
}*/
void ImageComponent::paint( TQPainter *painter, const TQColorGroup & ) void ImageComponent::paint( TQPainter *painter, const TQColorGroup & )
{ {
TQRect ourRc = rect(); TQRect ourRc = rect();
TQRect rc = d->image.rect(); TQRect rc = d->image.rect();
// center rc within our rect // center rc within our rect
rc.moveTopLeft( ourRc.topLeft() + (ourRc.size() - rc.size()) / 2 ); rc.moveTopLeft(ourRc.topLeft());
// paint, shrunk to be within our rect // paint, shrunk to be within our rect
painter->drawPixmap( rc & ourRc, d->image ); painter->drawPixmap( rc & ourRc, d->image );
} }
@ -528,6 +795,57 @@ void ImageComponent::scale( int w, int h, TQImage::ScaleMode mode )
TQImage im = d->image.convertToImage(); TQImage im = d->image.convertToImage();
setPixmap( TQPixmap( im.smoothScale( w, h, mode ) ) ); setPixmap( TQPixmap( im.smoothScale( w, h, mode ) ) );
} }
/*= FaceComponent ===========================================================*/
void FaceComponent::setPixmap(const TQPixmap &img, bool)
{
d->image = img;
setMinWidth(d->image.width());
setMinHeight(d->image.height());
if (img.width() >= 30)
{
d->image = TQPixmap(img.convertToImage().smoothScale(30, 30));
setMinWidth(d->image.width() + 4);
setMinHeight(d->image.height() + 4);
}
repaint();
}
static TQPoint operator+(const TQPoint &pt, const TQSize &sz)
{
return TQPoint(pt.x() + sz.width(), pt.y() + sz.height());
}
void FaceComponent::paint(TQPainter *painter, const TQColorGroup &)
{
TQRect outRc = rect();
TQRect pixRc = d->image.rect();
pixRc.moveTopLeft(outRc.topLeft() + (outRc.size() - pixRc.size()) / 2);
if (d->image.width() == 30)
{
TQPixmap pixBorder;
TQString path = KopetePrefs::prefs()->themeURL();
TQString str = path + "ContactFace.png";
pixBorder.load(str);
TQRect pixRc2 = pixBorder.rect();
pixRc2.moveTopLeft(outRc.topLeft() + (outRc.size() - pixRc2.size()) / 2);
painter->drawPixmap(pixRc2, pixBorder);
}
painter->drawPixmap(pixRc, d->image);
}
// TextComponent // TextComponent
class TextComponent::Private class TextComponent::Private
@ -813,10 +1131,10 @@ public:
int iconSize; int iconSize;
}; };
ContactComponent::ContactComponent( ComponentBase *parent, Kopete::Contact *contact, int iconSize) : ImageComponent( parent ) , d( new Private ) ContactComponent::ContactComponent( ComponentBase *parent, Kopete::Contact *contact, int) : ImageComponent( parent ) , d( new Private )
{ {
d->contact = contact; d->contact = contact;
d->iconSize = iconSize; d->iconSize = 12; // size of the image is fixed to 12 pixels
updatePixmap(); updatePixmap();
} }

@ -236,7 +236,7 @@ public:
BoxComponent( ComponentBase *parent, Direction dir = Horizontal ); BoxComponent( ComponentBase *parent, Direction dir = Horizontal );
~BoxComponent(); ~BoxComponent();
void layout( const TQRect &rect ); virtual void layout( const TQRect &rect );
virtual int widthForHeight( int height ); virtual int widthForHeight( int height );
virtual int heightForWidth( int width ); virtual int heightForWidth( int width );
@ -256,6 +256,52 @@ private:
Private *d; Private *d;
}; };
/**
* ContactBoxComponent
*/
class ContactBoxComponent : public BoxComponent
{
public:
ContactBoxComponent(ComponentBase *parent, Direction dir = Horizontal);
~ContactBoxComponent();
virtual void reloadTheme();
virtual void layout(const TQRect &rect);
virtual int widthForHeight(int height);
virtual int heightForWidth(int width);
virtual void paint(TQPainter *painter, const TQColorGroup &cg);
private:
class Private;
Private *d;
};
/**
* GroupBoxComponent
*/
class GroupBoxComponent : public BoxComponent
{
public:
GroupBoxComponent(ComponentBase *parent, Direction dir = Horizontal);
~GroupBoxComponent();
virtual void reloadTheme();
virtual void layout(const TQRect &rect);
virtual int widthForHeight(int height);
virtual int heightForWidth(int width);
virtual void paint(TQPainter *painter, const TQColorGroup &cg);
private:
class Private;
Private *d;
};
class TextComponent : public Component class TextComponent : public Component
{ {
public: public:
@ -293,19 +339,32 @@ public:
ImageComponent( ComponentBase *parent, int minW, int minH ); ImageComponent( ComponentBase *parent, int minW, int minH );
~ImageComponent(); ~ImageComponent();
void setPixmap( const TQPixmap &img, bool adjustSize = true); virtual void setPixmap( const TQPixmap &img, bool adjustSize = true);
TQPixmap pixmap( void ); TQPixmap pixmap( void );
void paint( TQPainter *painter, const TQColorGroup &cg ); virtual void paint( TQPainter *painter, const TQColorGroup &cg );
void scale( int w, int h, TQImage::ScaleMode ); virtual void scale( int w, int h, TQImage::ScaleMode );
static int RTTI; static int RTTI;
virtual int rtti() const { return RTTI; } virtual int rtti() const { return RTTI; }
private: protected:
class Private; class Private;
Private *d; Private *d;
}; };
/**
* FaceComponent
*/
class FaceComponent : public ImageComponent
{
public:
FaceComponent(ComponentBase *parent): ImageComponent(parent) {}
FaceComponent(ComponentBase *parent, int minW, int minH): ImageComponent(parent, minH, minW) {}
void setPixmap(const TQPixmap &img, bool adjustSize = true);
void paint(TQPainter *painter, const TQColorGroup &cg);
};
/** /**
* ContactComponent * ContactComponent
*/ */

@ -57,7 +57,7 @@ class MetaContactSelectorWidgetLVI::Private
{ {
public: public:
Kopete::MetaContact *metaContact; Kopete::MetaContact *metaContact;
ImageComponent *metaContactPhoto; FaceComponent *metaContactPhoto;
ImageComponent *metaContactIcon; ImageComponent *metaContactIcon;
DisplayNameComponent *nameText; DisplayNameComponent *nameText;
TextComponent *extraText; TextComponent *extraText;
@ -150,7 +150,7 @@ void MetaContactSelectorWidgetLVI::buildVisualComponents()
Component *imageBox = new BoxComponent( hbox, BoxComponent::Vertical ); Component *imageBox = new BoxComponent( hbox, BoxComponent::Vertical );
new VSpacerComponent( imageBox ); new VSpacerComponent( imageBox );
// include borders in size // include borders in size
d->metaContactPhoto = new ImageComponent( imageBox, d->photoSize + 2 , d->photoSize + 2 ); d->metaContactPhoto = new FaceComponent( imageBox, d->photoSize , d->photoSize );
new VSpacerComponent( imageBox ); new VSpacerComponent( imageBox );
Component *vbox = new BoxComponent( hbox, BoxComponent::Vertical ); Component *vbox = new BoxComponent( hbox, BoxComponent::Vertical );
d->nameText = new DisplayNameComponent( vbox ); d->nameText = new DisplayNameComponent( vbox );

Loading…
Cancel
Save