copyfinish

This commit is contained in:
zhangyuanyuan1 2022-04-08 16:21:24 +08:00
parent 5b19e942bb
commit 57d9a14eb6
7 changed files with 9 additions and 37 deletions

6
debian/files vendored
View File

@ -1,3 +1,3 @@
kylin-nm-dbgsym_3.0.1-1kylin54_arm64.ddeb debug optional automatic=yes
kylin-nm_3.0.1-1kylin54_arm64.buildinfo utils optional
kylin-nm_3.0.1-1kylin54_arm64.deb utils optional
kylin-nm-dbgsym_3.1.1-2021+1230_amd64.ddeb debug optional automatic=yes
kylin-nm_3.1.1-2021+1230_amd64.buildinfo utils optional
kylin-nm_3.1.1-2021+1230_amd64.deb utils optional

View File

@ -22,8 +22,8 @@ void DetailPage::setSSID(const QString &ssid) {
return;
}
// this->mSSIDLabel->setText(ssid);
m_formerlSsid = ssid;
this->mSSIDLabel->setText(fontMetrics().elidedText(ssid, Qt::ElideRight, 136, Qt::TextShowMnemonic));
m_formerSsid = ssid;
this->mSSIDLabel->setText(fontMetrics().elidedText(ssid, Qt::ElideRight, 90, Qt::TextShowMnemonic));
}
void DetailPage::setProtocol(const QString &protocol) {
@ -231,7 +231,7 @@ void DetailPage::setEnableOfSaveBtn() {
void DetailPage::on_btnCopyNetDetail_clicked()
{
if (!isCopyOk) {
m_ssidCopy += m_formerlSsid;
m_ssidCopy += m_formerSsid;
m_protocolCopy += this->mProtocol->text();
m_netDetailList << m_ssidCopy << m_protocolCopy;

View File

@ -82,7 +82,7 @@ private:
QClipboard * m_clipboard ;
QStringList m_netDetailList;
QString m_formerlSsid;
QString m_formerSsid;
QString m_formerIPV6;
QString m_ssidCopy = tr("SSID:");

View File

@ -126,15 +126,6 @@ CopyButton::CopyButton()
btnPal.setColor(QPalette::Button, color);
this->setPalette(btnPal);
// //设置“复制全部”消息提示
// m_copyTip = new KBallonTip();
// m_copyTip->setTipType(Nothing);
// m_copyTip->setFixedSize(90, 38);
// m_copyTip->setWindowFlags(Qt::FramelessWindowHint);
// m_copyTip->setAttribute(Qt::WA_TranslucentBackground, true);
// m_copyTip->setContentsMargins(15, 7, 0, 7);
// m_copyTip->setText(tr("Copy all"));
//设置“复制成功”消息弹窗格式
m_copiedTip = new KBallonTip();
m_copiedTip->setTipType(Normal);
@ -146,11 +137,6 @@ CopyButton::CopyButton()
CopyButton::~CopyButton()
{
if (m_copyTip != nullptr)
{
m_copyTip = nullptr;
delete m_copyTip;
}
if (m_copiedTip != nullptr)
{
m_copiedTip = nullptr;
@ -182,9 +168,8 @@ void CopyButton::mousePressEvent(QMouseEvent *event)
void CopyButton::mouseReleaseEvent(QMouseEvent *event)
{
//设置弹窗位置并显示
// QPoint m_mousePosition = event->globalPos();
QPoint m_copyBtnPosition = this->mapToGlobal(this->pos());
m_copiedTip->move(m_copyBtnPosition.x() - 500, m_copyBtnPosition.y() + 130);
m_copiedTip->move(m_copyBtnPosition.x() - 490, m_copyBtnPosition.y() + 130);
QPalette pal = GetTheme();
m_copiedTip->setPalette(pal);
// m_copiedTip->setTipTime(1500);
@ -198,21 +183,11 @@ void CopyButton::enterEvent(QEvent *event)
palette = GetTheme();
QToolTip::setPalette(palette);
this->setToolTip(tr("Copy all"));
//设置弹窗位置并显示
// m_copyBtnPosition = this->mapToGlobal(this->pos());
// m_copyTip->move(m_copyBtnPosition.x() - 395, m_copyBtnPosition.y() + 35);
// QPalette pal = GetTheme();
// m_copyTip->setPalette(pal);
// m_copyTip->setTipTime(2000);
// m_copyTip->showInfo();
return QPushButton::enterEvent(event);
}
void CopyButton::leaveEvent(QEvent *event)
{
if (m_copyTip != nullptr) {
m_copyTip->hide();
}
if (m_copiedTip != nullptr) {
m_copiedTip->hide();
}

View File

@ -79,9 +79,7 @@ public:
QPalette GetTheme();
private:
KBallonTip * m_copyTip = nullptr;
KBallonTip * m_copiedTip = nullptr;
// QPoint m_copyBtnPosition;
protected:
void mousePressEvent(QMouseEvent *event);

View File

@ -24,7 +24,6 @@
#define SECURITY_PAGE_NUM 3
#define CREATE_NET_PAGE_NUM 4
#define PAGE_MIN_HEIGHT 40
#define SSID_LENGTH_LIMIT 10
//extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed);

View File

@ -80,7 +80,7 @@ void messageOutput(QtMsgType type, const QMessageLogContext &context, const QStr
int main(int argc, char *argv[])
{
// initUkuiLog4qt("kylin-nm");
initUkuiLog4qt("kylin-nm");
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);