blob: 2d059e34e1f344c7ff3578a37e3f5ceb08268990 [file] [log] [blame]
Anthony Léonardf95f7f62017-04-04 11:01:51 -04001/***************************************************************************
2 * Copyright (C) 2017 by Savoir-faire Linux *
3 * Author: Anthony Léonard <anthony.leonard@savoirfairelinux.com> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
18
19#pragma once
20
21#include <QObject>
22#include <QItemDelegate>
23
24class ContactRequestItemDelegate : public QItemDelegate
25{
26public:
27 ContactRequestItemDelegate(QObject* parent = 0);
28
29protected:
30 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
31 QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
32
33private:
34 constexpr static int cellHeight_ = 60;
35 constexpr static int sizeImage_ = 48;
36 constexpr static int dxImage_ = 16;
37 constexpr static int dyImage_ = 6;
38
39 constexpr static int dxText_ = dxImage_ + sizeImage_ + 12;
40 constexpr static int dyText_ = 13;
41
42 constexpr static int separatorYPadding_ = 20;
43};