author | zecke <zecke> | 2004-04-14 18:38:37 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-04-14 18:38:37 (UTC) |
commit | 0b83b10334da449fb9304c9b89a4175f3728d377 (patch) (unidiff) | |
tree | 465cdb61d1fa032de425761ef0074ee58bad7cd2 | |
parent | b671d282c25e86429727b6b52a674d1d8cd3f1a7 (diff) | |
download | opie-0b83b10334da449fb9304c9b89a4175f3728d377.zip opie-0b83b10334da449fb9304c9b89a4175f3728d377.tar.gz opie-0b83b10334da449fb9304c9b89a4175f3728d377.tar.bz2 |
-comments on imagezoomer
recalculateGrid Alwin please fill in the blank
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 20 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.h | 4 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/viewmodebutton.cpp | 29 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/viewmodebutton.h | 2 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/lib/oimagezoomer.cpp | 9 |
5 files changed, 56 insertions, 8 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index a06844a..e61f9d9 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -472,14 +472,14 @@ void PIconView::slotImageInfo( const QString& name) { | |||
472 | 472 | ||
473 | void PIconView::slotChangeMode( int mode ) { | 473 | void PIconView::slotChangeMode( int mode ) { |
474 | if ( mode >= 0 && mode <= 3 ) | 474 | if ( mode >= 1 && mode <= 3 ) |
475 | m_mode = mode; | 475 | m_mode = mode; |
476 | 476 | ||
477 | QIconView::ItemTextPos pos; | 477 | QIconView::ItemTextPos pos; |
478 | switch( m_mode ) { | 478 | switch( m_mode ) { |
479 | case 1: | 479 | case 2: |
480 | pos = QIconView::Bottom; | 480 | pos = QIconView::Bottom; |
481 | break; | 481 | break; |
482 | case 2: | 482 | case 3: |
483 | case 0: | 483 | case 1: |
484 | default: | 484 | default: |
485 | pos = QIconView::Right; | 485 | pos = QIconView::Right; |
@@ -488,4 +488,16 @@ void PIconView::slotChangeMode( int mode ) { | |||
488 | m_view->setItemTextPos( pos ); | 488 | m_view->setItemTextPos( pos ); |
489 | 489 | ||
490 | calculateGrid(); | ||
490 | slotReloadDir(); | 491 | slotReloadDir(); |
491 | } | 492 | } |
493 | |||
494 | |||
495 | void PIconView::resizeEvent( QResizeEvent* re ) { | ||
496 | QVBox::resizeEvent( re ); | ||
497 | calculateGrid(); | ||
498 | } | ||
499 | |||
500 | |||
501 | void PIconView::calculateGrid() { | ||
502 | |||
503 | } | ||
diff --git a/noncore/graphics/opie-eye/gui/iconview.h b/noncore/graphics/opie-eye/gui/iconview.h index af41aef..903c4fd 100644 --- a/noncore/graphics/opie-eye/gui/iconview.h +++ b/noncore/graphics/opie-eye/gui/iconview.h | |||
@@ -40,8 +40,12 @@ signals: | |||
40 | void sig_display( const QString& ); | 40 | void sig_display( const QString& ); |
41 | 41 | ||
42 | protected: | ||
43 | void resizeEvent( QResizeEvent* ); | ||
44 | |||
42 | private: | 45 | private: |
43 | void initKeys(); | 46 | void initKeys(); |
44 | QString currentFileName(bool &isDir)const; | 47 | QString currentFileName(bool &isDir)const; |
45 | void loadViews(); | 48 | void loadViews(); |
49 | void calculateGrid(); | ||
46 | 50 | ||
47 | private slots: | 51 | private slots: |
diff --git a/noncore/graphics/opie-eye/gui/viewmodebutton.cpp b/noncore/graphics/opie-eye/gui/viewmodebutton.cpp index fdf4e77..0e4a7cb 100644 --- a/noncore/graphics/opie-eye/gui/viewmodebutton.cpp +++ b/noncore/graphics/opie-eye/gui/viewmodebutton.cpp | |||
@@ -1,4 +1,6 @@ | |||
1 | #include "viewmodebutton.h" | 1 | #include "viewmodebutton.h" |
2 | 2 | ||
3 | #include <opie2/odebug.h> | ||
4 | |||
3 | #include <qtoolbar.h> | 5 | #include <qtoolbar.h> |
4 | #include <qpopupmenu.h> | 6 | #include <qpopupmenu.h> |
@@ -7,12 +9,14 @@ ViewModeButton::ViewModeButton( QToolBar* bar ) | |||
7 | : QToolButton( bar ) | 9 | : QToolButton( bar ) |
8 | { | 10 | { |
9 | setIconSet( Resource::loadIconSet( "toys" ) ); | 11 | slotChange( 1 ); |
10 | QPopupMenu *pop= new QPopupMenu( this ); | 12 | QPopupMenu *pop= new QPopupMenu( this ); |
11 | pop->setCheckable( true ); | 13 | pop->setCheckable( true ); |
12 | pop->insertItem( tr("Thumbnail and Imageinfo"), 0 ); | 14 | pop->insertItem( tr("Thumbnail and Imageinfo"), 1 ); |
13 | pop->insertItem( tr("Thumbnail and Name" ), 1 ); | 15 | pop->insertItem( tr("Thumbnail and Name" ), 2 ); |
14 | pop->insertItem( tr("Name Only" ), 2 ); | 16 | pop->insertItem( tr("Name Only" ), 3 ); |
15 | connect(pop, SIGNAL(activated(int)), | 17 | connect(pop, SIGNAL(activated(int)), |
16 | this, SIGNAL(changeMode(int)) ); | 18 | this, SIGNAL(changeMode(int)) ); |
19 | connect(pop, SIGNAL(activated(int)), | ||
20 | this, SLOT(slotChange(int)) ); | ||
17 | 21 | ||
18 | 22 | ||
@@ -21,4 +25,21 @@ ViewModeButton::ViewModeButton( QToolBar* bar ) | |||
21 | 25 | ||
22 | ViewModeButton::~ViewModeButton() { | 26 | ViewModeButton::~ViewModeButton() { |
27 | } | ||
28 | |||
29 | void ViewModeButton::slotChange( int i ) { | ||
30 | QString name; | ||
31 | switch( i ) { | ||
32 | case 1: | ||
33 | name = "opie-eye/opie-eye-thumb"; | ||
34 | break; | ||
35 | case 2: | ||
36 | name = "opie-eye/opie-eye-thumbonly"; | ||
37 | break; | ||
38 | case 3: | ||
39 | name = "opie-eye/opie-eye-textview"; | ||
40 | break; | ||
41 | } | ||
23 | 42 | ||
43 | qWarning("foo %d" +name, i ); | ||
44 | setIconSet( Resource::loadIconSet( name ) ); | ||
24 | } | 45 | } |
diff --git a/noncore/graphics/opie-eye/gui/viewmodebutton.h b/noncore/graphics/opie-eye/gui/viewmodebutton.h index 44f2228..3247114 100644 --- a/noncore/graphics/opie-eye/gui/viewmodebutton.h +++ b/noncore/graphics/opie-eye/gui/viewmodebutton.h | |||
@@ -19,4 +19,6 @@ public: | |||
19 | signals: | 19 | signals: |
20 | void changeMode( int ); | 20 | void changeMode( int ); |
21 | private slots: | ||
22 | void slotChange( int i ); | ||
21 | }; | 23 | }; |
22 | 24 | ||
diff --git a/noncore/graphics/opie-eye/lib/oimagezoomer.cpp b/noncore/graphics/opie-eye/lib/oimagezoomer.cpp index 4df5dcc..00b93e2 100644 --- a/noncore/graphics/opie-eye/lib/oimagezoomer.cpp +++ b/noncore/graphics/opie-eye/lib/oimagezoomer.cpp | |||
@@ -174,4 +174,13 @@ void OImageZoomer::drawContents( QPainter* p ) { | |||
174 | p->setPen( Qt::red ); | 174 | p->setPen( Qt::red ); |
175 | 175 | ||
176 | /* | ||
177 | * the contentRect is set equal to the size of the image | ||
178 | * Rect/Original = NewRectORWidth/OriginalVisibleStuff and then simply we | ||
179 | * need to add the c.y/x due usage of QFrame | ||
180 | * For x and y we use the visiblePoint | ||
181 | * For height and width we use the size of the viewport | ||
182 | * if width/height would be bigger than our widget we use this width/height | ||
183 | * | ||
184 | */ | ||
176 | int len = m_imgSize.width(); | 185 | int len = m_imgSize.width(); |
177 | int x = (c.width()*m_visPt.x())/len + c.x(); | 186 | int x = (c.width()*m_visPt.x())/len + c.x(); |