托盘ui微调 翻译文件

This commit is contained in:
zhangyuanyuan1 2023-04-10 17:39:08 +08:00
parent c87184a139
commit e46ba714e1
8 changed files with 60 additions and 77 deletions

Binary file not shown.

View File

@ -43,7 +43,7 @@ using namespace kdk;
#define MAIN_LAYOUT_SPACING 0
#define TITLE_FRAME_HEIGHT 60 //TabWidget的tab和widget有间隙和设计稿看起来一致就不能设为设计稿里的高度
#define TITLE_LAYOUT_MARGINS 24,0,24,0
#define NET_LAYOUT_MARGINS 8,8,8,8
#define NET_LAYOUT_MARGINS 8,8,0,8
#define TEXT_HEIGHT 20
#define SETTINGS_LAYOUT_MARGINS 23,0,24,0

View File

@ -147,11 +147,7 @@ void VpnPage::constructItemArea()
}
}
if (m_listWidget->count() <= MAX_ITEMS) {
m_listFrame->setFixedWidth(MIN_WIDTH);
} else {
m_listFrame->setFixedWidth(MAX_WIDTH);
}
resetListWidgetWidth();
}
void VpnPage::initVpnArea()
@ -174,14 +170,6 @@ void VpnPage::resetPageHeight()
m_listFrame->show();
m_netDivider->show();
}
for (int i = 0; i < m_mainLayout->count(); i ++) {
QWidget *w = m_mainLayout->itemAt(i)->widget();
if (w != nullptr && w->isHidden() != true) {
height += w->height();
}
}
this->setFixedHeight(height + PAGE_SPACE);
}
bool VpnPage::removeConnectionItem(QMap<QString, QListWidgetItem *> &connectMap,
@ -203,9 +191,7 @@ bool VpnPage::removeConnectionItem(QMap<QString, QListWidgetItem *> &connectMap,
p_listWidgetItem = nullptr;
iter = connectMap.erase(iter);
if (m_listWidget->count() <= MAX_ITEMS) {
m_listFrame->setFixedWidth(MIN_WIDTH);
}
resetListWidgetWidth();
return true;
}
}
@ -249,9 +235,7 @@ void VpnPage::onAddConnection(QString uuid) //新增一个有线
delete p_newItem;
p_newItem = nullptr;
if (m_listWidget->count() >= MAX_ITEMS) {
m_listFrame->setFixedWidth(MAX_WIDTH);
}
resetListWidgetWidth();
resetPageHeight();
resetWindowPosition();
this->update();
@ -338,9 +322,8 @@ void VpnPage::updateActivatedConnectionArea(KyConnectItem *p_newItem)
deleteConnectionMapItem(m_activeItemMap, m_listWidget, p_newItem->m_connectUuid);
QListWidgetItem *p_listWidgetItem = addNewItem(p_newItem, m_listWidget);
m_activeItemMap.insert(p_newItem->m_connectUuid, p_listWidgetItem);
if (m_listWidget->count() <= MAX_ITEMS) {
m_listFrame->setFixedWidth(MIN_WIDTH);
}
resetListWidgetWidth();
return;
}
@ -356,11 +339,7 @@ void VpnPage::updateConnectionArea(KyConnectItem *p_newItem)
QListWidgetItem *p_listWidgetItem = insertNewItem(p_newItem, m_listWidget);
m_vpnItemMap.insert(p_newItem->m_connectUuid, p_listWidgetItem);
if (m_listWidget->count() <= MAX_ITEMS) {
m_listFrame->setFixedWidth(MIN_WIDTH);
} else {
m_listFrame->setFixedWidth(MAX_WIDTH);
}
resetListWidgetWidth();
}
void VpnPage::updateConnectionState(QMap<QString, QListWidgetItem *> &connectMap,
@ -700,3 +679,12 @@ void VpnPage::resetWindowPosition()
kdk::WindowManager::setGeometry(this->windowHandle(), rect);
qDebug() << " Position of ukui-panel is " << position << "; Position of mainwindow is " << this->geometry() << "." << Q_FUNC_INFO << __LINE__;
}
void VpnPage::resetListWidgetWidth()
{
if (m_listWidget->count() <= MAX_ITEMS) {
m_listFrame->setFixedWidth(MIN_WIDTH);
} else {
m_listFrame->setFixedWidth(MAX_WIDTH);
}
}

View File

@ -97,7 +97,7 @@ private:
QListWidget *vpnListWidget, QString uuid);
void resetWindowPosition();
void resetListWidgetWidth();
Q_SIGNALS:
void vpnAdd(QStringList info);

View File

@ -0,0 +1 @@
<クd<>箆!ソ`。スン

View File

@ -80,6 +80,26 @@
<source>VPN Server</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="12"/>
<source>VPN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="41"/>
<source>Auto Connection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="53"/>
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="56"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>vpnConfigPage</name>
@ -90,7 +110,7 @@
</message>
</context>
<context>
<name>vpnDetail</name>
<name>VpnDetail</name>
<message>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="15"/>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="27"/>
@ -113,29 +133,6 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>vpnDetailPage</name>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="12"/>
<source>VPN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="41"/>
<source>Auto Connection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="53"/>
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="56"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>vpnObject</name>
<message>

Binary file not shown.

View File

@ -756,6 +756,26 @@ If key direction is used, it must be opposite to the VPN side used. If &apos;1&a
<source>VPN Server</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="12"/>
<source>VPN</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="41"/>
<source>Auto Connection</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="53"/>
<source>Confirm</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="56"/>
<source>Cancel</source>
<translation></translation>
</message>
</context>
<context>
<name>vpnConfigPage</name>
@ -765,7 +785,7 @@ If key direction is used, it must be opposite to the VPN side used. If &apos;1&a
</message>
</context>
<context>
<name>vpnDetail</name>
<name>VpnDetail</name>
<message>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="61"/>
<location filename="../frontend/vpndetails/vpndetail.cpp" line="145"/>
@ -804,29 +824,6 @@ If key direction is used, it must be opposite to the VPN side used. If &apos;1&a
<translation></translation>
</message>
</context>
<context>
<name>vpnDetailPage</name>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="12"/>
<source>VPN</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="41"/>
<source>Auto Connection</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="53"/>
<source>Confirm</source>
<translation></translation>
</message>
<message>
<location filename="../frontend/vpndetails/vpndetailpage.cpp" line="56"/>
<source>Cancel</source>
<translation></translation>
</message>
</context>
<context>
<name>vpnObject</name>
<message>