|
|
|
@ -43,7 +43,7 @@ using Tellico::EntryIconView;
|
|
|
|
|
using Tellico::EntryIconViewItem;
|
|
|
|
|
|
|
|
|
|
EntryIconView::EntryIconView(TQWidget* parent_, const char* name_/*=0*/)
|
|
|
|
|
: KIconView(parent_, name_), m_coll(0), m_maxAllowedIconWidth(MAX_ENTRY_ICON_SIZE),
|
|
|
|
|
: TDEIconView(parent_, name_), m_coll(0), m_maxAllowedIconWidth(MAX_ENTRY_ICON_SIZE),
|
|
|
|
|
m_maxIconWidth(MIN_ENTRY_ICON_SIZE), m_maxIconHeight(MIN_ENTRY_ICON_SIZE),
|
|
|
|
|
m_comparison(0) {
|
|
|
|
|
setAutoArrange(true);
|
|
|
|
@ -51,7 +51,7 @@ EntryIconView::EntryIconView(TQWidget* parent_, const char* name_/*=0*/)
|
|
|
|
|
setItemsMovable(false);
|
|
|
|
|
setSelectionMode(TQIconView::Extended);
|
|
|
|
|
setResizeMode(TQIconView::Adjust);
|
|
|
|
|
setMode(KIconView::Select);
|
|
|
|
|
setMode(TDEIconView::Select);
|
|
|
|
|
setSpacing(4);
|
|
|
|
|
// setWordWrapIconText(false);
|
|
|
|
|
|
|
|
|
@ -69,7 +69,7 @@ EntryIconView::~EntryIconView() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EntryIconViewItem* EntryIconView::firstItem() const {
|
|
|
|
|
return static_cast<EntryIconViewItem*>(KIconView::firstItem());
|
|
|
|
|
return static_cast<EntryIconViewItem*>(TDEIconView::firstItem());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EntryIconView::findImageField() {
|
|
|
|
@ -97,9 +97,9 @@ const TQPixmap& EntryIconView::defaultPixmap() {
|
|
|
|
|
if(pix) {
|
|
|
|
|
return *pix;
|
|
|
|
|
}
|
|
|
|
|
KIconLoader* loader = TDEGlobal::instance()->iconLoader();
|
|
|
|
|
TDEIconLoader* loader = TDEGlobal::instance()->iconLoader();
|
|
|
|
|
TQPixmap tmp = loader->loadIcon(TQString::fromLatin1("nocover_") + CollectionFactory::typeName(m_coll->type()),
|
|
|
|
|
KIcon::User, 0, KIcon::DefaultState, 0, true /*canReturnNull */);
|
|
|
|
|
TDEIcon::User, 0, TDEIcon::DefaultState, 0, true /*canReturnNull */);
|
|
|
|
|
if(tmp.isNull()) {
|
|
|
|
|
myLog() << "EntryIconView::defaultPixmap() - null nocover image, loading tellico.png" << endl;
|
|
|
|
|
tmp = UserIcon(TQString::fromLatin1("tellico"));
|
|
|
|
@ -163,7 +163,7 @@ void EntryIconView::refresh() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EntryIconView::clear() {
|
|
|
|
|
KIconView::clear();
|
|
|
|
|
TDEIconView::clear();
|
|
|
|
|
m_coll = 0;
|
|
|
|
|
m_entries.clear();
|
|
|
|
|
m_imageField.truncate(0);
|
|
|
|
@ -171,7 +171,7 @@ void EntryIconView::clear() {
|
|
|
|
|
|
|
|
|
|
void EntryIconView::showEntries(const Data::EntryVec& entries_) {
|
|
|
|
|
setUpdatesEnabled(false);
|
|
|
|
|
KIconView::clear(); // don't call EntryIconView::clear() since that clears the entries_ ref
|
|
|
|
|
TDEIconView::clear(); // don't call EntryIconView::clear() since that clears the entries_ ref
|
|
|
|
|
if(entries_.isEmpty()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -311,7 +311,7 @@ int EntryIconView::compare(const EntryIconViewItem* item1, EntryIconViewItem* it
|
|
|
|
|
/* *********************************************************** */
|
|
|
|
|
|
|
|
|
|
EntryIconViewItem::EntryIconViewItem(EntryIconView* parent_, Data::EntryPtr entry_)
|
|
|
|
|
: KIconViewItem(parent_, entry_->title()), m_entry(entry_), m_usesImage(false) {
|
|
|
|
|
: TDEIconViewItem(parent_, entry_->title()), m_entry(entry_), m_usesImage(false) {
|
|
|
|
|
setDragEnabled(false);
|
|
|
|
|
const TQString& imageField = parent_->imageField();
|
|
|
|
|
if(!imageField.isEmpty()) {
|
|
|
|
@ -344,7 +344,7 @@ void EntryIconViewItem::setSelected(bool s_, bool cb_) {
|
|
|
|
|
}
|
|
|
|
|
if(s_ != isSelected()) {
|
|
|
|
|
view->updateSelected(this, s_);
|
|
|
|
|
KIconViewItem::setSelected(s_, cb_);
|
|
|
|
|
TDEIconViewItem::setSelected(s_, cb_);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -375,7 +375,7 @@ void EntryIconViewItem::update() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EntryIconViewItem::calcRect(const TQString& text_) {
|
|
|
|
|
KIconViewItem::calcRect(text_);
|
|
|
|
|
TDEIconViewItem::calcRect(text_);
|
|
|
|
|
TQRect r = pixmapRect();
|
|
|
|
|
r.rRight() += ENTRY_ICON_SHADOW_RIGHT;
|
|
|
|
|
r.rBottom() += ENTRY_ICON_SHADOW_BOTTOM;
|
|
|
|
@ -404,7 +404,7 @@ void EntryIconViewItem::paintPixmap(TQPainter* p_, const TQColorGroup& cg_) {
|
|
|
|
|
TQColor c = Tellico::blendColors(iconView()->backgroundColor(), TQt::black, 10);
|
|
|
|
|
p_->fillRect(r, c);
|
|
|
|
|
}
|
|
|
|
|
KIconViewItem::paintPixmap(p_, cg_);
|
|
|
|
|
TDEIconViewItem::paintPixmap(p_, cg_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EntryIconViewItem::paintText(TQPainter* p_, const TQColorGroup &cg_) {
|
|
|
|
@ -431,14 +431,14 @@ void EntryIconViewItem::paintText(TQPainter* p_, const TQColorGroup &cg_) {
|
|
|
|
|
TQString EntryIconViewItem::key() const {
|
|
|
|
|
const TQString& sortField = iconView()->sortField();
|
|
|
|
|
if(sortField.isEmpty()) {
|
|
|
|
|
return KIconViewItem::key();
|
|
|
|
|
return TDEIconViewItem::key();
|
|
|
|
|
}
|
|
|
|
|
return m_entry->field(sortField);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int EntryIconViewItem::compare(TQIconViewItem* item_) const {
|
|
|
|
|
int res = iconView()->compare(this, static_cast<EntryIconViewItem*>(item_));
|
|
|
|
|
return res == 0 ? KIconViewItem::compare(item_) : res;
|
|
|
|
|
return res == 0 ? TDEIconViewItem::compare(item_) : res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#include "entryiconview.moc"
|
|
|
|
|