author | mickeyl <mickeyl> | 2005-02-16 19:20:06 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-02-16 19:20:06 (UTC) |
commit | 5ad21664e5db417a18682903a660f4651c68ff12 (patch) (unidiff) | |
tree | 12fc6b3e45b3575cf71c2b5dd1e26c4592f5381b /core/launcher/launcherview.h | |
parent | 4fc6942eed4abdc0d4b5e1b3460a32852731c7b4 (diff) | |
download | opie-5ad21664e5db417a18682903a660f4651c68ff12.zip opie-5ad21664e5db417a18682903a660f4651c68ff12.tar.gz opie-5ad21664e5db417a18682903a660f4651c68ff12.tar.bz2 |
this patch adds the possibility to have a static (as in non-scrolling) background
in the launcher. major drawback: most of our machines (at least the SA1100
based ones) are too slow to make it flicker free w/ tracking (repainting while
dragging the scrollbar). so i needed to disable tracking for the static background.
it's a hidden setting and disabled per default. please play around with it and
give me your comments. How to enable:
Launcher.conf:
[GUI]
StaticBackground = 1
Diffstat (limited to 'core/launcher/launcherview.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/launcherview.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h index e2869eb..97b1dea 100644 --- a/core/launcher/launcherview.h +++ b/core/launcher/launcherview.h | |||
@@ -16,94 +16,92 @@ | |||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef LAUNCHERVIEW_H | 20 | #ifndef LAUNCHERVIEW_H |
21 | #define LAUNCHERVIEW_H | 21 | #define LAUNCHERVIEW_H |
22 | 22 | ||
23 | #include <qtopia/storage.h> | 23 | #include <qtopia/storage.h> |
24 | #include <qtopia/applnk.h> | 24 | #include <qtopia/applnk.h> |
25 | 25 | ||
26 | #include <qvbox.h> | 26 | #include <qvbox.h> |
27 | #include <qiconview.h> | 27 | #include <qiconview.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qmap.h> | 29 | #include <qmap.h> |
30 | 30 | ||
31 | class CategorySelect; | 31 | class CategorySelect; |
32 | class LauncherIconView; | 32 | class LauncherIconView; |
33 | class LauncherItem; | 33 | class LauncherItem; |
34 | class QIconViewItem; | 34 | class QIconViewItem; |
35 | class QLabel; | 35 | class QLabel; |
36 | class QWidgetStack; | 36 | class QWidgetStack; |
37 | class MenuButton; | 37 | class MenuButton; |
38 | class QComboBox; | 38 | class QComboBox; |
39 | 39 | ||
40 | |||
41 | |||
42 | enum BusyIndicatorType { | 40 | enum BusyIndicatorType { |
43 | BIT_Normal = 0, | 41 | BIT_Normal = 0, |
44 | BIT_Animated | 42 | BIT_Animated |
45 | }; | 43 | }; |
46 | 44 | ||
47 | class LauncherView : public QVBox | 45 | class LauncherView : public QVBox |
48 | { | 46 | { |
49 | Q_OBJECT | 47 | Q_OBJECT |
50 | 48 | ||
51 | public: | 49 | public: |
52 | LauncherView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 50 | LauncherView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
53 | ~LauncherView(); | 51 | ~LauncherView(); |
54 | 52 | ||
55 | void hideIcons(); | 53 | void hideIcons(); |
56 | 54 | ||
57 | bool removeLink(const QString& linkfile); | 55 | bool removeLink(const QString& linkfile); |
58 | void addItem(AppLnk* app, bool resort=TRUE); | 56 | void addItem(AppLnk* app, bool resort=TRUE); |
59 | void changeItem(const AppLnk&old,AppLnk*nlink); | 57 | void changeItem(const AppLnk&old,AppLnk*nlink); |
60 | 58 | ||
61 | void removeAllItems(); | 59 | void removeAllItems(); |
62 | void setSortEnabled(bool); | 60 | void setSortEnabled(bool); |
63 | void setUpdatesEnabled(bool); | 61 | void setUpdatesEnabled(bool); |
64 | void sort(); | 62 | void sort(); |
65 | 63 | ||
66 | void setToolsEnabled(bool); | 64 | void setToolsEnabled(bool); |
67 | void updateTools(); | 65 | void updateTools(); |
68 | 66 | ||
69 | void setBusy(bool); | 67 | void setBusy(bool); |
70 | void setBusyIndicatorType( const QString& ); | 68 | void setBusyIndicatorType( const QString& ); |
71 | 69 | ||
72 | enum ViewMode { Icon, List }; | 70 | enum ViewMode { Icon, List }; |
73 | void setViewMode( ViewMode m ); | 71 | void setViewMode( ViewMode m ); |
74 | ViewMode viewMode() const { return vmode; } | 72 | ViewMode viewMode() const { return vmode; } |
75 | 73 | ||
76 | enum BackgroundType { Ruled, SolidColor, Image }; | 74 | enum BackgroundType { Ruled, SolidColor, Image }; |
77 | void setBackgroundType( BackgroundType t, const QString & ); | 75 | void setBackgroundType( BackgroundType t, const QString & ); |
78 | BackgroundType backgroundType() const { return bgType; } | 76 | BackgroundType backgroundType() const { return bgType; } |
79 | 77 | ||
80 | void setTextColor( const QColor & ); | 78 | void setTextColor( const QColor & ); |
81 | QColor textColor() const { return textCol; } | 79 | QColor textColor() const { return textCol; } |
82 | 80 | ||
83 | void setViewFont( const QFont & ); | 81 | void setViewFont( const QFont & ); |
84 | void clearViewFont(); | 82 | void clearViewFont(); |
85 | 83 | ||
86 | void setColNumber( int ); | 84 | void setColNumber( int ); |
87 | 85 | ||
88 | void relayout(void); | 86 | void relayout(void); |
89 | 87 | ||
90 | signals: | 88 | signals: |
91 | void clicked( const AppLnk * ); | 89 | void clicked( const AppLnk * ); |
92 | void rightPressed( AppLnk * ); | 90 | void rightPressed( AppLnk * ); |
93 | 91 | ||
94 | protected slots: | 92 | protected slots: |
95 | void selectionChanged(); | 93 | void selectionChanged(); |
96 | void returnPressed( QIconViewItem *item ); | 94 | void returnPressed( QIconViewItem *item ); |
97 | void itemClicked( int, QIconViewItem * ); | 95 | void itemClicked( int, QIconViewItem * ); |
98 | void itemPressed( int, QIconViewItem * ); | 96 | void itemPressed( int, QIconViewItem * ); |
99 | void sortBy(int); | 97 | void sortBy(int); |
100 | void showType(int); | 98 | void showType(int); |
101 | void showCategory( int ); | 99 | void showCategory( int ); |
102 | void resizeEvent(QResizeEvent *); | 100 | void resizeEvent(QResizeEvent *); |
103 | void flushBgCache(); | 101 | void flushBgCache(); |
104 | 102 | ||
105 | protected: | 103 | protected: |
106 | void paletteChange( const QPalette & ); | 104 | void paletteChange( const QPalette & ); |
107 | 105 | ||
108 | void fontChanged(const QFont &); | 106 | void fontChanged(const QFont &); |
109 | 107 | ||
@@ -178,49 +176,49 @@ public: | |||
178 | 176 | ||
179 | void setBusy(bool on); | 177 | void setBusy(bool on); |
180 | bool inKeyEvent() const { return ike; } | 178 | bool inKeyEvent() const { return ike; } |
181 | 179 | ||
182 | void addItem(AppLnk* app, bool resort=TRUE); | 180 | void addItem(AppLnk* app, bool resort=TRUE); |
183 | bool removeLink(const QString& linkfile,bool removeCache = true); | 181 | bool removeLink(const QString& linkfile,bool removeCache = true); |
184 | void changeItem(const AppLnk&old,AppLnk*nlink); | 182 | void changeItem(const AppLnk&old,AppLnk*nlink); |
185 | 183 | ||
186 | QStringList mimeTypes() const; | 184 | QStringList mimeTypes() const; |
187 | QStringList categories() const; | 185 | QStringList categories() const; |
188 | void clear(); | 186 | void clear(); |
189 | void addCatsAndMimes(AppLnk* app); | 187 | void addCatsAndMimes(AppLnk* app); |
190 | 188 | ||
191 | void setBackgroundOrigin( QWidget::BackgroundOrigin ) {} | 189 | void setBackgroundOrigin( QWidget::BackgroundOrigin ) {} |
192 | 190 | ||
193 | void setBackgroundPixmap( const QPixmap &pm ) { | 191 | void setBackgroundPixmap( const QPixmap &pm ) { |
194 | bgPixmap = pm; | 192 | bgPixmap = pm; |
195 | } | 193 | } |
196 | 194 | ||
197 | void setBackgroundColor( const QColor &c ) { | 195 | void setBackgroundColor( const QColor &c ) { |
198 | bgColor = c; | 196 | bgColor = c; |
199 | } | 197 | } |
200 | 198 | ||
201 | void setColNumber( int ); | 199 | void setColNumber( int ); |
202 | 200 | ||
203 | void drawBackground( QPainter *p, const QRect &r ); | 201 | void drawBackground( QPainter *p, const QRect &r ); |
204 | void setItemTextPos( ItemTextPos pos ); | 202 | void setItemTextPos( ItemTextPos pos ); |
205 | void hideOrShowItems(bool resort); | 203 | void hideOrShowItems(bool resort); |
206 | 204 | ||
207 | void setTypeFilter(const QString& typefilter, bool resort); | 205 | void setTypeFilter(const QString& typefilter, bool resort); |
208 | void setCategoryFilter( int catfilter, bool resort ); | 206 | void setCategoryFilter( int catfilter, bool resort ); |
209 | 207 | ||
210 | enum SortMethod { Name, Date, Type }; | 208 | enum SortMethod { Name, Date, Type }; |
211 | 209 | ||
212 | void setSortMethod( SortMethod m ); | 210 | void setSortMethod( SortMethod m ); |
213 | int compare(const AppLnk* a, const AppLnk* b); | 211 | int compare(const AppLnk* a, const AppLnk* b); |
214 | void requestEyePix(const LauncherItem*which); | 212 | void requestEyePix(const LauncherItem*which); |
215 | 213 | ||
216 | static QMap<QString,QPixmap>* sm_EyeCache; | 214 | static QMap<QString,QPixmap>* sm_EyeCache; |
217 | 215 | ||
218 | protected: | 216 | protected: |
219 | virtual void timerEvent( QTimerEvent *te ); | 217 | virtual void timerEvent( QTimerEvent *te ); |
220 | void styleChange( QStyle &old ); | 218 | void styleChange( QStyle &old ); |
221 | void calculateGrid( ItemTextPos pos ); | 219 | void calculateGrid( ItemTextPos pos ); |
222 | void focusInEvent( QFocusEvent * ) {} | 220 | void focusInEvent( QFocusEvent * ) {} |
223 | void focusOutEvent( QFocusEvent * ) {} | 221 | void focusOutEvent( QFocusEvent * ) {} |
224 | LauncherItem*findDocItem(const QString&); | 222 | LauncherItem*findDocItem(const QString&); |
225 | void addCheckItem(AppLnk* app); | 223 | void addCheckItem(AppLnk* app); |
226 | void checkCallback(); | 224 | void checkCallback(); |
@@ -229,27 +227,28 @@ protected: | |||
229 | protected slots: | 227 | protected slots: |
230 | void setEyePixmap(const QPixmap&,const QString&,int width); | 228 | void setEyePixmap(const QPixmap&,const QString&,int width); |
231 | void stopEyeTimer(); | 229 | void stopEyeTimer(); |
232 | 230 | ||
233 | private: | 231 | private: |
234 | QList<AppLnk> hidden; | 232 | QList<AppLnk> hidden; |
235 | QDict<void> mimes; | 233 | QDict<void> mimes; |
236 | QDict<void> cats; | 234 | QDict<void> cats; |
237 | SortMethod sortmeth; | 235 | SortMethod sortmeth; |
238 | QRegExp tf; | 236 | QRegExp tf; |
239 | int cf; | 237 | int cf; |
240 | LauncherItem* bsy; | 238 | LauncherItem* bsy; |
241 | int busyTimer; | 239 | int busyTimer; |
242 | bool ike; | 240 | bool ike; |
243 | bool bigIcns; | 241 | bool bigIcns; |
244 | QPixmap bgPixmap; | 242 | QPixmap bgPixmap; |
245 | QColor bgColor; | 243 | QColor bgColor; |
246 | LauncherThumbReceiver*m_EyeCallBack; | 244 | LauncherThumbReceiver*m_EyeCallBack; |
247 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY | 245 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY |
248 | QPixmap busyPix; | 246 | QPixmap busyPix; |
249 | #endif | 247 | #endif |
250 | BusyIndicatorType busyType; | 248 | BusyIndicatorType busyType; |
251 | QTimer m_eyeTimer; | 249 | QTimer m_eyeTimer; |
252 | int numColumns; | 250 | int numColumns; |
251 | bool staticBackground; | ||
253 | }; | 252 | }; |
254 | 253 | ||
255 | #endif // LAUNCHERVIEW_H | 254 | #endif // LAUNCHERVIEW_H |