Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/forms/widgets/kexidbimagebox.cpp
Show First 20 Lines • Show All 703 Lines • ▼ Show 20 Line(s) | |||||
704 | } | 704 | } | ||
705 | 705 | | |||
706 | void KexiDBImageBox::updatePixmap() | 706 | void KexiDBImageBox::updatePixmap() | ||
707 | { | 707 | { | ||
708 | if (!(designMode() && pixmap().isNull())) | 708 | if (!(designMode() && pixmap().isNull())) | ||
709 | return; | 709 | return; | ||
710 | 710 | | |||
711 | if (!KexiDBImageBox_static->pixmap) { | 711 | if (!KexiDBImageBox_static->pixmap) { | ||
712 | QPixmap pm( KIconLoader::global()->loadMimeTypeIcon( | 712 | const QIcon icon(KexiIcon("imagebox")); | ||
713 | koIconNameCStr("image-x-generic"), KIconLoader::NoGroup, KIconLoader::SizeLarge, KIconLoader::DisabledState) ); | 713 | KexiDBImageBox_static->pixmap = new QPixmap( | ||
714 | if (!pm.isNull()) { | 714 | icon.pixmap(KIconLoader::SizeLarge, KIconLoader::SizeLarge, QIcon::Disabled)); | ||
715 | KIconEffect::semiTransparent(pm); | 715 | if (!KexiDBImageBox_static->pixmap->isNull()) { | ||
716 | KIconEffect::semiTransparent(pm); | 716 | KIconEffect::semiTransparent(*KexiDBImageBox_static->pixmap); | ||
717 | KIconEffect::semiTransparent(*KexiDBImageBox_static->pixmap); | ||||
717 | } | 718 | } | ||
718 | KexiDBImageBox_static->pixmap = new QPixmap(pm); | | |||
719 | KexiDBImageBox_static->small = new QPixmap( | 719 | KexiDBImageBox_static->small = new QPixmap( | ||
720 | KexiDBImageBox_static->pixmap->scaled( | 720 | icon.pixmap(KIconLoader::SizeSmall, KIconLoader::SizeSmall, QIcon::Disabled)); | ||
721 | KexiDBImageBox_static->pixmap->width() / 2, KexiDBImageBox_static->pixmap->height() / 2, | 721 | if (!KexiDBImageBox_static->small->isNull()) { | ||
722 | Qt::KeepAspectRatio, Qt::SmoothTransformation) ); | 722 | KIconEffect::semiTransparent(*KexiDBImageBox_static->small); // once is enough for small | ||
723 | } | ||||
723 | } | 724 | } | ||
724 | } | 725 | } | ||
725 | 726 | | |||
726 | void KexiDBImageBox::setAlignment(Qt::Alignment alignment) | 727 | void KexiDBImageBox::setAlignment(Qt::Alignment alignment) | ||
727 | { | 728 | { | ||
728 | m_alignment = alignment; | 729 | m_alignment = alignment; | ||
729 | m_currentScaledPixmap = QPixmap(); // clear cache | 730 | m_currentScaledPixmap = QPixmap(); // clear cache | ||
730 | repaint(); | 731 | repaint(); | ||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |