author | zecke <zecke> | 2004-04-13 22:21:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-04-13 22:21:20 (UTC) |
commit | 79558e549b0ce1fa17fe79fc437859d137ad821f (patch) (unidiff) | |
tree | f8a504778d5a95abaed9f1cf3e451e31c94c5681 | |
parent | e61f3d63c310e4e560bc38f41c1390f246b5f670 (diff) | |
download | opie-79558e549b0ce1fa17fe79fc437859d137ad821f.zip opie-79558e549b0ce1fa17fe79fc437859d137ad821f.tar.gz opie-79558e549b0ce1fa17fe79fc437859d137ad821f.tar.bz2 |
First bits of different IconView Views
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 36 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.h | 3 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 5 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/phunk_view.pro | 6 |
4 files changed, 47 insertions, 3 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 2a49786..a06844a 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -40,23 +40,35 @@ using Opie::Core::OKeyConfigItem; | |||
40 | */ | 40 | */ |
41 | namespace { | 41 | namespace { |
42 | static QPixmap* _dirPix = 0; | 42 | static QPixmap* _dirPix = 0; |
43 | static QPixmap* _unkPix = 0; | 43 | static QPixmap* _unkPix = 0; |
44 | static QPixmap* _picPix = 0; | ||
44 | class IconViewItem : public QIconViewItem { | 45 | class IconViewItem : public QIconViewItem { |
45 | public: | 46 | public: |
46 | IconViewItem( QIconView*, const QString& path, const QString& name, bool isDir = false); | 47 | IconViewItem( QIconView*, const QString& path, const QString& name, bool isDir = false); |
47 | QPixmap* pixmap()const; | 48 | QPixmap* pixmap()const; |
48 | QString path()const { return m_path; } | 49 | QString path()const { return m_path; } |
49 | bool isDir()const { return m_isDir; } | 50 | bool isDir()const { return m_isDir; } |
50 | void setText( const QString& ); | 51 | void setText( const QString& ); |
51 | 52 | ||
53 | protected: | ||
54 | mutable QPixmap* m_pix; | ||
52 | 55 | ||
53 | private: | 56 | private: |
54 | mutable QPixmap* m_pix; | ||
55 | QString m_path; | 57 | QString m_path; |
56 | bool m_isDir : 1; | 58 | bool m_isDir : 1; |
57 | bool m_noInfo :1; | 59 | bool m_noInfo :1; |
58 | }; | 60 | }; |
61 | class TextViewItem : public IconViewItem { | ||
62 | TextViewItem( QIconView*, const QString& path, const QString& name, bool isDir = false ); | ||
63 | QPixmap *pixmap()const; | ||
64 | void setText( const QString& ); | ||
65 | }; | ||
66 | class ThumbViewItem : public IconViewItem { | ||
67 | ThumbViewItem( QIconView*, const QString& path, const QString& name, bool isDir = false ); | ||
68 | QPixmap *pixmap()const; | ||
69 | void setText( const QString& ); | ||
70 | }; | ||
59 | 71 | ||
60 | 72 | ||
61 | /* | 73 | /* |
62 | * If we request an Image or String | 74 | * If we request an Image or String |
@@ -114,8 +126,9 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | |||
114 | { | 126 | { |
115 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); | 127 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); |
116 | } | 128 | } |
117 | m_path = QDir::homeDirPath(); | 129 | m_path = QDir::homeDirPath(); |
130 | m_mode = 0; | ||
118 | 131 | ||
119 | QHBox *hbox = new QHBox( this ); | 132 | QHBox *hbox = new QHBox( this ); |
120 | QLabel* lbl = new QLabel( hbox ); | 133 | QLabel* lbl = new QLabel( hbox ); |
121 | lbl->setText( tr("View as" ) ); | 134 | lbl->setText( tr("View as" ) ); |
@@ -454,4 +467,25 @@ void PIconView::slotImageInfo() { | |||
454 | 467 | ||
455 | void PIconView::slotImageInfo( const QString& name) { | 468 | void PIconView::slotImageInfo( const QString& name) { |
456 | emit sig_showInfo( name ); | 469 | emit sig_showInfo( name ); |
457 | } | 470 | } |
471 | |||
472 | |||
473 | void PIconView::slotChangeMode( int mode ) { | ||
474 | if ( mode >= 0 && mode <= 3 ) | ||
475 | m_mode = mode; | ||
476 | |||
477 | QIconView::ItemTextPos pos; | ||
478 | switch( m_mode ) { | ||
479 | case 1: | ||
480 | pos = QIconView::Bottom; | ||
481 | break; | ||
482 | case 2: | ||
483 | case 0: | ||
484 | default: | ||
485 | pos = QIconView::Right; | ||
486 | break; | ||
487 | } | ||
488 | m_view->setItemTextPos( pos ); | ||
489 | |||
490 | slotReloadDir(); | ||
491 | } | ||
diff --git a/noncore/graphics/opie-eye/gui/iconview.h b/noncore/graphics/opie-eye/gui/iconview.h index 9cf7b3e..af41aef 100644 --- a/noncore/graphics/opie-eye/gui/iconview.h +++ b/noncore/graphics/opie-eye/gui/iconview.h | |||
@@ -69,14 +69,17 @@ private slots: | |||
69 | 69 | ||
70 | /**/ | 70 | /**/ |
71 | void slotThumbInfo(const QString&, const QString&); | 71 | void slotThumbInfo(const QString&, const QString&); |
72 | void slotThumbNail(const QString&, const QPixmap&); | 72 | void slotThumbNail(const QString&, const QPixmap&); |
73 | |||
74 | void slotChangeMode( int ); | ||
73 | private: | 75 | private: |
74 | Opie::Core::OKeyConfigManager *m_viewManager; | 76 | Opie::Core::OKeyConfigManager *m_viewManager; |
75 | Opie::Core::OConfig *m_cfg; | 77 | Opie::Core::OConfig *m_cfg; |
76 | QComboBox* m_views; | 78 | QComboBox* m_views; |
77 | QIconView* m_view; | 79 | QIconView* m_view; |
78 | QString m_path; | 80 | QString m_path; |
79 | bool m_updatet : 1; | 81 | bool m_updatet : 1; |
82 | int m_mode; | ||
80 | }; | 83 | }; |
81 | 84 | ||
82 | #endif | 85 | #endif |
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index ef23f79..dd9cced 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -7,8 +7,9 @@ | |||
7 | #include "iconview.h" | 7 | #include "iconview.h" |
8 | #include "filesystem.h" | 8 | #include "filesystem.h" |
9 | #include "imageinfoui.h" | 9 | #include "imageinfoui.h" |
10 | #include "imageview.h" | 10 | #include "imageview.h" |
11 | #include "viewmodebutton.h" | ||
11 | 12 | ||
12 | #include <iface/ifaceinfo.h> | 13 | #include <iface/ifaceinfo.h> |
13 | #include <iface/dirview.h> | 14 | #include <iface/dirview.h> |
14 | 15 | ||
@@ -86,8 +87,12 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | |||
86 | btn->setIconSet( Resource::loadIconSet( "trash" ) ); | 87 | btn->setIconSet( Resource::loadIconSet( "trash" ) ); |
87 | connect( btn, SIGNAL(clicked() ), | 88 | connect( btn, SIGNAL(clicked() ), |
88 | m_view, SLOT(slotTrash() ) ); | 89 | m_view, SLOT(slotTrash() ) ); |
89 | 90 | ||
91 | btn = new ViewModeButton( bar ); | ||
92 | connect( btn, SIGNAL(changeMode(int)), | ||
93 | m_view, SLOT(slotChangeMode(int))); | ||
94 | |||
90 | btn = new QToolButton( bar ); | 95 | btn = new QToolButton( bar ); |
91 | btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); | 96 | btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); |
92 | connect( btn, SIGNAL(clicked() ), | 97 | connect( btn, SIGNAL(clicked() ), |
93 | this, SLOT(slotConfig() ) ); | 98 | this, SLOT(slotConfig() ) ); |
diff --git a/noncore/graphics/opie-eye/phunk_view.pro b/noncore/graphics/opie-eye/phunk_view.pro index e9abe72..e9459ad 100644 --- a/noncore/graphics/opie-eye/phunk_view.pro +++ b/noncore/graphics/opie-eye/phunk_view.pro | |||
@@ -11,9 +11,10 @@ HEADERS = gui/iconview.h gui/filesystem.h gui/mainwindow.h \ | |||
11 | lib/slavemaster.h \ | 11 | lib/slavemaster.h \ |
12 | iface/slaveiface.h \ | 12 | iface/slaveiface.h \ |
13 | gui/imageinfoui.h gui/imagescrollview.h \ | 13 | gui/imageinfoui.h gui/imagescrollview.h \ |
14 | gui/imageview.h \ | 14 | gui/imageview.h \ |
15 | lib/oimagezoomer.h | 15 | lib/oimagezoomer.h \ |
16 | gui/viewmodebutton.h | ||
16 | 17 | ||
17 | # A list header files | 18 | # A list header files |
18 | 19 | ||
19 | 20 | ||
@@ -23,9 +24,10 @@ SOURCES = gui/iconview.cpp gui/filesystem.cpp gui/mainwindow.cpp \ | |||
23 | iface/dirview.cpp impl/dir/dir_lister.cpp \ | 24 | iface/dirview.cpp impl/dir/dir_lister.cpp \ |
24 | impl/dir/dir_ifaceinfo.cpp lib/slavemaster.cpp \ | 25 | impl/dir/dir_ifaceinfo.cpp lib/slavemaster.cpp \ |
25 | gui/imageinfoui.cpp gui/imagescrollview.cpp \ | 26 | gui/imageinfoui.cpp gui/imagescrollview.cpp \ |
26 | gui/imageview.cpp \ | 27 | gui/imageview.cpp \ |
27 | lib/oimagezoomer.cpp | 28 | lib/oimagezoomer.cpp \ |
29 | gui/viewmodebutton.cpp | ||
28 | # A list of source files | 30 | # A list of source files |
29 | 31 | ||
30 | INTERFACES = | 32 | INTERFACES = |
31 | # list of ui files | 33 | # list of ui files |