summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog1
-rw-r--r--core/launcher/launcher.cpp1
-rw-r--r--core/launcher/launcherview.cpp38
-rw-r--r--core/launcher/launcherview.h5
4 files changed, 32 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 8847714..fdaaa25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
1 2005-??-??Opie 1.2.0 1 2005-??-??Opie 1.2.0
2 2
3 New Features 3 New Features
4 ------------ 4 ------------
5 * Number of icon columns in Launcher is customizable through Launcher.conf (hrw,zecke,mickeyl)
5 6
6 Fixed Bugs 7 Fixed Bugs
7 ---------- 8 ----------
8 * #1501 - Fixed bug in todo sql backend (eilers) 9 * #1501 - Fixed bug in todo sql backend (eilers)
9 * n.a - Removed hard coded font sizes in a couple of inputmethods (mickeyl) 10 * n.a - Removed hard coded font sizes in a couple of inputmethods (mickeyl)
10 11
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 970b8cb..4f81076 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -286,12 +286,13 @@ void LauncherTabWidget::setTabViewAppearance( LauncherView *v, Config &cfg )
286 if ( textCol.isEmpty() ) 286 if ( textCol.isEmpty() )
287 v->setTextColor( QColor() ); 287 v->setTextColor( QColor() );
288 else 288 else
289 v->setTextColor( QColor(textCol) ); 289 v->setTextColor( QColor(textCol) );
290// bool customFont = cfg.readBoolEntry( "CustomFont", FALSE ); 290// bool customFont = cfg.readBoolEntry( "CustomFont", FALSE );
291 291
292 v->setColNumber( cfg.readNumEntry( "Columns", 0 ) );
292 293
293 QStringList font = cfg.readListEntry( "Font", ',' ); 294 QStringList font = cfg.readListEntry( "Font", ',' );
294 if ( font.count() == 4 ) 295 if ( font.count() == 4 )
295 v->setViewFont( QFont(font[0], font[1].toInt(), font[2].toInt(), font[3].toInt()!=0) ); 296 v->setViewFont( QFont(font[0], font[1].toInt(), font[2].toInt(), font[3].toInt()!=0) );
296 297
297 // ### FIXME TabColor TabTextColor 298 // ### FIXME TabColor TabTextColor
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index dc4c57f..9d78c0d 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -19,12 +19,13 @@
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "launcherview.h" 21#include "launcherview.h"
22 22
23/* OPIE */ 23/* OPIE */
24#include <opie2/odebug.h> 24#include <opie2/odebug.h>
25#include <qpe/config.h>
25#include <qtopia/qpeapplication.h> 26#include <qtopia/qpeapplication.h>
26#include <qtopia/private/categories.h> 27#include <qtopia/private/categories.h>
27#include <qtopia/categoryselect.h> 28#include <qtopia/categoryselect.h>
28#include <qtopia/mimetype.h> 29#include <qtopia/mimetype.h>
29#include <qtopia/resource.h> 30#include <qtopia/resource.h>
30using namespace Opie::Core; 31using namespace Opie::Core;
@@ -279,13 +280,13 @@ void LauncherItem::setEyePixmap(const QPixmap&aIcon)
279// Implemantation of LauncherIconview start 280// Implemantation of LauncherIconview start
280//=========================================================================== 281//===========================================================================
281 282
282QMap<QString,QPixmap>* LauncherIconView::sm_EyeCache=0; 283QMap<QString,QPixmap>* LauncherIconView::sm_EyeCache=0;
283 284
284LauncherIconView::LauncherIconView( QWidget* parent, const char* name ) 285LauncherIconView::LauncherIconView( QWidget* parent, const char* name )
285 : QIconView(parent,name),tf(""),cf(0),bsy(0),busyTimer(0),bigIcns(TRUE),bgColor(white) 286 : QIconView(parent,name),tf(""),cf(0),bsy(0),busyTimer(0),bigIcns(TRUE),bgColor(white),numColumns(0)
286{ 287{
287 m_EyeCallBack = 0; 288 m_EyeCallBack = 0;
288 if (!sm_EyeCache) sm_EyeCache = new QMap<QString,QPixmap>(); 289 if (!sm_EyeCache) sm_EyeCache = new QMap<QString,QPixmap>();
289 sortmeth = Name; 290 sortmeth = Name;
290 hidden.setAutoDelete(TRUE); 291 hidden.setAutoDelete(TRUE);
291 ike = FALSE; 292 ike = FALSE;
@@ -622,28 +623,28 @@ void LauncherIconView::setBusyIndicatorType ( BusyIndicatorType t ) { busyType =
622 623
623void LauncherIconView::calculateGrid( ItemTextPos pos ) 624void LauncherIconView::calculateGrid( ItemTextPos pos )
624{ 625{
625 int dw = QApplication::desktop()->width(); 626 int dw = QApplication::desktop()->width();
626 int viewerWidth = dw-style().scrollBarExtent().width(); 627 int viewerWidth = dw-style().scrollBarExtent().width();
627 if ( pos == Bottom ) { 628 if ( pos == Bottom ) {
628 int cols = 3; 629 if( !numColumns ) {
629 if ( viewerWidth <= 200 ) 630 if ( viewerWidth <= 200 ) numColumns = 2;
630 cols = 2; 631 else if ( viewerWidth >= 400 ) numColumns = viewerWidth/96;
631 else if ( viewerWidth >= 400 ) 632 else numColumns = 3;
632 cols = viewerWidth/96; 633 }
633 setSpacing( 4 ); 634 setSpacing( 4 );
634 setGridX( (viewerWidth-(cols+1)*spacing())/cols ); 635 setGridX( (viewerWidth-(numColumns+1)*spacing())/numColumns );
635 setGridY( fontMetrics().height()*2+24 ); 636 setGridY( fontMetrics().height()*2+24 );
636 } else { 637 } else {
637 int cols = 2; 638 if( !numColumns ) {
638 if ( viewerWidth < 150 ) 639 if ( viewerWidth < 150 ) numColumns = 1;
639 cols = 1; 640 else if ( viewerWidth >= 400 ) numColumns = viewerWidth/150;
640 else if ( viewerWidth >= 400 ) 641 else numColumns = 2;
641 cols = viewerWidth/150; 642 }
642 setSpacing( 2 ); 643 setSpacing( 2 );
643 setGridX( (viewerWidth-(cols+1)*spacing())/cols ); 644 setGridX( (viewerWidth-(numColumns+1)*spacing())/numColumns );
644 setGridY( fontMetrics().height()+2 ); 645 setGridY( fontMetrics().height()+2 );
645 } 646 }
646} 647}
647 648
648void LauncherIconView::styleChange( QStyle &old ) 649void LauncherIconView::styleChange( QStyle &old )
649{ 650{
@@ -1000,12 +1001,23 @@ void LauncherView::setBackgroundType( BackgroundType t, const QString &val )
1000 bgType = t; 1001 bgType = t;
1001 icons->viewport()->update(); 1002 icons->viewport()->update();
1002 1003
1003 QTimer::singleShot( 1000, this, SLOT(flushBgCache()) ); 1004 QTimer::singleShot( 1000, this, SLOT(flushBgCache()) );
1004} 1005}
1005 1006
1007void LauncherView::setColNumber( int num )
1008{
1009 icons->setColNumber( num );
1010}
1011
1012void LauncherIconView::setColNumber( int num )
1013{
1014 numColumns = num;
1015 calculateGrid( Bottom );
1016}
1017
1006void LauncherView::setTextColor( const QColor &tc ) 1018void LauncherView::setTextColor( const QColor &tc )
1007{ 1019{
1008 textCol = tc; 1020 textCol = tc;
1009 QColorGroup cg = icons->colorGroup(); 1021 QColorGroup cg = icons->colorGroup();
1010 cg.setColor( QColorGroup::Text, tc ); 1022 cg.setColor( QColorGroup::Text, tc );
1011 icons->setPalette( QPalette(cg,cg,cg) ); 1023 icons->setPalette( QPalette(cg,cg,cg) );
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h
index 05073ab..e2869eb 100644
--- a/core/launcher/launcherview.h
+++ b/core/launcher/launcherview.h
@@ -79,12 +79,14 @@ public:
79 79
80 void setTextColor( const QColor & ); 80 void setTextColor( const QColor & );
81 QColor textColor() const { return textCol; } 81 QColor textColor() const { return textCol; }
82 82
83 void setViewFont( const QFont & ); 83 void setViewFont( const QFont & );
84 void clearViewFont(); 84 void clearViewFont();
85
86 void setColNumber( int );
85 87
86 void relayout(void); 88 void relayout(void);
87 89
88signals: 90signals:
89 void clicked( const AppLnk * ); 91 void clicked( const AppLnk * );
90 void rightPressed( AppLnk * ); 92 void rightPressed( AppLnk * );
@@ -193,12 +195,14 @@ public:
193 } 195 }
194 196
195 void setBackgroundColor( const QColor &c ) { 197 void setBackgroundColor( const QColor &c ) {
196 bgColor = c; 198 bgColor = c;
197 } 199 }
198 200
201 void setColNumber( int );
202
199 void drawBackground( QPainter *p, const QRect &r ); 203 void drawBackground( QPainter *p, const QRect &r );
200 void setItemTextPos( ItemTextPos pos ); 204 void setItemTextPos( ItemTextPos pos );
201 void hideOrShowItems(bool resort); 205 void hideOrShowItems(bool resort);
202 206
203 void setTypeFilter(const QString& typefilter, bool resort); 207 void setTypeFilter(const QString& typefilter, bool resort);
204 void setCategoryFilter( int catfilter, bool resort ); 208 void setCategoryFilter( int catfilter, bool resort );
@@ -242,9 +246,10 @@ private:
242 LauncherThumbReceiver*m_EyeCallBack; 246 LauncherThumbReceiver*m_EyeCallBack;
243#ifdef USE_ANIMATED_BUSY_ICON_OVERLAY 247#ifdef USE_ANIMATED_BUSY_ICON_OVERLAY
244 QPixmap busyPix; 248 QPixmap busyPix;
245#endif 249#endif
246 BusyIndicatorType busyType; 250 BusyIndicatorType busyType;
247 QTimer m_eyeTimer; 251 QTimer m_eyeTimer;
252 int numColumns;
248}; 253};
249 254
250#endif // LAUNCHERVIEW_H 255#endif // LAUNCHERVIEW_H