d->mAnimationMethodGroup = new InvisibleButtonGroup(widget);
d->mAnimationMethodGroup->setObjectName(QLatin1String("kcfg_AnimationMethod"));
- d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.glAnimationRadioButton, int(DocumentView::GLAnimation));
-#ifndef HAVE_OPENGL
- d->mImageViewConfigPage.glAnimationRadioButton->setVisible(false);
-#endif
d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.softwareAnimationRadioButton, int(DocumentView::SoftwareAnimation));
d->mAnimationMethodGroup->addButton(d->mImageViewConfigPage.noAnimationRadioButton, int(DocumentView::NoAnimation));
<x>0</x>
<y>0</y>
<width>400</width>
- <height>385</height>
+ <height>392</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
- <property name="buddy">
- <cstring>glAnimationRadioButton</cstring>
- </property>
</widget>
</item>
- <item row="8" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_9">
- <item>
- <widget class="QRadioButton" name="glAnimationRadioButton">
- <property name="text">
- <string>OpenGL</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_7">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="9" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_8">
- <item>
- <widget class="QRadioButton" name="softwareAnimationRadioButton">
- <property name="text">
- <string>Software</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer_8">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
<item row="10" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
</property>
</spacer>
</item>
+ <item row="8" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <widget class="QRadioButton" name="softwareAnimationRadioButton">
+ <property name="text">
+ <string>Software</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_8">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<customwidgets>
<tabstop>mouseWheelScrollRadioButton</tabstop>
<tabstop>mouseWheelBrowseRadioButton</tabstop>
<tabstop>kcfg_EnlargeSmallerImages</tabstop>
- <tabstop>glAnimationRadioButton</tabstop>
<tabstop>softwareAnimationRadioButton</tabstop>
<tabstop>noAnimationRadioButton</tabstop>
<tabstop>horizontalRadioButton</tabstop>
${PNG_LIBRARIES}
)
-if(QT_QTOPENGL_FOUND)
- add_definitions(-DHAVE_OPENGL)
- target_link_libraries(gwenviewlib ${QT_QTOPENGL_LIBRARY})
-endif()
-
install(TARGETS gwenviewlib ${INSTALL_TARGETS_DEFAULT_ARGS})
enum AnimationMethod {
NoAnimation,
- SoftwareAnimation,
- GLAnimation
+ SoftwareAnimation
};
/**
#include <QGraphicsScene>
#include <QPropertyAnimation>
#include <QTimer>
-#if defined(HAVE_OPENGL)
-# include <QGL>
-#endif
// libc
#include <qmath.h>
{
d->q = this;
d->mScene = new QGraphicsScene(this);
-#if defined(HAVE_OPENGL)
- if (GwenviewConfig::animationMethod() == DocumentView::GLAnimation) {
- QGLWidget* glWidget = new QGLWidget;
- if (glWidget->isValid()) {
- setViewport(glWidget);
- } else {
- kWarning() << "Failed to initialize OpenGL support!";
- delete glWidget;
- }
- }
-#endif
setScene(d->mScene);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
d->mLayoutUpdateTimer->setInterval(0);
d->mLayoutUpdateTimer->setSingleShot(true);
connect(d->mLayoutUpdateTimer, SIGNAL(timeout()), SLOT(updateLayout()));
-
- connect(GwenviewConfig::self(), SIGNAL(configChanged()), SLOT(slotConfigChanged()));
}
DocumentViewContainer::~DocumentViewContainer()
view->setEraseBorders(false);
}
-void DocumentViewContainer::slotConfigChanged()
-{
-#if defined(HAVE_OPENGL)
- bool currentlyGL = qobject_cast<QGLWidget*>(viewport());
- bool wantGL = GwenviewConfig::animationMethod() == DocumentView::GLAnimation;
- if (currentlyGL != wantGL) {
- setViewport(wantGL ? new QGLWidget() : new QWidget());
- }
-#else
- setViewport(new QWidget());
-#endif
-}
-
void DocumentViewContainer::showMessageWidget(QGraphicsWidget* widget, Qt::Alignment align)
{
DocumentView* view = 0;
private Q_SLOTS:
void slotFadeInFinished(DocumentView*);
void pretendFadeInFinished();
- void slotConfigChanged();
};
} // namespace
<choices name="Gwenview::DocumentView::AnimationMethod">
<choice name="DocumentView::NoAnimation"/>
<choice name="DocumentView::SoftwareAnimation"/>
- <choice name="DocumentView::GLAnimation"/>
</choices>
<default>DocumentView::SoftwareAnimation</default>
</entry>