[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdeplasma-addons/rshah/comicqml] applets/comic: removed fullviewwidget c++ version
From: Reza Shah <rshah0385 () kireihana ! com>
Date: 2012-11-02 13:11:37
Message-ID: 20121102131137.CC6F4A6078 () git ! kde ! org
[Download RAW message or body]
Git commit 6445299a5cae8238836a1e63348cc5673a262bc8 by Reza Shah.
Committed on 02/11/2012 at 14:10.
Pushed by rshah into branch 'rshah/comicqml'.
removed fullviewwidget c++ version
M +0 -1 applets/comic/CMakeLists.txt
M +0 -17 applets/comic/comic.cpp
M +0 -3 applets/comic/comic.h
D +0 -106 applets/comic/fullviewwidget.cpp
D +0 -47 applets/comic/fullviewwidget.h
http://commits.kde.org/kdeplasma-addons/6445299a5cae8238836a1e63348cc5673a262bc8
diff --git a/applets/comic/CMakeLists.txt b/applets/comic/CMakeLists.txt
index b80cb72..c2b6126 100644
--- a/applets/comic/CMakeLists.txt
+++ b/applets/comic/CMakeLists.txt
@@ -9,7 +9,6 @@ set(comic_SRCS
comic.cpp
comicmodel.cpp
configwidget.cpp
- fullviewwidget.cpp
imagewidget.cpp
comicarchivejob.cpp
comicarchivedialog.cpp
diff --git a/applets/comic/comic.cpp b/applets/comic/comic.cpp
index 4a38998..59271f1 100644
--- a/applets/comic/comic.cpp
+++ b/applets/comic/comic.cpp
@@ -52,7 +52,6 @@
#include "comicmodel.h"
#include "configwidget.h"
-#include "fullviewwidget.h"
#include "imagewidget.h"
K_GLOBAL_STATIC( ComicUpdater, globalComicUpdater )
@@ -71,7 +70,6 @@ ComicApplet::ComicApplet( QObject *parent, const QVariantList &args )
mMiddleClick( true ),
mCheckNewStrips( 0 ),
mDeclarativeWidget( 0 ),
- mFullViewWidget( 0 ),
mActionShop( 0 ),
mEngine( 0 ),
mSavingDir(0),
@@ -187,7 +185,6 @@ void ComicApplet::init()
ComicApplet::~ComicApplet()
{
- delete mFullViewWidget;
delete mSavingDir;
}
@@ -694,20 +691,6 @@ void ComicApplet::slotScaleToContent()
updateSize();
}
-void ComicApplet::fullView()
-{
- if (!mFullViewWidget) {
- mFullViewWidget = new FullViewWidget;
- }
-
- if (!mFullViewWidget->isVisible()) {
- mFullViewWidget->setImage(mCurrent.image());
- mFullViewWidget->adaptPosition(mDeclarativeWidget->mapToScene( \
mDeclarativeWidget->pos()).toPoint(), containment()->screen());
- mFullViewWidget->show();
- }
-}
-
-
//QML
QObject *ComicApplet::comicsModel()
{
diff --git a/applets/comic/comic.h b/applets/comic/comic.h
index 0f56696..61ad5ec 100644
--- a/applets/comic/comic.h
+++ b/applets/comic/comic.h
@@ -44,7 +44,6 @@ class ComicLabel;
class ComicModel;
class ComicTabBar;
class ConfigWidget;
-class FullViewWidget;
class ImageWidget;
class KAction;
class KJob;
@@ -146,7 +145,6 @@ Q_SIGNALS:
void slotShowMaxSize();
void applyConfig();
void checkDayChanged();
- void fullView();
void updateSize();
void createComicBook();
void slotArchive( int archiveType, const KUrl &dest, const QString &fromIdentifier, const \
QString &toIdentifier ); @@ -199,7 +197,6 @@ Q_SIGNALS:
QTimer *mDateChangedTimer;
QList<QAction*> mActions;
Plasma::DeclarativeWidget *mDeclarativeWidget;
- FullViewWidget *mFullViewWidget;
QAction *mActionGoFirst;
QAction *mActionGoLast;
QAction *mActionGoJump;
diff --git a/applets/comic/fullviewwidget.cpp b/applets/comic/fullviewwidget.cpp
deleted file mode 100644
index fc78ba6..0000000
--- a/applets/comic/fullviewwidget.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2008 by Tobias Koenig <tokoe@kde.org> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#include "fullviewwidget.h"
-
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QPainter>
-#include <QWheelEvent>
-
-FullViewWidget::FullViewWidget()
- : QWidget( 0, Qt::Popup )
-{
-}
-
-FullViewWidget::~FullViewWidget()
-{
-}
-
-void FullViewWidget::setImage( const QImage &image )
-{
- mImage = image;
- resize( mImage.size() );
-}
-
-void FullViewWidget::adaptPosition( const QPoint &pos, int screenId )
-{
- if ( !mDesktopSize.isValid() ) {
- const QDesktopWidget desktop;
- mDesktopSize = desktop.screenGeometry( screenId );
- }
-
- const bool contains = mDesktopSize.contains( pos, true );
- int x = ( contains ? pos.x() : mDesktopSize.left() );
- int y = ( contains ? pos.y() : mDesktopSize.top() );
-
- //left() and top() needed for multiple screens
- const int neededX = x - mDesktopSize.left() + width();
- const int neededY = y - mDesktopSize.top() + height();
-
- if ( neededX > mDesktopSize.width() ) {
- x = mDesktopSize.left();
- }
- if ( neededY > mDesktopSize.height() ) {
- y = mDesktopSize.top();
- }
-
- move( x, y );
-}
-
-void FullViewWidget::paintEvent( QPaintEvent* )
-{
- QPainter p( this );
- p.drawImage( 0, 0, mImage );
-}
-
-void FullViewWidget::mousePressEvent( QMouseEvent* )
-{
- hide();
-}
-
-void FullViewWidget::wheelEvent( QWheelEvent *event )
-{
- const int numDegrees = event->delta() / 8;
- const int numSteps = numDegrees / 15;
- const int scroll = numSteps * 30;
-
- QPoint futurePos = this->pos();
-
- //vertical
- if ( ( mImage.height() > mDesktopSize.height() ) && ( event->modifiers() != Qt::AltModifier ) ) {
- futurePos += QPoint( 0, scroll );
- if ( ( scroll > 0 ) && ( futurePos.y() > mDesktopSize.top() ) ) {
- futurePos.setY( mDesktopSize.top() );
- } else if ( ( scroll < 0 ) && ( futurePos.y() + height() < mDesktopSize.bottom() ) ) {
- futurePos.setY( mDesktopSize.bottom() - height() );
- }
- //horizontal
- } else if ( mImage.width() > mDesktopSize.width() ) {
- futurePos += QPoint( scroll, 0 );
- if ( ( scroll > 0 ) && ( futurePos.x() > mDesktopSize.left() ) ) {
- futurePos.setX( mDesktopSize.left() );
- } else if ( ( scroll < 0 ) && ( futurePos.x() + width() < mDesktopSize.right() ) ) {
- futurePos.setX( mDesktopSize.right() - width() );
- }
- }
-
- move( futurePos );
-
- QWidget::wheelEvent( event );
-}
diff --git a/applets/comic/fullviewwidget.h b/applets/comic/fullviewwidget.h
deleted file mode 100644
index c0a1aff..0000000
--- a/applets/comic/fullviewwidget.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2008 by Tobias Koenig <tokoe@kde.org> *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
- ***************************************************************************/
-
-#ifndef FULLVIEWWIDGET_H
-#define FULLVIEWWIDGET_H
-
-#include <QtGui/QImage>
-#include <QtGui/QWidget>
-
-class QWheelEvent;
-
-class FullViewWidget : public QWidget
-{
- public:
- FullViewWidget();
- ~FullViewWidget();
-
- void setImage( const QImage &image );
- void adaptPosition( const QPoint &pos, int screenId );
-
- protected:
- virtual void paintEvent( QPaintEvent* );
- virtual void mousePressEvent( QMouseEvent* );
- virtual void wheelEvent( QWheelEvent* );
-
- private:
- QImage mImage;
- QRect mDesktopSize;
-};
-
-#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic