summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp36
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.h3
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp5
-rw-r--r--noncore/graphics/opie-eye/phunk_view.pro6
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
@@ -43,2 +43,3 @@ namespace {
static QPixmap* _unkPix = 0;
+ static QPixmap* _picPix = 0;
class IconViewItem : public QIconViewItem {
@@ -51,5 +52,6 @@ namespace {
+ protected:
+ mutable QPixmap* m_pix;
private:
- mutable QPixmap* m_pix;
QString m_path;
@@ -58,2 +60,12 @@ namespace {
};
+ class TextViewItem : public IconViewItem {
+ TextViewItem( QIconView*, const QString& path, const QString& name, bool isDir = false );
+ QPixmap *pixmap()const;
+ void setText( const QString& );
+ };
+ class ThumbViewItem : public IconViewItem {
+ ThumbViewItem( QIconView*, const QString& path, const QString& name, bool isDir = false );
+ QPixmap *pixmap()const;
+ void setText( const QString& );
+ };
@@ -117,2 +129,3 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
m_path = QDir::homeDirPath();
+ m_mode = 0;
@@ -457 +470,22 @@ void PIconView::slotImageInfo( const QString& name) {
}
+
+
+void PIconView::slotChangeMode( int mode ) {
+ if ( mode >= 0 && mode <= 3 )
+ m_mode = mode;
+
+ QIconView::ItemTextPos pos;
+ switch( m_mode ) {
+ case 1:
+ pos = QIconView::Bottom;
+ break;
+ case 2:
+ case 0:
+ default:
+ pos = QIconView::Right;
+ break;
+ }
+ m_view->setItemTextPos( pos );
+
+ slotReloadDir();
+}
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
@@ -72,2 +72,4 @@ private slots:
void slotThumbNail(const QString&, const QPixmap&);
+
+ void slotChangeMode( int );
private:
@@ -79,2 +81,3 @@ private:
bool m_updatet : 1;
+ int m_mode;
};
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
@@ -10,2 +10,3 @@
#include "imageview.h"
+#include "viewmodebutton.h"
@@ -89,2 +90,6 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
+ btn = new ViewModeButton( bar );
+ connect( btn, SIGNAL(changeMode(int)),
+ m_view, SLOT(slotChangeMode(int)));
+
btn = new QToolButton( bar );
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
@@ -14,3 +14,4 @@ HEADERS = gui/iconview.h gui/filesystem.h gui/mainwindow.h \
gui/imageview.h \
- lib/oimagezoomer.h
+ lib/oimagezoomer.h \
+ gui/viewmodebutton.h
@@ -26,3 +27,4 @@ SOURCES = gui/iconview.cpp gui/filesystem.cpp gui/mainwindow.cpp \
gui/imageview.cpp \
- lib/oimagezoomer.cpp
+ lib/oimagezoomer.cpp \
+ gui/viewmodebutton.cpp
# A list of source files