summaryrefslogtreecommitdiff
path: root/core/launcher/launcherview.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/launcherview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 9d78c0d..2b34cc5 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -546,193 +546,193 @@ bool LauncherIconView::removeLink(const QString& linkfile,bool removeCache)
( l->file() == linkfile || dl.isValid() && dl.file() == l->file() ) ) {
if (removeCache) sm_EyeCache->remove(l->file());
delete item;
did = TRUE;
}
item = nextItem;
}
QListIterator<AppLnk> it(hidden);
while ((l=it.current())) {
++it;
if ( l->linkFileKnown() && l->linkFile() == linkfile
|| l->file() == linkfile
|| dl.isValid() && dl.file() == l->file() ) {
hidden.removeRef(l);
did = TRUE;
}
}
return did;
}
void LauncherIconView::addItem(AppLnk* app, bool resort)
{
addCatsAndMimes(app);
if ( (tf.isEmpty() || tf.match(app->type()) >= 0)
&& (cf == 0 || app->categories().contains(cf)
|| cf == -1 && app->categories().count() == 0 ) ) {
addCheckItem(app);
} else {
hidden.append(app);
}
if ( resort ){
sort();
}
}
void LauncherIconView::changeItem(const AppLnk&old,AppLnk*nlink)
{
QString oldfile = old.file();
QString newfile = nlink->file();
if (newfile != oldfile) {
QMap<QString,QPixmap>::Iterator it = sm_EyeCache->find(oldfile);
if (it != sm_EyeCache->end()) {
(*sm_EyeCache)[newfile]=(*it);
}
removeLink(old.linkFile());
} else {
removeLink(old.linkFile(),false);
}
addItem(nlink,false);
}
void LauncherIconView::timerEvent( QTimerEvent *te )
{
if ( te->timerId() == busyTimer ) {
if ( bsy )
bsy->animateIcon();
} else {
QIconView::timerEvent( te );
}
}
void LauncherIconView::setBigIcons( bool bi )
{
sm_EyeCache->clear();
bigIcns = bi;
#ifdef USE_ANIMATED_BUSY_ICON_OVERLAY
busyPix.resize(0,0);
#endif
}
QIconViewItem* LauncherIconView::busyItem() const
{
return bsy;
}
void LauncherIconView::setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; }
void LauncherIconView::calculateGrid( ItemTextPos pos )
{
int dw = QApplication::desktop()->width();
int viewerWidth = dw-style().scrollBarExtent().width();
if ( pos == Bottom ) {
if( !numColumns ) {
if ( viewerWidth <= 200 ) numColumns = 2;
else if ( viewerWidth >= 400 ) numColumns = viewerWidth/96;
else numColumns = 3;
}
setSpacing( 4 );
setGridX( (viewerWidth-(numColumns+1)*spacing())/numColumns );
setGridY( fontMetrics().height()*2+24 );
} else {
if( !numColumns ) {
if ( viewerWidth < 150 ) numColumns = 1;
else if ( viewerWidth >= 400 ) numColumns = viewerWidth/150;
else numColumns = 2;
- }
+ }
setSpacing( 2 );
setGridX( (viewerWidth-(numColumns+1)*spacing())/numColumns );
setGridY( fontMetrics().height()+2 );
}
}
void LauncherIconView::styleChange( QStyle &old )
{
QIconView::styleChange( old );
calculateGrid( itemTextPos() );
}
void LauncherIconView::keyPressEvent(QKeyEvent* e)
{
ike = TRUE;
if ( e->key() == Key_F33 /* OK button */ || e->key() == Key_Space ) {
if ( (e->state() & ShiftButton) )
emit mouseButtonPressed(ShiftButton, currentItem(), QPoint() );
else
returnPressed(currentItem());
}
QIconView::keyPressEvent(e);
ike = FALSE;
}
//===========================================================================
// Implemantation of LauncherIconview end
//===========================================================================
//===========================================================================
LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl )
: QVBox( parent, name, fl )
{
catmb = 0;
icons = new LauncherIconView( this );
setFocusProxy(icons);
QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold );
icons->setItemsMovable( FALSE );
icons->setAutoArrange( TRUE );
icons->setSorting( TRUE );
icons->setFrameStyle( QFrame::NoFrame );
icons->setMargin( 0 );
icons->setSelectionMode( QIconView::NoSelection );
icons->setBackgroundMode( PaletteBase );
icons->setResizeMode( QIconView::Adjust );
vmode = (ViewMode)-1;
setViewMode( Icon );
connect( icons, SIGNAL(mouseButtonClicked(int,QIconViewItem*,const QPoint&)),
SLOT(itemClicked(int,QIconViewItem*)) );
connect( icons, SIGNAL(selectionChanged()),
SLOT(selectionChanged()) );
connect( icons, SIGNAL(returnPressed(QIconViewItem*)),
SLOT(returnPressed(QIconViewItem*)) );
connect( icons, SIGNAL(mouseButtonPressed(int,QIconViewItem*,const QPoint&)),
SLOT(itemPressed(int,QIconViewItem*)) );
tools = 0;
setBackgroundType( Ruled, QString::null );
}
LauncherView::~LauncherView()
{
if ( bgCache && bgCache->contains( bgName ) )
(*bgCache)[bgName]->ref--;
}
bool LauncherView::bsy=FALSE;
void LauncherView::setBusy(bool on)
{
icons->setBusy(on);
}
void LauncherView::setBusyIndicatorType( const QString& type ) {
if ( type. lower ( ) == "animated" )
icons->setBusyIndicatorType( BIT_Animated ) ;
else
icons->setBusyIndicatorType( BIT_Normal ) ;
}
void LauncherView::hideIcons()
{
icons->hide();
}
void LauncherView::setToolsEnabled(bool y)
{
if ( !y != !tools ) {
if ( y ) {
tools = new QHBox(this);
// Type filter