Changeset View
Changeset View
Standalone View
Standalone View
lib/thumbnailview/previewitemdelegate.cpp
Show All 32 Lines | |||||
33 | #include <QPropertyAnimation> | 33 | #include <QPropertyAnimation> | ||
34 | #include <QSequentialAnimationGroup> | 34 | #include <QSequentialAnimationGroup> | ||
35 | #include <QUrl> | 35 | #include <QUrl> | ||
36 | #include <QEvent> | 36 | #include <QEvent> | ||
37 | #include <QHoverEvent> | 37 | #include <QHoverEvent> | ||
38 | #include <QDateTime> | 38 | #include <QDateTime> | ||
39 | #include <QDebug> | 39 | #include <QDebug> | ||
40 | #include <QToolButton> | 40 | #include <QToolButton> | ||
41 | 41 | | |||
42 | // KDE | 42 | // KDE | ||
rkflx: Oops, I missed to catch that… | |||||
43 | #include <KDirModel> | 43 | #include <KDirModel> | ||
44 | #include <KIconLoader> | 44 | #include <KIconLoader> | ||
45 | 45 | | |||
46 | #ifndef GWENVIEW_SEMANTICINFO_BACKEND_NONE | 46 | #ifndef GWENVIEW_SEMANTICINFO_BACKEND_NONE | ||
47 | #include <kratingpainter.h> | 47 | #include <kratingpainter.h> | ||
48 | #endif | 48 | #endif | ||
49 | 49 | | |||
50 | // Local | 50 | // Local | ||
51 | #include "archiveutils.h" | 51 | #include "archiveutils.h" | ||
52 | #include "itemeditor.h" | 52 | #include "itemeditor.h" | ||
53 | #include "paintutils.h" | 53 | #include "paintutils.h" | ||
54 | #include "thumbnailview.h" | 54 | #include "thumbnailview.h" | ||
55 | #include "timeutils.h" | 55 | #include "timeutils.h" | ||
56 | #include "tooltipwidget.h" | 56 | #include "tooltipwidget.h" | ||
57 | #ifndef GWENVIEW_SEMANTICINFO_BACKEND_NONE | 57 | #ifndef GWENVIEW_SEMANTICINFO_BACKEND_NONE | ||
58 | #include "../semanticinfo/semanticinfodirmodel.h" | 58 | #include "../semanticinfo/semanticinfodirmodel.h" | ||
59 | #endif | 59 | #endif | ||
60 | 60 | | |||
61 | // Define this to be able to fine tune the rendering of the selection | 61 | // Define this to be able to fine tune the rendering of the selection | ||
If at all this should read cstdio, but I don't see why you would need both lines ;) For debugging, just use qDebug () << "text" << variable;, for some types there are even nice pretty-printers. https://doc.qt.io/qt-5/qdebug.html rkflx: If at all this should read `cstdio`, but I don't see why you would need both lines ;)
For… | |||||
Damn, left those in! Thanks for the tip with debugging, hadn't actually bothered to research that... :/ huoni: Damn, left those in! Thanks for the tip with debugging, hadn't actually bothered to research… | |||||
62 | // background through a config file | 62 | // background through a config file | ||
63 | //#define FINETUNE_SELECTION_BACKGROUND | 63 | //#define FINETUNE_SELECTION_BACKGROUND | ||
64 | #ifdef FINETUNE_SELECTION_BACKGROUND | 64 | #ifdef FINETUNE_SELECTION_BACKGROUND | ||
65 | #include <QDir> | 65 | #include <QDir> | ||
66 | #include <QSettings> | 66 | #include <QSettings> | ||
67 | #endif | 67 | #endif | ||
68 | 68 | | |||
69 | //#define DEBUG_DRAW_BORDER | 69 | //#define DEBUG_DRAW_BORDER | ||
▲ Show 20 Lines • Show All 404 Lines • ▼ Show 20 Line(s) | 367 | #endif | |||
474 | } | 474 | } | ||
475 | 475 | | |||
476 | void hideToolTip() | 476 | void hideToolTip() | ||
477 | { | 477 | { | ||
478 | if (!mToolTip) { | 478 | if (!mToolTip) { | ||
479 | return; | 479 | return; | ||
480 | } | 480 | } | ||
481 | QSequentialAnimationGroup* anim = new QSequentialAnimationGroup(); | 481 | QSequentialAnimationGroup* anim = new QSequentialAnimationGroup(); | ||
482 | if (mToolTipAnimation->state() == QPropertyAnimation::Stopped) { | ||||
482 | anim->addPause(500); | 483 | anim->addPause(500); | ||
484 | } | ||||
rkflx: `((…))` → `(…)` | |||||
huoni: Ugh, another one left over from all the testing I did. | |||||
483 | QPropertyAnimation* fadeOut = new QPropertyAnimation(mToolTip, "opacity"); | 485 | QPropertyAnimation* fadeOut = new QPropertyAnimation(mToolTip, "opacity"); | ||
484 | fadeOut->setStartValue(mToolTip->opacity()); | 486 | fadeOut->setStartValue(mToolTip->opacity()); | ||
485 | fadeOut->setEndValue(0.); | 487 | fadeOut->setEndValue(0.); | ||
486 | anim->addAnimation(fadeOut); | 488 | anim->addAnimation(fadeOut); | ||
487 | mToolTipAnimation.reset(anim); | 489 | mToolTipAnimation.reset(anim); | ||
488 | mToolTipAnimation->start(); | 490 | mToolTipAnimation->start(); | ||
489 | QObject::connect(anim, &QSequentialAnimationGroup::finished, mToolTip.data(), &ToolTipWidget::deleteLater); | 491 | QObject::connect(anim, &QSequentialAnimationGroup::finished, mToolTip.data(), &ToolTipWidget::deleteLater); | ||
490 | } | 492 | } | ||
▲ Show 20 Lines • Show All 466 Lines • Show Last 20 Lines |
Oops, I missed to catch that…