[KPhotoAlbum] PATCH : use CTRL-Alt as an alternative to Middle button for thumbs resizing

Baptiste MATHUS ml at batmat.net
Tue May 8 16:49:41 BST 2007


Hi again,

Here's the isolated patch derived from Jan's one. Seems to be ok here,
doesn't break the Ctrl click previous behaviour.

What do you think?
(Note I'm not used to Qt programming, nor event Qt programming, so if my
small thumbResizeMode() small method should be written differently, please
feel free to advice).

################################"""
Index: ThumbnailView/ThumbnailWidget.cpp
===================================================================
--- ThumbnailView/ThumbnailWidget.cpp    (révision 662469)
+++ ThumbnailView/ThumbnailWidget.cpp    (copie de travail)
@@ -588,9 +591,14 @@
     return height() / cellHeight();
 }

+bool ThumbnailView::ThumbnailWidget::thumbResizeMode(QMouseEvent* event)
+{
+    return (event->button() & MidButton) || (event->state() ==
(Qt::ControlButton|Qt::AltButton));
+}
+
 void ThumbnailView::ThumbnailWidget::mousePressEvent( QMouseEvent* event )
 {
-    if (event->button() & MidButton )
+    if ( thumbResizeMode(event) )
         _mouseHandler = &_gridResizeInteraction;
     else
         _mouseHandler = &_selectionInteraction;
Index: ThumbnailView/ThumbnailWidget.h
===================================================================
--- ThumbnailView/ThumbnailWidget.h    (révision 662469)
+++ ThumbnailView/ThumbnailWidget.h    (copie de travail)
@@ -139,6 +139,7 @@
     void updateCellSize();
     QStringList vectorToList( const QValueVector<QString>& ) const;
     void updateIndexCache();
+    bool thumbResizeMode(QMouseEvent* event);

 protected slots:
     void emitDateChange( int, int );
########################

-- 
Baptiste <Batmat> MATHUS
BMathus at Batmat point net - http://batmat.net
---------
Si chacun de nous a une idée et que nous les partageons, nous
repartirons tous les deux avec deux idées... C'est ça le Libre.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kphotoalbum/attachments/20070508/05e4d8f3/attachment.htm>


More information about the Kphotoalbum mailing list