[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/lib/kopainter
From: Adrian Page <adrian () pagenet ! plus ! com>
Date: 2004-07-17 18:10:48
Message-ID: 20040717181048.8FA61126D9 () office ! kde ! org
[Download RAW message or body]
CVS commit by page:
- Keep track of the current item when inserting new sorted items.
- Ensure the selected item is visible.
- Stop the pop-up pixmap viewer from gaining a taskbar entry.
M +9 -13 koIconChooser.cc 1.12
--- koffice/lib/kopainter/koIconChooser.cc #1.11:1.12
@@ -31,5 +31,5 @@
KoPixmapWidget::KoPixmapWidget(const QPixmap &aPixmap, QWidget *parent, const char *name):
-QFrame(parent, name, WStyle_Customize | WStyle_NoBorder)
+QFrame(parent, name, WStyle_Customize | WStyle_NoBorder | WType_Dialog)
{
setFrameStyle(QFrame::WinPanel | QFrame::Raised);
@@ -92,4 +92,5 @@ void KoIconChooser::addItem(KoIconItem *
{
Q_INT32 n = mItemCount;
+ KoIconItem *current = currentItem();
Q_ASSERT(item);
@@ -112,4 +113,5 @@ void KoIconChooser::addItem(KoIconItem *
if (mSort)
{
+ setCurrentItem(current);
updateContents();
}
@@ -164,6 +166,8 @@ void KoIconChooser::setCurrentItem(KoIco
// repaint the old and the new item
- updateCell(oldRow, oldCol);
- updateCell(mCurRow, mCurCol);
+ repaintCell(oldRow, oldCol);
+ repaintCell(mCurRow, mCurCol);
+
+ ensureCellVisible(mCurRow, mCurCol);
}
}
@@ -194,13 +198,5 @@ void KoIconChooser::mousePressEvent(QMou
showFullPixmap(pix, p);
- int oldRow = mCurRow;
- int oldCol = mCurCol;
-
- mCurRow = row;
- mCurCol = col;
-
- updateCell(oldRow, oldCol);
- updateCell(mCurRow, mCurCol);
-
+ setCurrentItem(item);
emit selected( item );
}
@@ -379,5 +375,5 @@ void KoIconChooser::calculateCells()
void KoIconChooser::showFullPixmap(const QPixmap &pix, const QPoint &/*p*/)
{
- mPixmapWidget = new KoPixmapWidget(pix, 0L);
+ mPixmapWidget = new KoPixmapWidget(pix, this);
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic