[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/shells/common/widgetsExplorer
From: Ana CecĂlia Martins <anaceciliamb () gmail ! com>
Date: 2009-09-01 12:34:29
Message-ID: 1251808469.654723.21702.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1018188 by anacmartins:
- Scroll fixed!
- Quick try to prevent a segmentation fault inside tooltip
M +11 -9 appletslist.cpp
M +21 -7 applettooltip.cpp
--- trunk/KDE/kdebase/workspace/plasma/shells/common/widgetsExplorer/appletslist.cpp \
#1018187:1018188 @@ -134,16 +134,18 @@
void AppletsListWidget::resizeEvent(QGraphicsSceneResizeEvent *event)
{
qDebug() << "resize event";
+
static bool guard = false;
if (guard) {
return;
}
+
guard = true;
Q_UNUSED(event);
qDebug() << "resize event 2";
- updateGeometry();
+// updateGeometry();
if (m_orientation == Qt::Horizontal) {
m_appletsListWindowWidget->setMinimumWidth(-1);
@@ -153,7 +155,6 @@
m_appletsListWindowWidget->setMaximumHeight(-1);
}
- manageArrows();
const int height = size().height();
m_appletsListWidget->resize(m_appletsListWidget->size().width(), height);
m_appletsListWindowWidget->resize(m_appletsListWindowWidget->size().width(), \
height); @@ -184,6 +185,7 @@
//if the resize occured with the list widget
if(widget == m_appletsListWidget) {
+ manageArrows();
if (m_orientation == Qt::Horizontal) {
// m_appletsListWindowWidget->setMinimumHeight(resizeEvent->newSize().height());
// m_appletsListWindowWidget->setMaximumHeight(resizeEvent->newSize().height());
@@ -353,9 +355,6 @@
toolTipMoveFrom = m_toolTip->pos();
- //how come?
- // qDebug() << widgetExplorer->containment()->location() << Plasma::LeftEdge << \
Plasma::BottomEdge;
-
if(corona) {
// ********* use this after integrating with plasma *************
toolTipMoveTo = corona->popupPosition(m_toolTip->appletIconWidget(), \
m_toolTip->geometry().size()); @@ -464,6 +463,7 @@
m_appletsListWidget->setLayout(m_appletListLinearLayout);
m_appletListLinearLayout->setSpacing(10);
+ updateGeometry();
resetScroll();
}
@@ -542,14 +542,16 @@
newLastIcon = m_currentAppearingAppletsOnList->at(lastVisibleItemIndex + \
appletsIndexesToSum);
//scroll enough to show the new last icon on the list
+ //and store the list size
if(m_orientation == Qt::Horizontal) {
scrollAmount = (newLastIcon->pos().x() + newLastIcon->size().width()) -
lastVisiblePositionOnList;
- listSize = m_appletListLinearLayout->preferredSize().width();
+ listSize = m_appletsListWidget->size().width();
+
} else {
scrollAmount = (newLastIcon->pos().y() + newLastIcon->size().height()) -
lastVisiblePositionOnList;
- listSize = m_appletListLinearLayout->preferredSize().height();
+ listSize = m_appletsListWidget->size().height();
}
//check if the scrollAmount is more than necessary to reach the end of the list
@@ -706,10 +708,10 @@
if(m_orientation == Qt::Horizontal) {
windowSize = m_appletsListWindowWidget->geometry().width();
- listSize = m_appletListLinearLayout->preferredSize().width();
+ listSize = m_appletsListWidget->size().width();
} else {
windowSize = m_appletsListWindowWidget->geometry().height();
- listSize = m_appletListLinearLayout->preferredSize().height();
+ listSize = m_appletsListWidget->size().height();
}
if(listSize <= windowSize) {
--- trunk/KDE/kdebase/workspace/plasma/shells/common/widgetsExplorer/applettooltip.cpp \
#1018187:1018188 @@ -75,7 +75,11 @@
AppletInfoWidget::AppletInfoWidget(QGraphicsItem *parent, PlasmaAppletItem \
*appletItem) : QGraphicsWidget(parent)
{
- m_appletItem = appletItem;
+ if(appletItem != 0) {
+ m_appletItem = appletItem;
+ } else {
+ m_appletItem = 0;
+ }
init();
}
@@ -147,20 +151,30 @@
void AppletInfoWidget::updateInfo()
{
- if(m_appletItem != 0) {
- m_iconWidget->setIcon(m_appletItem->icon());
- m_nameLabel->setText(m_appletItem->name());
+ if (m_appletItem != 0) {
- m_aboutLabel->setText(
- m_appletItem->description());
+ if (m_iconWidget != 0) {
+ m_iconWidget->setIcon(m_appletItem->icon());
+ }
+ if (m_nameLabel != 0) {
+ m_nameLabel->setText(m_appletItem->name());
+ }
- m_detailsLabel->setText(
+ if (m_aboutLabel != 0) {
+ m_aboutLabel->setText(m_appletItem->description());
+ }
+
+ if (m_detailsLabel != 0) {
+ m_detailsLabel->setText(
i18n("<html><p>Version: %4</p><p>Author: %1 (%2)</p><p>License: \
%3</p></html>")
.arg(m_appletItem->author())
.arg(m_appletItem->email())
.arg(m_appletItem->license())
.arg(m_appletItem->version())
);
+ }
+
+
} else {
m_iconWidget->setIcon("plasma");
m_nameLabel->setText("Unknown applet");
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic