KGuiAddons

kiconutils.h
1/*
2 SPDX-FileCopyrightText: 2013 Martin Klapetek <mklapetek@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef KICONUTILS_H
8#define KICONUTILS_H
9
10#include <kguiaddons_export.h>
11
12#include <QIcon>
13
14/**
15 * @namespace KIconUtils
16 * Provides utility functions for icons.
17 */
18namespace KIconUtils
19{
20/**
21 * Adds the \a overlay over the \a icon in the specified \a position
22 *
23 * The \a overlay icon is scaled down approx. to 1/3 or 1/4 (depending on the icon size)
24 * and placed in one of the corners of the base icon.
25 */
26KGUIADDONS_EXPORT QIcon addOverlay(const QIcon &icon, const QIcon &overlay, Qt::Corner position);
27
28/**
29 * Adds \a overlays over the \a icon
30 *
31 * The \a overlays is a QHash of Qt::Corner and QIcon. The Qt::Corner value
32 * decides where the overlay icon will be painted, the QIcon value
33 * is the overlay icon to be painted.
34 *
35 * The overlay icon is scaled down to 1/3 or 1/4 (depending on the icon size)
36 * and placed in one of the corners of the base icon.
37 */
38KGUIADDONS_EXPORT QIcon addOverlays(const QIcon &icon, const QHash<Qt::Corner, QIcon> &overlays);
39
40/**
41 * Adds up to four overlays over the @p icon.
42 *
43 * The @p overlays is a QStringList of icon names (e.g. the emblems that are drawn on
44 * icons in Dolphin and KFileWidget, e.g. symlink, un-mounted device ...etc).
45 *
46 * Overlays are added in this order:
47 * - first icon is used to paint an overlay on the bottom-right corner
48 * - second icon on the bottom-left corner
49 * - third icon on the top-left corner
50 * - fourth icon on the top-right corner
51 *
52 * Each overlay icon is scaled down to 1/3 or 1/4 (depending on the icon size).
53 *
54 * @since 5.90
55 */
56KGUIADDONS_EXPORT QIcon addOverlays(const QIcon &icon, const QStringList &overlays);
57
58/**
59 * Adds up to four overlays on the icon constructed from @p iconName.
60 *
61 * The @p overlays is a QStringList of icon names (e.g. the emblems that are drawn on
62 * icons in Dolphin and KFileWidget, e.g. symlink, un-mounted device ...etc).
63 *
64 * Overlays are added in this order:
65 * - first icon is used to paint an overlay on the bottom-right corner
66 * - second icon on the bottom-left corner
67 * - third icon on the top-left corner
68 * - fourth icon on the top-right corner
69 *
70 * Each overlay icon is scaled down to 1/3 or 1/4 (depending on the icon size).
71 *
72 * All @c QIcon objects are constructed using @c QIcon::fromTheme().
73 *
74 * @since 5.82
75 */
76KGUIADDONS_EXPORT QIcon addOverlays(const QString &iconName, const QStringList &overlays);
77}
78
79#endif // KICONUTILS_H
Provides utility functions for icons.
QIcon addOverlays(const QIcon &icon, const QHash< Qt::Corner, QIcon > &overlays)
Adds overlays over the icon.
QIcon addOverlay(const QIcon &icon, const QIcon &overlay, Qt::Corner position)
Adds the overlay over the icon in the specified position.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:14:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.