diff --git a/dolphin/src/dolphinviewcontainer.cpp b/dolphin/src/dolphinviewcontainer.cpp index c81561cd..c1ca52c5 100644 --- a/dolphin/src/dolphinviewcontainer.cpp +++ b/dolphin/src/dolphinviewcontainer.cpp @@ -259,7 +259,7 @@ void DolphinViewContainer::showMessage(const QString& msg, MessageType type) const int unwrappedWidth = m_messageWidget->sizeHint().width(); m_messageWidget->setWordWrap(unwrappedWidth > size().width()); - m_messageWidget->animatedShow(); + m_messageWidget->show(); } void DolphinViewContainer::readSettings() diff --git a/kate/addons/kate/project/kateprojectinfoviewcodeanalysis.cpp b/kate/addons/kate/project/kateprojectinfoviewcodeanalysis.cpp index caac904f..aab5a6a9 100644 --- a/kate/addons/kate/project/kateprojectinfoviewcodeanalysis.cpp +++ b/kate/addons/kate/project/kateprojectinfoviewcodeanalysis.cpp @@ -100,7 +100,7 @@ void KateProjectInfoViewCodeAnalysis::slotStartStopClicked () */ if (m_messageWidget) { delete m_messageWidget; - m_messageWidget=0; + m_messageWidget = 0; } if (KStandardDirs::findExe("cppcheck").isEmpty()) { @@ -110,7 +110,7 @@ void KateProjectInfoViewCodeAnalysis::slotStartStopClicked () m_messageWidget->setWordWrap(false); m_messageWidget->setText(i18n("Please install 'cppcheck'.")); static_cast(layout ())->insertWidget(0, m_messageWidget); - m_messageWidget->animatedShow(); + m_messageWidget->show(); return; } diff --git a/kate/part/CMakeLists.txt b/kate/part/CMakeLists.txt index 7f1e5b7a..887aa3fe 100644 --- a/kate/part/CMakeLists.txt +++ b/kate/part/CMakeLists.txt @@ -108,7 +108,6 @@ set(katepart_PART_SRCS view/kateviewinternal.cpp view/kateviewhelpers.cpp view/katemessagewidget.cpp - view/kateanimation.cpp view/katetextanimation.cpp # spell checking diff --git a/kate/part/view/kateanimation.cpp b/kate/part/view/kateanimation.cpp deleted file mode 100644 index 41a4de61..00000000 --- a/kate/part/view/kateanimation.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* This file is part of the KDE and the Kate project - * - * Copyright (C) 2013 Dominik Haumann - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "kateanimation.h" -#include "moc_kateanimation.cpp" - -#include -#include -#include - -KateAnimation::KateAnimation(KMessageWidget* widget, bool applyEffect) - : QObject(widget) - , m_widget(widget) - , m_applyEffect(applyEffect) -{ - Q_ASSERT(m_widget != 0); - - // create tracking timer for hiding the widget - m_hideTimer = new QTimer(this); - m_hideTimer->setInterval(550); // 500 from KMessageWidget + 50 to make sure the hide animation is really finished - m_hideTimer->setSingleShot(true); - connect(m_hideTimer, SIGNAL(timeout()), this, SIGNAL(widgetHidden())); - - // create tracking timer for showing the widget - m_showTimer = new QTimer(this); - m_showTimer->setInterval(550); // 500 from KMessageWidget + 50 to make sure the show animation is really finished - m_showTimer->setSingleShot(true); - connect(m_showTimer, SIGNAL(timeout()), this, SIGNAL(widgetShown())); -} - -bool KateAnimation::hideAnimationActive() const -{ - return m_hideTimer->isActive(); -} - -bool KateAnimation::showAnimationActive() const -{ - return m_showTimer->isActive(); -} - -void KateAnimation::show() -{ - Q_ASSERT(m_widget != 0); - - // stop hide timer if needed - if (m_hideTimer->isActive()) { - m_hideTimer->stop(); - } - - // show according to effects config - if (!m_applyEffect || !(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) { - m_widget->show(); - emit widgetShown(); - } else { - // launch show effect - // NOTE: use a singleShot timer to avoid resizing issues when showing the message widget the first time (bug #316666) - QTimer::singleShot(0, m_widget, SLOT(animatedShow())); - - // start timer in order to track when showing is done (this effectively works - // around the fact, that KMessageWidget does not have a hidden signal) - m_showTimer->start(); - } -} - -void KateAnimation::hide() -{ - Q_ASSERT(m_widget != 0); - - // stop show timer if needed - if (m_showTimer->isActive()) { - m_showTimer->stop(); - } - - // hide according to effects config - if (!m_applyEffect || !(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) { - m_widget->hide(); - emit widgetHidden(); - } else { - // hide depending on effect - m_widget->animatedHide(); - - // start timer in order to track when hiding is done (this effectively works - // around the fact, that KMessageWidget does not have a hidden signal) - m_hideTimer->start(); - } -} - -// kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kate/part/view/kateanimation.h b/kate/part/view/kateanimation.h deleted file mode 100644 index 517c5f63..00000000 --- a/kate/part/view/kateanimation.h +++ /dev/null @@ -1,93 +0,0 @@ -/* This file is part of the KDE and the Kate project - * - * Copyright (C) 2013 Dominik Haumann - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef KATE_ANIMATION_H -#define KATE_ANIMATION_H - -#include -#include -#include - -class KMessageWidget; - -/** - * This class provides a fade in/out effect for KMessageWidget%s. - * Example: - * \code - * KateAnimation* animation = new KateAnimation(someMessageWidget); - * animation->show(); - * //... - * animation->hide(); - * \endcode - */ -class KateAnimation : public QObject -{ - Q_OBJECT - - public: - /** - * Constructor. - */ - KateAnimation(KMessageWidget* widget, bool applyEffect); - - /** - * Returns true, if the hide animation is running, otherwise false. - */ - bool hideAnimationActive() const; - - /** - * Returns true, if the how animation is running, otherwise false. - */ - bool showAnimationActive() const; - - public Q_SLOTS: - /** - * Call to hide the widget. - */ - void hide(); - - /** - * Call to show and fade in the widget - */ - void show(); - - Q_SIGNALS: - /** - * This signal is emitted when the hiding animation is finished. - * At this point, the associated widget is hidden. - */ - void widgetHidden(); - - /** - * This signal is emitted when the showing animation is finished. - * At this point, the associated widget is hidden. - */ - void widgetShown(); - - private: - QPointer m_widget; ///< the widget to animate - QTimer * m_hideTimer; ///< timer to track hide animation - QTimer * m_showTimer; ///< timer to track show animation - bool m_applyEffect; -}; - -#endif - -// kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kate/part/view/katemessagewidget.cpp b/kate/part/view/katemessagewidget.cpp index a7370d56..4856674b 100644 --- a/kate/part/view/katemessagewidget.cpp +++ b/kate/part/view/katemessagewidget.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -38,7 +37,6 @@ static const int s_defaultAutoHideTime = 6 * 1000; KateMessageWidget::KateMessageWidget(QWidget* parent, bool applyFadeEffect) : QWidget(parent) - , m_animation(0) , m_autoHideTimer(new QTimer(this)) , m_autoHideTime(-1) { @@ -61,10 +59,6 @@ KateMessageWidget::KateMessageWidget(QWidget* parent, bool applyFadeEffect) m_messageWidget->hide(); hide(); - // create animation controller, and connect widgetHidden() to showNextMessage() - m_animation = new KateAnimation(m_messageWidget, applyFadeEffect); - connect(m_animation, SIGNAL(widgetHidden()), this, SLOT(showNextMessage())); - // setup autoHide timer details m_autoHideTimer->setSingleShot(true); @@ -136,7 +130,7 @@ void KateMessageWidget::showNextMessage() // finally show show(); - m_animation->show(); + m_messageWidget->show(); } void KateMessageWidget::setWordWrap(KTextEditor::Message* message) @@ -197,7 +191,7 @@ void KateMessageWidget::postMessage(KTextEditor::Message* message, // catch if the message gets deleted connect(message, SIGNAL(closed(KTextEditor::Message*)), SLOT(messageDestroyed(KTextEditor::Message*))); - if (i == 0 && !m_animation->hideAnimationActive()) { + if (i == 0) { // if message has higher priority than the one currently shown, // then hide the current one and then show the new one. if (m_currentMessage) { @@ -218,7 +212,7 @@ void KateMessageWidget::postMessage(KTextEditor::Message* message, m_messageWidget, SLOT(setIcon(const QIcon&))); m_currentMessage = 0; - m_animation->hide(); + m_messageWidget->hide(); } else { showNextMessage(); } @@ -253,7 +247,7 @@ void KateMessageWidget::messageDestroyed(KTextEditor::Message* message) // if deleted message is the current message, launch hide animation if (message == m_currentMessage) { m_currentMessage = 0; - m_animation->hide(); + m_messageWidget->hide(); } } @@ -263,8 +257,6 @@ void KateMessageWidget::startAutoHideTimer() if ( !m_currentMessage // no message, nothing to do || m_autoHideTime < 0 // message does not want auto-hide || m_autoHideTimer->isActive() // auto-hide timer is already active - || m_animation->hideAnimationActive() // widget is in hide animation phase - || m_animation->showAnimationActive() // widget is in show animation phase ) { return; } diff --git a/kate/part/view/katemessagewidget.h b/kate/part/view/katemessagewidget.h index 00368f21..d7194825 100644 --- a/kate/part/view/katemessagewidget.h +++ b/kate/part/view/katemessagewidget.h @@ -34,7 +34,6 @@ namespace KTextEditor } class KMessageWidget; -class KateAnimation; /** * This class implements a message widget based on KMessageWidget. @@ -91,8 +90,6 @@ class KATEPARTINTERFACES_EXPORT KateMessageWidget : public QWidget QHash > > m_messageHash; // the message widget, showing the actual contents KMessageWidget* m_messageWidget; - // the show / hide effect controller - KateAnimation* m_animation; private: // some state variables // autoHide only once user interaction took place diff --git a/kwin/kcmkwin/kwincompositing/main.cpp b/kwin/kcmkwin/kwincompositing/main.cpp index 8cb29df3..ad347a2e 100644 --- a/kwin/kcmkwin/kwincompositing/main.cpp +++ b/kwin/kcmkwin/kwincompositing/main.cpp @@ -494,7 +494,7 @@ void KWinCompositingConfig::checkLoadedEffects() ui.messageBox->setText(i18ncp("Error Message shown when a desktop effect could not be loaded", "One desktop effect could not be loaded.", "%1 desktop effects could not be loaded.", disabledEffects.count())); - ui.messageBox->animatedShow(); + ui.messageBox->show(); } else { foreach (QWidget *w, m_showDetailedErrors->associatedWidgets()) w->setVisible(false); @@ -573,7 +573,7 @@ void KWinCompositingConfig::warn(QString message, QString details, QString dontA m_externErrorDetails = details.isNull() ? "" : details; foreach (QWidget *w, m_showDetailedErrors->associatedWidgets()) w->setVisible(!m_externErrorDetails.isEmpty()); - ui.messageBox->animatedShow(); + ui.messageBox->show(); } void KWinCompositingConfig::blockFutureWarnings() { @@ -586,7 +586,7 @@ void KWinCompositingConfig::blockFutureWarnings() { KConfig cfg(l.count() > 1 ? l.at(0) : "kwin_dialogsrc"); KConfigGroup(&cfg, "Notification Messages").writeEntry(l.last(), false); cfg.sync(); - ui.messageBox->animatedHide(); + ui.messageBox->hide(); } void KWinCompositingConfig::configChanged(bool reinitCompositing)