Changeset View
Changeset View
Standalone View
Standalone View
src/views/tooltips/tooltipmanager.h
Show All 36 Lines | |||||
37 | * a short timeout. The tooltip is hidden again when the | 37 | * a short timeout. The tooltip is hidden again when the | ||
38 | * viewport is hovered or the item view has been left. | 38 | * viewport is hovered or the item view has been left. | ||
39 | */ | 39 | */ | ||
40 | class ToolTipManager : public QObject | 40 | class ToolTipManager : public QObject | ||
41 | { | 41 | { | ||
42 | Q_OBJECT | 42 | Q_OBJECT | ||
43 | 43 | | |||
44 | public: | 44 | public: | ||
45 | enum class HideBehavior { | ||||
elvisangelaccio: I'd call this enum `HideBehavior`. It's already implied from the `ToolTipManager` class that we… | |||||
46 | Instantly, | ||||
47 | Later | ||||
elvisangelaccio: Comma not needed | |||||
48 | }; | ||||
49 | | ||||
45 | explicit ToolTipManager(QWidget* parent); | 50 | explicit ToolTipManager(QWidget* parent); | ||
46 | ~ToolTipManager() override; | 51 | ~ToolTipManager() override; | ||
47 | 52 | | |||
48 | /** | 53 | /** | ||
49 | * Triggers the showing of the tooltip for the item \p item | 54 | * Triggers the showing of the tooltip for the item \p item | ||
50 | * where the item has the maximum boundaries of \p itemRect. | 55 | * where the item has the maximum boundaries of \p itemRect. | ||
51 | * The tooltip manager takes care that the tooltip is shown | 56 | * The tooltip manager takes care that the tooltip is shown | ||
52 | * slightly delayed and with a proper \p transientParent. | 57 | * slightly delayed and with a proper \p transientParent. | ||
53 | */ | 58 | */ | ||
54 | void showToolTip(const KFileItem& item, const QRectF& itemRect, QWindow *transientParent); | 59 | void showToolTip(const KFileItem& item, const QRectF& itemRect, QWindow *transientParent); | ||
Please call this parameter hideIstantly. Bonus point if you use an enum instead of a bool ;) (see http://www.informit.com/articles/article.aspx?p=1392524) elvisangelaccio: Please call this parameter `hideIstantly`. Bonus point if you use an enum instead of a bool ;)… | |||||
55 | 60 | | |||
56 | /** | 61 | /** | ||
57 | * Hides the currently shown tooltip. | 62 | * Hides the currently shown tooltip. | ||
58 | */ | 63 | */ | ||
59 | void hideToolTip(); | 64 | void hideToolTip(const HideBehavior behavior = HideBehavior::Later); | ||
60 | 65 | | |||
61 | signals: | 66 | signals: | ||
62 | /** | 67 | /** | ||
63 | * Is emitted when the user clicks a tag or a link | 68 | * Is emitted when the user clicks a tag or a link | ||
64 | * in the metadata widget. | 69 | * in the metadata widget. | ||
65 | */ | 70 | */ | ||
66 | void urlActivated(const QUrl& url); | 71 | void urlActivated(const QUrl& url); | ||
67 | 72 | | |||
Show All 31 Lines |
I'd call this enum HideBehavior. It's already implied from the ToolTipManager class that we are talking about tooltips.