diff options
| author | 2007-01-16 01:28:40 +0000 | |
|---|---|---|
| committer | 2007-01-16 01:28:40 +0000 | |
| commit | f82d9bed8be9d4374dc219def31b6a516687db48 (patch) | |
| tree | b30fba3a355ecf15b1c6fdc6ad9e41bccee4ddb2 /src/modules/theme/managementdialog.cpp | |
| parent | *AUTOMATICALLY* updated KVI_SOURCES_DATE variable (diff) | |
| download | KVIrc-f82d9bed8be9d4374dc219def31b6a516687db48.tar.gz KVIrc-f82d9bed8be9d4374dc219def31b6a516687db48.tar.bz2 KVIrc-f82d9bed8be9d4374dc219def31b6a516687db48.zip | |
First step in the Qt 4.x port
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@174 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/theme/managementdialog.cpp')
| -rw-r--r-- | src/modules/theme/managementdialog.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/modules/theme/managementdialog.cpp b/src/modules/theme/managementdialog.cpp index 3f96ab13b..c066da522 100644 --- a/src/modules/theme/managementdialog.cpp +++ b/src/modules/theme/managementdialog.cpp @@ -69,6 +69,7 @@ #include "kvi_packagefile.h" #include "kvi_fileextensions.h" #include "kvi_filedialog.h" +#include "kvi_dynamictooltip.h" #include <stdlib.h> // rand & srand @@ -116,7 +117,7 @@ KviThemeListBoxItem::~KviThemeListBoxItem() delete m_pText; } -void KviThemeListBoxItem::paint ( QPainter * p ) +void KviThemeListBoxItem::paint(QPainter * p) { QListBoxText::paint(p); p->drawPixmap(LVI_BORDER,LVI_BORDER, *(g_pIconManager->getBigIcon(QString(KVI_BIGICON_THEME))) ); @@ -126,7 +127,7 @@ void KviThemeListBoxItem::paint ( QPainter * p ) m_pText->draw(p,afterIcon,LVI_BORDER,QRect(afterIcon,LVI_BORDER,www,p->window().height() - (LVI_BORDER * 2)),listBox()->viewport()->colorGroup()); } -int KviThemeListBoxItem::height ( const QListBox * lb ) const +int KviThemeListBoxItem::height(const QListBox * lb) const { int iHeight = m_pText->height() + (2 * LVI_BORDER); if(iHeight < (LVI_ICON_SIZE + (2 * LVI_BORDER)))iHeight = LVI_ICON_SIZE + (2 * LVI_BORDER); @@ -205,6 +206,8 @@ KviThemeManagementDialog::KviThemeManagementDialog(QWidget * parent) connect(m_pListBox,SIGNAL(selectionChanged()),this,SLOT(enableDisableButtons())); g->addMultiCellWidget(m_pListBox,1,1,0,1); + KviDynamicToolTip * tip = new KviDynamicToolTip(m_pListBox); + connect(tip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); QPushButton * b = new QPushButton(__tr2qs("Close"),this); connect(b,SIGNAL(clicked()),this,SLOT(closeClicked())); @@ -238,6 +241,29 @@ void KviThemeManagementDialog::closeClicked() m_pInstance = 0; } +void KviThemeManagementDialog::tipRequest(KviDynamicToolTip *pTip,const QPoint &pnt) +{ + KviThemeListBoxItem * it = (KviThemeListBoxItem *)(m_pListBox->itemAt(pnt)); + if(!it)return; + KviThemeInfo * pThemeInfo = it->themeInfo(); + + QString szThemeDescription; + KviThemeFunctions::getThemeHtmlDescription( + szThemeDescription, + pThemeInfo->name(), + pThemeInfo->version(), + pThemeInfo->description(), + pThemeInfo->subdirectory(), + pThemeInfo->application(), + pThemeInfo->author(), + pThemeInfo->date(), + pThemeInfo->themeEngineVersion(), + pThemeInfo->mediumScreenshot(), + 0 + ); + + pTip->tip(m_pListBox->itemRect(it),szThemeDescription); +} void KviThemeManagementDialog::display() { |
