~ubuntu-branches/ubuntu/lucid/kdebase/lucid-updates

« back to all changes in this revision

Viewing changes to apps/plasma/applets/folderview/iconview.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2009-07-31 17:52:40 UTC
  • mfrom: (1.1.31 upstream)
  • Revision ID: james.westby@ubuntu.com-20090731175240-vlmkqfc53k597soz
Tags: 4:4.3.0-0ubuntu1
* New upstream release
* Remove kubuntu_17_startup_notification.diff, applied upstream
* Add kubuntu_17_abort_string.diff, Closes LP: #389751

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
      m_flow(layoutDirection() == Qt::LeftToRight ? LeftToRight : RightToLeft),
83
83
      m_popupCausedWidget(0),
84
84
      m_dropOperation(0),
85
 
      m_dropActions(0)
 
85
      m_dropActions(0),
 
86
      m_editorProxy(0)
86
87
{
87
88
    setAcceptHoverEvents(true);
88
89
    setAcceptDrops(true);
90
91
    setFocusPolicy(Qt::StrongFocus);
91
92
 
92
93
    m_scrollBar->hide();
 
94
    connect(m_scrollBar, SIGNAL(valueChanged(int)), SLOT(repositionWidgetsManually()));
93
95
 
94
96
    int size = style()->pixelMetric(QStyle::PM_LargeIconSize);
95
97
    m_iconSize = QSize(size, size);
1172
1174
    QWidget *editor = m_delegate->createEditor(0, option, index);
1173
1175
    editor->setAttribute(Qt::WA_NoSystemBackground);
1174
1176
    editor->installEventFilter(m_delegate);
1175
 
 
1176
 
    QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
1177
 
    proxy->setWidget(editor);
1178
 
 
1179
1177
    m_delegate->updateEditorGeometry(editor, option, index);
 
1178
 
 
1179
    m_editorProxy = new QGraphicsProxyWidget(this);
 
1180
    m_editorProxy->setWidget(editor);
 
1181
    m_editorProxy->setPos(mapFromViewport(editor->pos()));
 
1182
 
1180
1183
    m_delegate->setEditorData(editor, index);
1181
1184
 
1182
1185
    editor->show();
1263
1266
    }
1264
1267
}
1265
1268
 
 
1269
void IconView::repositionWidgetsManually()
 
1270
{
 
1271
    if (m_editorProxy) {
 
1272
        QWidget *editor = m_editorProxy->widget();
 
1273
        QModelIndex index = m_selectionModel->currentIndex();
 
1274
        const QRect rect = visualRect(index);
 
1275
        QStyleOptionViewItemV4 option = viewOptions();
 
1276
        option.rect = rect;
 
1277
        m_delegate->updateEditorGeometry(editor, option, index);
 
1278
        m_editorProxy->setPos(mapFromViewport(editor->pos()));
 
1279
    }
 
1280
}
 
1281
 
1266
1282
void IconView::focusInEvent(QFocusEvent *event)
1267
1283
{
1268
1284
    Q_UNUSED(event)