blob: d5985a66d36b642bb961b2f5bdb84a05ff2e5517 [file] [log] [blame]
Isa Nanic6e4a39a2018-12-04 14:26:02 -05001/****************************************************************************
Sébastien Blin68abac92019-01-02 17:41:31 -05002 * Copyright (C) 2018-2019 Savoir-faire Linux Inc. *
Isa Nanic6e4a39a2018-12-04 14:26:02 -05003 * Author: Isa Nanic <isa.nanic@savoirfairelinux.com> *
4 * *
5 * This library is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU Lesser General Public *
7 * License as published by the Free Software Foundation; either *
8 * version 2.1 of the License, or (at your option) any later version. *
9 * *
10 * This library 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 GNU *
13 * Lesser 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#include <QListWidgetItem>
19#include <QLineEdit>
20#include <QLabel>
21#include <QPushButton>
22
23
24
25class SettingsItemWidget : public QListWidgetItem
26{
27public:
28 SettingsItemWidget(int height, int index, bool banned, QListWidget* parent = nullptr);
29 ~SettingsItemWidget();
30
31 QPushButton* button_;
32
33private:
34 bool selected_ = false;
35 bool banned_ = false;
36 const int index_;
37 const int height_;
38
39 const int horMargin_ = 15;
40 const int verMargin_ = 8;
41
42 QLineEdit* nameEdit_;
43 QLabel* idlabel_;
44
45 void toggleEditable();
46 void finishEdit();
47
48 bool editable_ = false;
49};
50