2022-07-05 10:13:48 +08:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
|
|
|
* Copyright (C) 2022 Tianjin KYLIN Information Technology Co., Ltd.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2023-04-21 10:03:57 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2022-07-05 10:13:48 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
2021-10-27 12:28:16 +08:00
|
|
|
#include "itemframe.h"
|
2021-12-01 11:07:21 +08:00
|
|
|
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QPalette>
|
|
|
|
|
2021-10-27 12:28:16 +08:00
|
|
|
#define LAYOUT_MARGINS 0,0,0,0
|
2021-12-01 11:07:21 +08:00
|
|
|
#define MAIN_LAYOUT_MARGINS 0,0,0,0
|
2021-10-27 12:28:16 +08:00
|
|
|
ItemFrame::ItemFrame(QString devName, QWidget *parent) : QFrame(parent)
|
|
|
|
{
|
|
|
|
deviceLanLayout = new QVBoxLayout(this);
|
|
|
|
deviceLanLayout->setContentsMargins(MAIN_LAYOUT_MARGINS);
|
|
|
|
lanItemFrame = new QFrame(this);
|
|
|
|
lanItemFrame->setFrameShape(QFrame::Shape::NoFrame);
|
|
|
|
|
|
|
|
lanItemLayout = new QVBoxLayout(this);
|
|
|
|
lanItemLayout->setContentsMargins(LAYOUT_MARGINS);
|
|
|
|
lanItemLayout->setSpacing(1);
|
2022-06-10 17:11:14 +08:00
|
|
|
addLanWidget = new AddNetBtn(false, this);
|
2021-10-27 12:28:16 +08:00
|
|
|
|
|
|
|
deviceLanLayout->setSpacing(1);
|
|
|
|
setLayout(deviceLanLayout);
|
|
|
|
lanItemFrame->setLayout(lanItemLayout);
|
|
|
|
|
|
|
|
deviceFrame = new DeviceFrame(devName, this);
|
|
|
|
deviceLanLayout->addWidget(deviceFrame);
|
|
|
|
deviceLanLayout->addWidget(lanItemFrame);
|
|
|
|
deviceLanLayout->addWidget(addLanWidget);
|
|
|
|
|
|
|
|
//下拉按钮
|
|
|
|
connect(deviceFrame->dropDownLabel, &DrownLabel::labelClicked, this, &ItemFrame::onDrownLabelClicked);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ItemFrame::onDrownLabelClicked()
|
|
|
|
{
|
|
|
|
if (!deviceFrame->dropDownLabel->isChecked) {
|
|
|
|
lanItemFrame->show();
|
|
|
|
deviceFrame->dropDownLabel->setDropDownStatus(true);
|
|
|
|
} else {
|
|
|
|
lanItemFrame->hide();
|
|
|
|
deviceFrame->dropDownLabel->setDropDownStatus(false);
|
|
|
|
}
|
|
|
|
}
|