commit
08a3238420
|
@ -1,3 +1,12 @@
|
||||||
|
kylin-nm (4.10.0.0-ok0.11) nile; urgency=medium
|
||||||
|
|
||||||
|
* BUG:#IAPTDF 【gg-维哈柯】【VPN】点击托盘VPN按钮,窗口布局不正确
|
||||||
|
* 需求:无
|
||||||
|
* 其他改动说明:更新翻译
|
||||||
|
* 其他改动影响域:无
|
||||||
|
|
||||||
|
-- jiahua xie <xiejiahua@kylinos.cn> Fri, 30 Aug 2024 09:33:01 +0800
|
||||||
|
|
||||||
kylin-nm (4.10.0.0-ok0.10) nile; urgency=medium
|
kylin-nm (4.10.0.0-ok0.10) nile; urgency=medium
|
||||||
|
|
||||||
* BUG:#I9IYPM 任务栏网络模块,切换哈维柯语言时从右往左布局出现混乱
|
* BUG:#I9IYPM 任务栏网络模块,切换哈维柯语言时从右往左布局出现混乱
|
||||||
|
|
|
@ -30,6 +30,10 @@ VpnListItem::VpnListItem(const KyConnectItem *vpnConnectItem, QWidget *parent):L
|
||||||
m_deviceResource = new KyNetworkDeviceResourse(this);
|
m_deviceResource = new KyNetworkDeviceResourse(this);
|
||||||
|
|
||||||
connectItemCopy(vpnConnectItem);
|
connectItemCopy(vpnConnectItem);
|
||||||
|
char *envStr = getenv("LANGUAGE");
|
||||||
|
if (strcmp(envStr, "ug_CN") == 0 || strcmp(envStr, "kk_KZ") == 0 || strcmp(envStr, "ky_KG") == 0) {
|
||||||
|
this->setFixedWidth(390);
|
||||||
|
}
|
||||||
|
|
||||||
m_nameLabel->setText(m_vpnConnectItem.m_connectName);
|
m_nameLabel->setText(m_vpnConnectItem.m_connectName);
|
||||||
m_netButton->setButtonIcon(QIcon::fromTheme("ukui-vpn-symbolic"));
|
m_netButton->setButtonIcon(QIcon::fromTheme("ukui-vpn-symbolic"));
|
||||||
|
|
|
@ -684,11 +684,20 @@ void VpnPage::resetWindowPosition()
|
||||||
|
|
||||||
QRect availableGeo = QGuiApplication::screenAt(QCursor::pos())->geometry();
|
QRect availableGeo = QGuiApplication::screenAt(QCursor::pos())->geometry();
|
||||||
int x, y;
|
int x, y;
|
||||||
|
char *envStr = getenv("LANGUAGE");
|
||||||
switch(m_panelPosition){
|
switch(m_panelPosition){
|
||||||
case PANEL_TOP:
|
case PANEL_TOP:
|
||||||
//任务栏位于上方
|
//任务栏位于上方
|
||||||
|
/* 维吾尔语 ug_CN
|
||||||
|
* 哈萨克语 kk_KZ
|
||||||
|
* 柯尔克孜语 ky_KG */
|
||||||
|
if (strcmp(envStr, "ug_CN") == 0 || strcmp(envStr, "kk_KZ") == 0 || strcmp(envStr, "ky_KG") == 0) {
|
||||||
|
x = MARGIN;
|
||||||
|
y = availableGeo.y() + m_panelSize + MARGIN;
|
||||||
|
} else {
|
||||||
x = availableGeo.x() + availableGeo.width() - this->width() - MARGIN;
|
x = availableGeo.x() + availableGeo.width() - this->width() - MARGIN;
|
||||||
y = availableGeo.y() + m_panelSize + MARGIN;
|
y = availableGeo.y() + m_panelSize + MARGIN;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
//任务栏位于左边
|
//任务栏位于左边
|
||||||
case PANEL_LEFT:
|
case PANEL_LEFT:
|
||||||
|
@ -702,8 +711,13 @@ void VpnPage::resetWindowPosition()
|
||||||
break;
|
break;
|
||||||
//任务栏位于下方
|
//任务栏位于下方
|
||||||
default:
|
default:
|
||||||
|
if (strcmp(envStr, "ug_CN") == 0 || strcmp(envStr, "kk_KZ") == 0 || strcmp(envStr, "ky_KG") == 0) {
|
||||||
|
x = MARGIN;
|
||||||
|
y = availableGeo.y() + availableGeo.height() - m_panelSize - this->height() - MARGIN;
|
||||||
|
} else {
|
||||||
x = availableGeo.x() + availableGeo.width() - this->width() - MARGIN;
|
x = availableGeo.x() + availableGeo.width() - this->width() - MARGIN;
|
||||||
y = availableGeo.y() + availableGeo.height() - m_panelSize - this->height() - MARGIN;
|
y = availableGeo.y() + availableGeo.height() - m_panelSize - this->height() - MARGIN;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x, y, this->width(), this->height()));
|
kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x, y, this->width(), this->height()));
|
||||||
|
|
|
@ -62,6 +62,9 @@ InfoButton::InfoButton(QWidget *parent) : QPushButton(parent)
|
||||||
void InfoButton::initUI()
|
void InfoButton::initUI()
|
||||||
{
|
{
|
||||||
this->setFixedSize(BUTTON_SIZE);
|
this->setFixedSize(BUTTON_SIZE);
|
||||||
|
this->setIcon(QIcon::fromTheme("preferences-system-details-symbolic"));
|
||||||
|
this->setProperty("useButtonPalette", true);
|
||||||
|
this->setFlat(true);
|
||||||
m_backgroundColor = BACKGROUND_COLOR;
|
m_backgroundColor = BACKGROUND_COLOR;
|
||||||
m_foregroundColor = FOREGROUND_COLOR_NORMAL;
|
m_foregroundColor = FOREGROUND_COLOR_NORMAL;
|
||||||
}
|
}
|
||||||
|
@ -89,36 +92,6 @@ void InfoButton::onPaletteChanged()
|
||||||
this->repaint();
|
this->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InfoButton::paintEvent(QPaintEvent *event)
|
|
||||||
{
|
|
||||||
QPalette pal = this->palette();
|
|
||||||
pal.setColor(QPalette::Base, m_backgroundColor);
|
|
||||||
pal.setColor(QPalette::Text, m_foregroundColor);
|
|
||||||
|
|
||||||
QPainterPath cPath;
|
|
||||||
cPath.addRect(0, 0, ICON_SIZE);
|
|
||||||
cPath.addEllipse(0, 0, ICON_SIZE);
|
|
||||||
|
|
||||||
QPainterPath outerPath;
|
|
||||||
outerPath.addEllipse(OUTER_PATH);
|
|
||||||
|
|
||||||
QPainterPath innerPath;
|
|
||||||
innerPath.addEllipse(INNER_PATH);
|
|
||||||
outerPath -= innerPath;
|
|
||||||
|
|
||||||
QPainter painter(this);
|
|
||||||
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
|
|
||||||
painter.setPen(Qt::NoPen);
|
|
||||||
|
|
||||||
painter.setBrush(pal.color(QPalette::Base));
|
|
||||||
painter.drawPath(cPath);
|
|
||||||
|
|
||||||
painter.fillPath(outerPath, pal.color(QPalette::Text));
|
|
||||||
painter.setPen(m_foregroundColor);
|
|
||||||
QFont font("Noto Sans CJK SC", 11, QFont::Normal, false);
|
|
||||||
painter.setFont(font);
|
|
||||||
painter.drawText(TEXT_POS, "i");
|
|
||||||
}
|
|
||||||
|
|
||||||
void InfoButton::enterEvent(QEvent *event)
|
void InfoButton::enterEvent(QEvent *event)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,6 @@ public:
|
||||||
~InfoButton() = default;
|
~InfoButton() = default;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *event);
|
|
||||||
void enterEvent(QEvent *event);
|
void enterEvent(QEvent *event);
|
||||||
void leaveEvent(QEvent *event);
|
void leaveEvent(QEvent *event);
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent *event);
|
||||||
|
|
Loading…
Reference in New Issue