summaryrefslogtreecommitdiff
path: root/core
authormickeyl <mickeyl>2005-02-17 14:26:43 (UTC)
committer mickeyl <mickeyl>2005-02-17 14:26:43 (UTC)
commitfaaa7b79330fe3c5647182fafdb2bb584dc70638 (patch) (side-by-side diff)
treeffa63faf248cf20f363b80b579855b124d34032f /core
parent766ac02e5586cd67b75b320fe1abee513384860c (diff)
downloadopie-faaa7b79330fe3c5647182fafdb2bb584dc70638.zip
opie-faaa7b79330fe3c5647182fafdb2bb584dc70638.tar.gz
opie-faaa7b79330fe3c5647182fafdb2bb584dc70638.tar.bz2
The response to the static background pixmap was overwhelmingly positive, hence:
* fix static background pixmap also for tiled pixmaps * make it customizable via LauncherSettings * enable it per default
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp8
-rw-r--r--core/launcher/launcherview.cpp28
-rw-r--r--core/launcher/launcherview.h3
-rw-r--r--core/settings/launcher/tabssettings.cpp13
-rw-r--r--core/settings/launcher/tabssettings.h2
5 files changed, 41 insertions, 13 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 4255b44..4ec5f4c 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -447,24 +447,32 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
setBusyIndicatorType( type );
}else if ( msg == "home()" ) {
if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) {
if (categoryBar)
categoryBar->nextTab();
}else {
static_cast<QWidget*>(parent())->raise();
}
} else if (msg=="doctabEnabled(int)") {
int id; stream >> id;
odebug << "Doctab enabled " << id << oendl;
reCheckDoctab(id);
+ } else if ( msg == "setStaticBackground(bool)" ) {
+ int set; stream >> set;
+ odebug << "setStaticBackground " << set << oendl;
+ for (int i = 0; i < categoryBar->count(); i++ )
+ {
+ LauncherView* view = static_cast<LauncherTab*>( categoryBar->tab(i) )->view;
+ view->iconView()->setStaticBackgroundPicture( set );
+ }
}
}
void LauncherTabWidget::reCheckDoctab(int how)
{
if ((bool)how == docTabEnabled) {
/* nothing to do */
return;
}
if (docLoadingWidget) {
stack->removeWidget(docLoadingWidget);
delete docLoadingWidget;
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index e7229ee..a4c7561 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -285,45 +285,55 @@ QMap<QString,QPixmap>* LauncherIconView::sm_EyeCache=0;
LauncherIconView::LauncherIconView( QWidget* parent, const char* name )
: QIconView(parent,name),tf(""),cf(0),bsy(0),busyTimer(0),bigIcns(TRUE),bgColor(white),numColumns(0)
{
m_EyeCallBack = 0;
if (!sm_EyeCache) sm_EyeCache = new QMap<QString,QPixmap>();
sortmeth = Name;
hidden.setAutoDelete(TRUE);
ike = FALSE;
calculateGrid( Bottom );
connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer()));
Config config( "Launcher" );
config.setGroup( "GUI" );
- staticBackground = config.readEntry( "StaticBackground", false );
- if ( staticBackground )
- {
- setStaticBackground( true );
- verticalScrollBar()->setTracking( false );
- }
+ setStaticBackgroundPicture( config.readBoolEntry( "StaticBackground", true ) );
}
LauncherIconView::~LauncherIconView()
{
odebug << "LauncherIconView::~LauncherIconView()" << oendl;
#if 0 // debuggery
QListIterator<AppLnk> it(hidden);
AppLnk* l;
while ((l=it.current())) {
++it;
//odebug << "" << l << ": hidden (should remove)" << oendl;
}
#endif
}
+void LauncherIconView::setStaticBackgroundPicture( bool enable )
+{
+ staticBackground = enable;
+ if ( staticBackground )
+ {
+ setStaticBackground( true );
+ verticalScrollBar()->setTracking( false );
+ }
+ else
+ {
+ setStaticBackground( false );
+ verticalScrollBar()->setTracking( true );
+ }
+}
+
int LauncherIconView::compare(const AppLnk* a, const AppLnk* b)
{
switch (sortmeth) {
case Name:
return a->name().lower().compare(b->name().lower());
case Date: {
QFileInfo fa(a->linkFileKnown() ? a->linkFile() : a->file());
QFileInfo fb(b->linkFileKnown() ? b->linkFile() : b->file());
return fa.lastModified().secsTo(fb.lastModified());
}
case Type:
return a->type().compare(b->type());
@@ -361,30 +371,30 @@ void LauncherIconView::setItemTextPos( ItemTextPos pos )
}
void LauncherIconView::drawBackground( QPainter *p, const QRect &r )
{
if ( bgPixmap.isNull() )
{
p->fillRect( r, bgColor );
}
else
{
if ( staticBackground )
{
- p->drawPixmap( r.x(), r.y(), bgPixmap, r.x(), r.y(), r.width(), r.height() );
+ p->drawTiledPixmap( r, bgPixmap, QPoint( r.x() % bgPixmap.width(), r.y() % bgPixmap.height() ) );
}
else
{
- p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(),
- (r.y() + contentsY()) % bgPixmap.height() ) );
+ p->drawTiledPixmap( r, bgPixmap, QPoint( (r.x() + contentsX()) % bgPixmap.width(),
+ (r.y() + contentsY()) % bgPixmap.height() ) );
}
}
}
void LauncherIconView::addCatsAndMimes(AppLnk* app)
{
// QStringList c = app->categories();
// for (QStringList::ConstIterator cit=c.begin(); cit!=c.end(); ++cit) {
// cats.replace(*cit,(void*)1);
// }
QString maj=app->type();
int sl=maj.find('/');
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h
index 97b1dea..6a2d197 100644
--- a/core/launcher/launcherview.h
+++ b/core/launcher/launcherview.h
@@ -73,26 +73,26 @@ public:
enum BackgroundType { Ruled, SolidColor, Image };
void setBackgroundType( BackgroundType t, const QString & );
BackgroundType backgroundType() const { return bgType; }
void setTextColor( const QColor & );
QColor textColor() const { return textCol; }
void setViewFont( const QFont & );
void clearViewFont();
void setColNumber( int );
-
void relayout(void);
+ LauncherIconView* iconView() { return icons; };
signals:
void clicked( const AppLnk * );
void rightPressed( AppLnk * );
protected slots:
void selectionChanged();
void returnPressed( QIconViewItem *item );
void itemClicked( int, QIconViewItem * );
void itemPressed( int, QIconViewItem * );
void sortBy(int);
void showType(int);
@@ -160,24 +160,25 @@ class LauncherIconView : public QIconView {
Q_OBJECT
public:
LauncherIconView( QWidget* parent, const char* name=0 );
~LauncherIconView();
QIconViewItem* busyItem() const;
#ifdef USE_ANIMATED_BUSY_ICON_OVERLAY
QPixmap busyPixmap() const { return busyPix; }
#endif
void setBigIcons( bool bi );
void updateCategoriesAndMimeTypes();
void setBusyIndicatorType ( BusyIndicatorType t );
+ void setStaticBackgroundPicture( bool enable );
void doAutoScroll()
{
// We don't want rubberbanding (yet)
}
void setBusy(bool on);
bool inKeyEvent() const { return ike; }
void addItem(AppLnk* app, bool resort=TRUE);
bool removeLink(const QString& linkfile,bool removeCache = true);
void changeItem(const AppLnk&old,AppLnk*nlink);
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp
index 42f0568..fca6b20 100644
--- a/core/settings/launcher/tabssettings.cpp
+++ b/core/settings/launcher/tabssettings.cpp
@@ -74,36 +74,40 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name )
p3 = new QPushButton ( tr( "Delete" ), this );
lay-> addWidget ( p3, 3, 1 );
connect ( p3, SIGNAL( clicked()), this, SLOT( deleteClicked()));
lay-> setRowStretch ( 4, 10 );
m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this );
lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 );
m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this );
lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 );
+
+ m_staticbackground = new QCheckBox( tr( "Enable static background pixmap" ), this );
+ lay->addMultiCellWidget( m_staticbackground, 7, 7, 0, 1 );
p1-> setEnabled ( false );
p3-> setEnabled ( false );
init ( );
QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." ));
QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." ));
QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." ));
QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." ));
QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." ));
QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." ));
+ QWhatsThis::add ( m_staticbackground, tr( "Activate this, if you want the background pixmap not to scroll with the icons." ));
}
void TabsSettings::init ( )
{
AppLnkSet rootFolder( MimeType::appsFolderName ( ));
QStringList types = rootFolder. types ( );
m_list-> insertItem ( tr( "All Tabs" ));
m_ids << GLOBALID;
for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) {
m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it ));
@@ -113,24 +117,25 @@ void TabsSettings::init ( )
QPixmap pix;
pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( ));
m_list-> insertItem ( pix, tr( "Documents" ));
m_ids += "Documents"; // No tr
Config cfg ( "Launcher" );
readTabSettings ( cfg );
cfg. setGroup ( "GUI" );
m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" );
m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) );
+ m_staticbackground->setChecked( cfg.readBoolEntry( "StaticBackground", true ) );
}
void TabsSettings::readTabSettings ( Config &cfg )
{
QString grp ( "Tab %1" ); // No tr
m_tabs. clear ( );
TabConfig global_def;
global_def. m_view = TabConfig::Icon;
global_def. m_bg_type = TabConfig::Ruled;
global_def. m_bg_image = "launcher/opie-background";
@@ -270,31 +275,35 @@ void TabsSettings::accept ( )
QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" );
fe << *it;
fe << ( tc. m_font_use ? tc. m_font_family : QString::null );
fe << tc. m_font_size;
fe << tc. m_font_weight;
fe << ( tc. m_font_italic ? 1 : 0 );
tc. m_changed = false;
}
cfg. setGroup ( "GUI" );
QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" );
cfg. writeEntry ( "BusyType", busytype );
-
- cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) );
+ cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) );
+ cfg. writeEntry ( "StaticBackground", m_staticbackground->isChecked( ) );
{
QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" );
e << busytype;
}
+ {
+ QCopEnvelope e ( "QPE/Launcher", "setStaticBackground(bool)" );
+ e << m_staticbackground->isChecked();
+ }
}
void TabsSettings::newClicked ( )
{
QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
}
void TabsSettings::deleteClicked ( )
{
int ind = m_list-> currentItem ( );
if ( ind < 0 )
diff --git a/core/settings/launcher/tabssettings.h b/core/settings/launcher/tabssettings.h
index 600c65c..bbe1e72 100644
--- a/core/settings/launcher/tabssettings.h
+++ b/core/settings/launcher/tabssettings.h
@@ -50,19 +50,19 @@ protected slots:
void deleteClicked ( );
void editClicked ( );
protected:
void init ( );
void readTabSettings ( Config & );
private:
QListBox *m_list;
// QString currentTab;
QStringList m_ids;
QMap <QString, TabConfig> m_tabs;
- QCheckBox *m_busyani, *m_bigbusy;
+ QCheckBox *m_busyani, *m_bigbusy, *m_staticbackground;
};
#endif