--nextPart19733431.nctnikrExh Content-Type: multipart/mixed; boundary="Boundary-01=_gh5uHBmOYOyX9Gi" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_gh5uHBmOYOyX9Gi Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi all, The patch is almost finished. I would like to know what do you think about = it,=20 and more in particular with the KCM. I really don't know where to place thi= s=20 combo box. Right now is in a very, very bad place, probably the worst place= =20 in earth. So, where do you think this combo should go on the KCM ? =46or those which aren't going to test the patches, the KCM look is:=20 http://media.ereslibre.es/2008/02/stylekcm.png What do you think about the rest of the patch ? Let's say, I will commit next Monday (25) if no objections are presented. N= ote=20 that the KCM is excluded from this. The KCM will be improved till that day,= =20 I'm talking about the rest of the patch. Bye,=20 Rafael Fern=C3=A1ndez L=C3=B3pez GPG Fingerprint: B9F4 4730 43F8 FFDD CC5E BA8E 724E 406E 3F01 D070 --Boundary-01=_gh5uHBmOYOyX9Gi Content-Type: text/x-diff; charset="utf-8"; name="kdelibs.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="kdelibs.diff" Index: kio/kio/kfileitemdelegate.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kio/kio/kfileitemdelegate.cpp (revisi=C3=B3n: 777211) +++ kio/kio/kfileitemdelegate.cpp (copia de trabajo) @@ -22,7 +22,6 @@ #include =20 #include "kfileitemdelegate.h" =2D#include "kfileitemdelegate.moc" =20 #include #include @@ -42,6 +41,7 @@ #include #include #include +#include =20 #include "delegateanimationhandler_p.h" =20 @@ -687,6 +687,10 @@ KIO::AnimationState *KFileItemDelegate:: const QMod= elIndex &index, const QAbs= tractItemView *view) const { + if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::Simple= AnimationEffects)) { + return NULL; + } + if (index.column() =3D=3D KDirModel::Name) return animationHandler->animationState(option, index, view); =20 @@ -1335,4 +1339,7 @@ bool KFileItemDelegate::helpEvent(QHelpE } =20 =20 +#include "kfileitemdelegate.moc" + + // kate: space-indent on; indent-width 4; replace-tabs on; Index: kio/kfile/kimagefilepreview.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kio/kfile/kimagefilepreview.cpp (revisi=C3=B3n: 777211) +++ kio/kfile/kimagefilepreview.cpp (copia de trabajo) @@ -2,6 +2,7 @@ * This file is part of the KDE project * Copyright (C) 2001 Martin R. Jones * 2001 Carsten Pfeiffer + * 2008 Rafael Fern=C3=A1ndez L=C3=B3pez * * You can Freely distribute this program under the GNU Library General Pu= blic * License. See the file "COPYING" for the exact licensing terms. @@ -19,6 +20,7 @@ #include =20 #include +#include #include #include #include @@ -176,6 +178,7 @@ KIO::PreviewJob * KImageFilePreview::cre void KImageFilePreview::gotPreview( const KFileItem& item, const QPixmap& = pm ) { if (item.url() =3D=3D d->currentURL) { // should always be the case + if (KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::Simp= leAnimationEffects) { if (d->m_timeLine->state() =3D=3D QTimeLine::Running) { d->m_timeLine->setCurrentTime(0); } @@ -186,6 +189,11 @@ void KImageFilePreview::gotPreview( cons d->m_timeLine->setDirection(QTimeLine::Forward); d->m_timeLine->start(); } + else + { + d->imageLabel->setPixmap(pm); + } + } } =20 void KImageFilePreview::KImageFilePreviewPrivate::_k_slotFailed( const KFi= leItem& item ) @@ -250,12 +258,18 @@ void KImageFilePreview::clearPreview() return; } =20 + if (KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAn= imationEffects) { d->m_pmTransition =3D QPixmap(); d->m_timeLine->setCurrentTime(0); d->m_timeLine->setDirection(QTimeLine::Backward); d->m_timeLine->start(); d->currentURL =3D KUrl(); d->clear =3D true; + } + else + { + d->imageLabel->clear(); + } } =20 #include "kimagefilepreview.moc" Index: kio/kfile/kimagefilepreview.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kio/kfile/kimagefilepreview.h (revisi=C3=B3n: 777211) +++ kio/kfile/kimagefilepreview.h (copia de trabajo) @@ -3,6 +3,7 @@ * This file is part of the KDE project. * Copyright (C) 2001 Martin R. Jones * 2001 Carsten Pfeiffer + * 2008 Rafael Fern=C3=A1ndez L=C3=B3pez * * You can Freely distribute this program under the GNU Library General Pu= blic * License. See the file "COPYING" for the exact licensing terms. Index: kdeui/kernel/kglobalsettings.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdeui/kernel/kglobalsettings.h (revisi=C3=B3n: 777211) +++ kdeui/kernel/kglobalsettings.h (copia de trabajo) @@ -407,6 +407,33 @@ public: */ static bool showIconsOnPushButtons(); =20 + enum GraphicEffect { + NoEffects =3D 0x0000, ///< GUI with no effects at al= l. + GradientEffects =3D 0x0001, ///< GUI with only gradients e= nabled. + SimpleAnimationEffects =3D 0x0002, ///< GUI with simple animation= s enabled. + ComplexAnimationEffects =3D 0x0006 ///< GUI with complex animatio= ns enabled. + ///< Note that ComplexAnimations= Effects implies SimpleAnimationEffects. + }; + + Q_DECLARE_FLAGS(GraphicEffects, GraphicEffect) + + /** + * This function determines the desired level of effects on the GUI. + * + * @return Returns true if user wants builtin animations to be enabled. + * + * @since 4.1 + */ + static GraphicEffects graphicEffectsLevel(); + + /** + * This function determines the default level of effects on the GUI + * depending on the system capabilities. + * + * @since 4.1 + */ + static GraphicEffects graphicEffectsLevelDefault(); + /** * This function determines if the user wishes to see previews * for the selected url @@ -550,4 +577,6 @@ private: Q_PRIVATE_SLOT(d, void _k_slotNotifyChange(int, int)) }; =20 +Q_DECLARE_OPERATORS_FOR_FLAGS(KGlobalSettings::GraphicEffects) + #endif Index: kdeui/kernel/kglobalsettings.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdeui/kernel/kglobalsettings.cpp (revisi=C3=B3n: 777211) +++ kdeui/kernel/kglobalsettings.cpp (copia de trabajo) @@ -86,6 +86,7 @@ static QFont *_taskbarFont =3D 0; static QFont *_largeFont =3D 0; static QFont *_smallestReadableFont =3D 0; //static QColor *_buttonBackground =3D 0; +static KGlobalSettings::GraphicEffects _grafficEffects =3D KGlobalSettings= ::NoEffects; =20 static KGlobalSettings::KMouseSettings *s_mouseSettings =3D 0; =20 @@ -126,17 +127,21 @@ class KGlobalSettings::Private */ static void initPaths(); /** =2D * drop cached values for fonts (called by KApplication) + * drop cached values for fonts */ static void rereadFontSettings(); /** =2D * drop cached values for paths (called by KApplication) + * drop cached values for paths */ static void rereadPathSettings(); /** =2D * drop cached values for mouse settings (called by KApplication) + * drop cached values for mouse settings */ static void rereadMouseSettings(); + /** + * drop cached values for settings that aren't in any of the previ= ous groups + */ + static void rereadOtherSettings(); =20 KGlobalSettings *q; }; @@ -736,6 +741,29 @@ bool KGlobalSettings::showIconsOnPushBut KDE_DEFAULT_ICON_ON_PUSHBUTTON); } =20 +KGlobalSettings::GraphicEffects KGlobalSettings::graphicEffectsLevel() +{ + // This variable stores whether _grafficEffects has the default value = because it has not been + // loaded yet, or if it has been loaded from the user settings or defa= ults and contains a valid + // value. + static bool _grafficEffectsInitialized =3D false; + + if (!_grafficEffectsInitialized) { + _grafficEffectsInitialized =3D true; + Private::rereadOtherSettings(); + } + + return _grafficEffects; +} + +KGlobalSettings::GraphicEffects KGlobalSettings::graphicEffectsLevelDefaul= t() +{ + // For now, let always enable animations by default. The plan is to ma= ke + // this code a bit smarter. (ereslibre) + + return ComplexAnimationEffects; +} + bool KGlobalSettings::showFilePreview(const KUrl &url) { KConfigGroup g(KGlobal::config(), "PreviewSettings"); @@ -792,6 +820,7 @@ void KGlobalSettings::Private::_k_slotNo =20 case SettingsChanged: { KGlobal::config()->reparseConfiguration(); + rereadOtherSettings(); SettingsCategory category =3D static_cast(arg); if (category =3D=3D SETTINGS_PATHS) { KGlobalSettings::Private::rereadPathSettings(); @@ -988,6 +1017,23 @@ void KGlobalSettings::Private::kdisplayS } =20 =20 +void KGlobalSettings::Private::rereadOtherSettings() +{ + KConfigGroup g( KGlobal::config(), "KDE-Global GUI Settings" ); + + // Asking for hasKey we do not ask for graphicEffectsLevelDefault() th= at can + // contain some very slow code. If we can save that time, do it. (eres= libre) + + if (g.hasKey("GrafficEffectsLevel")) { + _grafficEffects =3D ((GraphicEffects) g.readEntry("GrafficEffectsL= evel", QVariant((int) NoEffects)).toInt()); + + return; + } + + _grafficEffects =3D KGlobalSettings::graphicEffectsLevelDefault(); +} + + void KGlobalSettings::Private::applyCursorTheme() { #if defined(Q_WS_X11) && defined(HAVE_XCURSOR) Index: kdeui/widgets/kfadewidgeteffect.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdeui/widgets/kfadewidgeteffect.cpp (revisi=C3=B3n: 777211) +++ kdeui/widgets/kfadewidgeteffect.cpp (copia de trabajo) @@ -22,6 +22,7 @@ #include "kfadewidgeteffect_p.h" #include #include +#include =20 KFadeWidgetEffectPrivate::KFadeWidgetEffectPrivate(QWidget *_destWidget) : destWidget(_destWidget) @@ -29,9 +30,10 @@ KFadeWidgetEffectPrivate::KFadeWidgetEff } =20 KFadeWidgetEffect::KFadeWidgetEffect(QWidget *destWidget) =2D : QWidget(destWidget && destWidget->parentWidget() ? destWidget->par= entWidget() : destWidget) + : QWidget(destWidget) , d_ptr(new KFadeWidgetEffectPrivate(destWidget)) { + if (KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAn= imationEffects) { Q_D(KFadeWidgetEffect); d->q_ptr =3D this; Q_ASSERT(destWidget && destWidget->parentWidget()); @@ -41,6 +43,9 @@ KFadeWidgetEffect::KFadeWidgetEffect(QWi connect(&d->timeLine, SIGNAL(finished()), SLOT(finished())); connect(&d->timeLine, SIGNAL(frameChanged(int)), SLOT(repaint())); show(); + } else { + deleteLater(); + } } =20 KFadeWidgetEffect::~KFadeWidgetEffect() Index: kdeui/widgets/klineedit.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdeui/widgets/klineedit.cpp (revisi=C3=B3n: 777211) +++ kdeui/widgets/klineedit.cpp (copia de trabajo) @@ -89,6 +89,15 @@ public: // delete completionBox; } =20 + void _k_slotSettingsChanged(int category) + { + Q_UNUSED(category); + + if (clearButton) { + clearButton->setAnimationsEnabled(KGlobalSettings::graphicEffe= ctsLevel() & KGlobalSettings::SimpleAnimationEffects); + } + } + static bool initialized; static bool backspacePerformsCompletion; // Configuration option =20 @@ -186,6 +195,8 @@ void KLineEdit::init() mode =3D=3D KGlobalSettings::CompletionAuto); connect( this, SIGNAL(selectionChanged()), this, SLOT(slotRestoreSelec= tionColors())); =20 + connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), this, S= LOT(_k_slotSettingsChanged(int))); + QPalette p =3D palette(); if ( !d->previousHighlightedTextColor.isValid() ) d->previousHighlightedTextColor=3Dp.color(QPalette::Normal,QPalette:= :HighlightedText); Index: kdeui/widgets/kmainwindow_p.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdeui/widgets/kmainwindow_p.h (revisi=C3=B3n: 777211) +++ kdeui/widgets/kmainwindow_p.h (copia de trabajo) @@ -52,6 +52,9 @@ public: QString dbusName; =20 void _k_shuttingDown(); + // This slot will be called when the style KCM changes settings that n= eed + // to be set on the already running applications. + void _k_slotSettingsChanged(int category); =20 void init(KMainWindow *_q); void polish(KMainWindow *q); Index: kdeui/widgets/kmainwindow.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdeui/widgets/kmainwindow.h (revisi=C3=B3n: 777211) +++ kdeui/widgets/kmainwindow.h (copia de trabajo) @@ -701,6 +701,7 @@ protected: KMainWindowPrivate * const k_ptr; private: Q_PRIVATE_SLOT(k_func(), void _k_shuttingDown()) + Q_PRIVATE_SLOT(k_func(), void _k_slotSettingsChanged(int)) }; =20 #define RESTORE(type) { int n =3D 1;\ Index: kdeui/widgets/klineedit.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdeui/widgets/klineedit.h (revisi=C3=B3n: 777211) +++ kdeui/widgets/klineedit.h (copia de trabajo) @@ -625,6 +625,8 @@ private: private: class KLineEditPrivate; KLineEditPrivate *const d; + + Q_PRIVATE_SLOT( d, void _k_slotSettingsChanged( int category ) ); }; =20 #endif Index: kdeui/widgets/kmainwindow.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdeui/widgets/kmainwindow.cpp (revisi=C3=B3n: 777211) +++ kdeui/widgets/kmainwindow.cpp (copia de trabajo) @@ -58,6 +58,7 @@ #include #include #include +#include =20 #if defined Q_WS_X11 #include @@ -219,6 +220,8 @@ void KMainWindowPrivate::init(KMainWindo { q =3D _q; =20 + q->setAnimated(KGlobalSettings::graphicEffectsLevel() & KGlobalSetting= s::SimpleAnimationEffects); + q->setAttribute( Qt::WA_DeleteOnClose ); =20 KWhatsThisManager::init (); @@ -227,6 +230,8 @@ void KMainWindowPrivate::init(KMainWindo =20 //actionCollection()->setWidget( this ); QObject::connect(qApp, SIGNAL(aboutToQuit()), q, SLOT(_k_shuttingDown(= ))); + QObject::connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), + q, SLOT(_k_slotSettingsChanged(int))); =20 // force KMWSessionManager creation - someone a better idea? ksm->dummyInit(); @@ -1006,6 +1011,19 @@ void KMainWindowPrivate::_k_shuttingDown } } =20 +void KMainWindowPrivate::_k_slotSettingsChanged(int category) +{ + Q_UNUSED(category); + + // This slot will be called when the style KCM changes settings that n= eed + // to be set on the already running applications. + + // At this level (KMainWindow) the only thing we need to restore is the + // animations setting (whether the user wants builtin animations or no= t). + + q->setAnimated(KGlobalSettings::graphicEffectsLevel() & KGlobalSetting= s::SimpleAnimationEffects); +} + KToolBar *KMainWindow::toolBar( const QString& name ) { QString childName =3D name; Index: kdeui/widgets/klineedit_p.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kdeui/widgets/klineedit_p.h (revisi=C3=B3n: 777211) +++ kdeui/widgets/klineedit_p.h (copia de trabajo) @@ -27,6 +27,8 @@ #include #include =20 +#include + class KLineEditButton : public QWidget { Q_OBJECT @@ -67,8 +69,12 @@ public: m_timeline->setDuration(250); } =20 + if (KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::Simp= leAnimationEffects) { if (m_timeline->state() !=3D QTimeLine::Running) m_timeline->start(); + } else { + setVisible(m_timeline->direction() =3D=3D QTimeLine::Forward); + } } =20 void setPixmap(const QPixmap& p) @@ -81,11 +87,25 @@ public: return m_pixmap; } =20 + void setAnimationsEnabled(bool animationsEnabled) + { + // We need to set the current time in the case that we had the cle= ar + // button shown, for it being painted on the paintEvent(). Otherwi= se + // it wont be painted, resulting (m->timeLine->currentTime() =3D= =3D 0) true, + // and therefore a bad painting. This is needed for the case that = we + // come from a non animated widget and want it animated. (ereslibr= e) + if ((KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::Sim= pleAnimationEffects) && + m_timeline->direction() =3D=3D QTimeLine::Forward) { + m_timeline->setCurrentTime(150); + } + } + protected: void paintEvent(QPaintEvent *event) { Q_UNUSED(event) =20 + if (KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::Simp= leAnimationEffects) { if (m_pixmap.isNull() || m_timeline->currentTime() =3D=3D 0) { return; } @@ -95,6 +115,13 @@ protected: p.drawPixmap((width() - m_pixmap.width()) / 2, (height() - m_pixmap.height()) / 2, m_pixmap); + } else { + QPainter p(this); + p.setOpacity(1); // make sure + p.drawPixmap((width() - m_pixmap.width()) / 2, + (height() - m_pixmap.height()) / 2, + m_pixmap); + } } =20 protected slots: --Boundary-01=_gh5uHBmOYOyX9Gi Content-Type: text/x-diff; charset="utf-8"; name="kdebase.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="kdebase.diff" Index: workspace/kcontrol/style/kcmstyle.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- workspace/kcontrol/style/kcmstyle.h (revisi=C3=B3n: 777211) +++ workspace/kcontrol/style/kcmstyle.h (copia de trabajo) @@ -152,6 +152,7 @@ private: QComboBox* comboToolbarIcons; =20 QCheckBox* cbIconsOnButtons; + QComboBox* comboGraphicEffectsLevel; QCheckBox* cbTearOffHandles; }; =20 Index: workspace/kcontrol/style/kcmstyle.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- workspace/kcontrol/style/kcmstyle.cpp (revisi=C3=B3n: 777211) +++ workspace/kcontrol/style/kcmstyle.cpp (copia de trabajo) @@ -210,6 +210,14 @@ KCMStyle::KCMStyle( QWidget* parent, con =20 cbIconsOnButtons =3D new QCheckBox( i18n("Sho&w icons on buttons"), gbWid= getStyle ); gbWidgetStyleLayout->addWidget( cbIconsOnButtons ); + comboGraphicEffectsLevel =3D new KComboBox( gbWidgetStyle ); + comboGraphicEffectsLevel->setObjectName( "cbGraphicEffectsLevel" ); + comboGraphicEffectsLevel->setEditable( false ); + comboGraphicEffectsLevel->addItem(i18n("No Graphic Effects"), KGlobalSett= ings::NoEffects); + comboGraphicEffectsLevel->addItem(i18n("Gradient Effects"), KGlobalSettin= gs::GradientEffects); + comboGraphicEffectsLevel->addItem(i18n("Simple Animation Effects"), KGlob= alSettings::SimpleAnimationEffects); + comboGraphicEffectsLevel->addItem(i18n("Complex Animation Effects"), KGlo= balSettings::ComplexAnimationEffects); + gbWidgetStyleLayout->addWidget( comboGraphicEffectsLevel ); cbEnableTooltips =3D new QCheckBox( i18n("E&nable tooltips"), gbWidgetSty= le ); gbWidgetStyleLayout->addWidget( cbEnableTooltips ); cbTearOffHandles =3D new QCheckBox( i18n("Show tear-off handles in &popup= menus"), gbWidgetStyle ); @@ -401,6 +409,7 @@ KCMStyle::KCMStyle( QWidget* parent, con connect( cbTransparentToolbars, SIGNAL(toggled(bool)), this, SLOT(setTo= olbarsDirty())); connect( cbEnableTooltips, SIGNAL(toggled(bool)), this, SLOT(setEff= ectsDirty())); connect( cbIconsOnButtons, SIGNAL(toggled(bool)), this, SLOT(setEff= ectsDirty())); + connect( comboGraphicEffectsLevel, SIGNAL(activated(int)), this, SLOT(s= etEffectsDirty())); connect( cbTearOffHandles, SIGNAL(toggled(bool)), this, SLOT(setEff= ectsDirty())); connect( comboToolbarIcons, SIGNAL(activated(int)), this, SLOT(setTool= barsDirty())); =20 @@ -614,6 +623,8 @@ void KCMStyle::save() =20 // Misc page config.writeEntry( "ShowIconsOnPushButtons", cbIconsOnButtons->isChecked(= ), KConfig::Normal|KConfig::Global); + KConfigGroup g( &_config, "KDE-Global GUI Settings" ); + g.writeEntry( "GrafficEffectsLevel", comboGraphicEffectsLevel->itemDat= a(comboGraphicEffectsLevel->currentIndex()), KConfig::Normal|KConfig::Globa= l); config.writeEntry( "EffectNoTooltip", !cbEnableTooltips->isChecked(), KCo= nfig::Normal|KConfig::Global); =20 KConfigGroup generalGroup(&_config, "General"); @@ -734,6 +745,7 @@ void KCMStyle::defaults() cbEnableTooltips->setChecked(true); comboToolbarIcons->setCurrentIndex(0); cbIconsOnButtons->setChecked(true); + comboGraphicEffectsLevel->setCurrentIndex(comboGraphicEffectsLevel->findD= ata(((int) KGlobalSettings::graphicEffectsLevelDefault()))); cbTearOffHandles->setChecked(false); } =20 @@ -1067,6 +1079,8 @@ void KCMStyle::loadMisc( KConfig& config cbIconsOnButtons->setChecked(configGroup.readEntry("ShowIconsOnPushButton= s", true)); cbEnableTooltips->setChecked(!configGroup.readEntry("EffectNoTooltip", fa= lse)); cbTearOffHandles->setChecked(configGroup.readEntry("InsertTearOffHandle",= false)); + configGroup =3D config.group("KDE-Global GUI Settings"); + comboGraphicEffectsLevel->setCurrentIndex(comboGraphicEffectsLevel->fi= ndData(configGroup.readEntry("GrafficEffectsLevel", ((int) KGlobalSettings:= :graphicEffectsLevel())))); =20 m_bToolbarsDirty =3D false; } @@ -1123,6 +1137,8 @@ void KCMStyle::addWhatsThis() "Text is aligned below the icon.") ); cbIconsOnButtons->setWhatsThis( i18n( "If you enable this option, KDE App= lications will " "show small icons alongside some important buttons.") ); + comboGraphicEffectsLevel->setWhatsThis( i18n( "If you enable this option,= KDE Applications will " + "run internal animations.") ); cbTearOffHandles->setWhatsThis( i18n( "If you enable this option some pop= =2Dup menus will " "show so called tear-off handles. If you click them, you get the me= nu " "inside a widget. This can be very helpful when performing " Index: workspace/libs/plasma/phase.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- workspace/libs/plasma/phase.cpp (revisi=C3=B3n: 777211) +++ workspace/libs/plasma/phase.cpp (copia de trabajo) @@ -26,6 +26,7 @@ #include #include #include +#include =20 #include "animator.h" #include "widgets/widget.h" @@ -117,6 +118,10 @@ class Phase::Private =20 qreal calculateProgress(int frames, int currentFrame) { + if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings= ::SimpleAnimationEffects)) { + return qreal(1.0); + } + qreal progress =3D frames; progress =3D currentFrame / progress; progress =3D qMin(qreal(1.0), qMax(qreal(0.0), progress)); @@ -156,6 +161,7 @@ class Phase::Private break; } } + Animator* animator; int animId; int timerId; @@ -497,7 +503,8 @@ void Phase::timerEvent(QTimerEvent *even foreach (AnimationState* state, d->animatedItems) { if (state->currentInterval <=3D elapsed) { // we need to step forward! =2D state->currentFrame +=3D qMax(1, elapsed / state->interval); + state->currentFrame +=3D (KGlobalSettings::graphicEffectsLevel= () & KGlobalSettings::SimpleAnimationEffects) ? + qMax(1, elapsed / state->interval) : st= ate->frames - state->currentFrame; =20 if (state->currentFrame < state->frames) { qreal progress =3D d->calculateProgress(state->frames, sta= te->currentFrame); @@ -521,7 +528,8 @@ void Phase::timerEvent(QTimerEvent *even foreach (MovementState* state, d->movingItems) { if (state->currentInterval <=3D elapsed) { // we need to step forward! =2D state->currentFrame +=3D qMax(1, elapsed / state->interval); + state->currentFrame +=3D (KGlobalSettings::graphicEffectsLevel= () & KGlobalSettings::SimpleAnimationEffects) ? + qMax(1, elapsed / state->interval) : st= ate->frames - state->currentFrame; =20 if (state->currentFrame < state->frames) { d->performMovement(d->calculateProgress(state->frames, sta= te->currentFrame), state); @@ -555,7 +563,8 @@ void Phase::timerEvent(QTimerEvent *even /*kDebug() << "stepping forwards element anim " << state->id <= < " from " << state->currentFrame << " by " << qMax(1, elapsed / state->interval) << " t= o " << state->currentFrame + qMax(1, elapsed / state->inte= rval) << endl;*/ =2D state->currentFrame +=3D qMax(1, elapsed / state->interval); + state->currentFrame +=3D (KGlobalSettings::graphicEffectsLevel= () & KGlobalSettings::SimpleAnimationEffects) ? + qMax(1, elapsed / state->interval) : st= ate->frames - state->currentFrame; // nasty hack because QGraphicsItem::update isn't virtual! // FIXME: remove in 4.1 as we will no longer need the caching = in Plasma::Widget with Qt 4.4 Plasma::Widget *widget =3D dynamic_cast(state= =2D>item); @@ -584,7 +593,8 @@ void Phase::timerEvent(QTimerEvent *even foreach (CustomAnimationState *state, d->customAnims) { if (state->currentInterval <=3D elapsed) { // advance the frame =2D state->currentFrame +=3D qMax(1, elapsed / state->interval); + state->currentFrame +=3D (KGlobalSettings::graphicEffectsLevel= () & KGlobalSettings::SimpleAnimationEffects) ? + qMax(1, elapsed / state->interval) : st= ate->frames - state->currentFrame; /*kDebug() << "custom anim for" << state->receiver << "to slot= " << state->slot << "with interval of" << state->interval << "at frame= " << state->currentFrame;*/ =20 --Boundary-01=_gh5uHBmOYOyX9Gi-- --nextPart19733431.nctnikrExh Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iD8DBQBHu5hkck5Abj8B0HARAunMAKDeqNySjLKix4PRyrfWCZfJ+NZaawCeJGKZ 0yO/fvGrrMnhYZGyScle8B8= =OHn+ -----END PGP SIGNATURE----- --nextPart19733431.nctnikrExh--