summaryrefslogtreecommitdiff
path: root/core/launcher
authormickeyl <mickeyl>2005-01-11 17:32:06 (UTC)
committer mickeyl <mickeyl>2005-01-11 17:32:06 (UTC)
commitf8fd8556da5649f54af740a5dbb9a8c1ead2bcfc (patch) (side-by-side diff)
treedb41b30ad733fc476746e1a9c7576a5a083240fa /core/launcher
parentf82173157bdba4fa99afde9cc999bfe9b511ce07 (diff)
downloadopie-f8fd8556da5649f54af740a5dbb9a8c1ead2bcfc.zip
opie-f8fd8556da5649f54af740a5dbb9a8c1ead2bcfc.tar.gz
opie-f8fd8556da5649f54af740a5dbb9a8c1ead2bcfc.tar.bz2
finish per-tab column setting. it now works on the fly and is persistent
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp7
-rw-r--r--core/launcher/launcherview.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 4f81076..4255b44 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -394,48 +394,55 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
int mode;
stream >> mode;
if ( view(id) )
view(id)->setViewMode( (LauncherView::ViewMode)mode );
} else if ( msg == "setTabBackground(QString,int,QString)" ) {
QString id;
stream >> id;
int mode;
stream >> mode;
QString pixmapOrColor;
stream >> pixmapOrColor;
if ( view(id) )
view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor );
if ( id == "Documents" )
docLoadingWidget->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor );
} else if ( msg == "setTextColor(QString,QString)" ) {
QString id;
stream >> id;
QString color;
stream >> color;
if ( view(id) )
view(id)->setTextColor( QColor(color) );
if ( id == "Documents" )
docLoadingWidget->setTextColor( QColor(color) );
+ } else if ( msg == "setIconColumns(QString,int)" ) {
+ QString id;
+ stream >> id;
+ int number;
+ stream >> number;
+ if ( view(id ) )
+ view(id)->setColNumber( number );
} else if ( msg == "setFont(QString,QString,int,int,int)" ) {
QString id;
stream >> id;
QString fam;
stream >> fam;
int size;
stream >> size;
int weight;
stream >> weight;
int italic;
stream >> italic;
if ( view(id) ) {
if ( !fam.isEmpty() ) {
view(id)->setViewFont( QFont(fam, size, weight, italic!=0) );
odebug << "setFont: " << fam << ", " << size << ", " << weight << ", " << italic << "" << oendl;
} else {
view(id)->clearViewFont();
}
}
}else if ( msg == "setBusyIndicatorType(QString)" ) {
QString type;
stream >> type;
setBusyIndicatorType( type );
}else if ( msg == "home()" ) {
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
@@ -618,49 +618,49 @@ 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;