!79 任务栏网络模块,切换哈维柯语言时从右往左布局出现混乱
Merge pull request !79 from 李享/openkylin/nile
This commit is contained in:
commit
84a21c00df
|
@ -1,3 +1,13 @@
|
||||||
|
kylin-nm (4.10.0.0-ok0.10) nile; urgency=medium
|
||||||
|
|
||||||
|
* BUG:#I9IYPM 任务栏网络模块,切换哈维柯语言时从右往左布局出现混乱
|
||||||
|
* 需求:无
|
||||||
|
* 其他改动说明:更新翻译
|
||||||
|
* 其他改动影响域:无
|
||||||
|
|
||||||
|
|
||||||
|
-- lixiang1 <lixiang1@kylinos.cn> Fri, 30 Aug 2024 09:33:01 +0800
|
||||||
|
|
||||||
kylin-nm (4.10.0.0-ok0.9) nile; urgency=medium
|
kylin-nm (4.10.0.0-ok0.9) nile; urgency=medium
|
||||||
|
|
||||||
* BUG:#240566 【兆芯KX6000】【冒烟1级】【WiFi】控制面板多次点击未连接的WiFi,高概率出现密码输入框不显示输入光标
|
* BUG:#240566 【兆芯KX6000】【冒烟1级】【WiFi】控制面板多次点击未连接的WiFi,高概率出现密码输入框不显示输入光标
|
||||||
|
|
|
@ -536,42 +536,60 @@ void MainWindow::resetWindowPosition()
|
||||||
#define PANEL_TOP 1
|
#define PANEL_TOP 1
|
||||||
#define PANEL_LEFT 2
|
#define PANEL_LEFT 2
|
||||||
#define PANEL_RIGHT 3
|
#define PANEL_RIGHT 3
|
||||||
|
#define PANEL_Bottom 0
|
||||||
//#define PANEL_BOTTOM 4
|
//#define PANEL_BOTTOM 4
|
||||||
#define MARGIN 8
|
|
||||||
QDBusInterface iface("org.ukui.panel",
|
|
||||||
"/panel/position",
|
|
||||||
"org.ukui.panel",
|
|
||||||
QDBusConnection::sessionBus());
|
|
||||||
QDBusReply<QVariantList> reply=iface.call("GetPrimaryScreenGeometry");
|
|
||||||
QVariantList position_list=reply.value();
|
|
||||||
|
|
||||||
/*
|
QRect availableGeo = QGuiApplication::screenAt(QCursor::pos())->geometry();
|
||||||
* 通过这个dbus接口获取到的6个参数分别为 :可用屏幕大小的x坐标、y坐标、宽度、高度,任务栏位置
|
int x, y;
|
||||||
*/
|
|
||||||
QRect rect;
|
switch (m_panelPosition)
|
||||||
switch(reply.value().at(4).toInt()){
|
{
|
||||||
case 1:
|
case PANEL_TOP:
|
||||||
rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
|
{
|
||||||
position_list.at(1).toInt()+MARGIN,
|
char *envStr = getenv("LANGUAGE");
|
||||||
this->width(),this->height());
|
/* 维吾尔语 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;
|
||||||
|
y = availableGeo.y() + m_panelSize + MARGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case PANEL_Bottom:
|
||||||
rect = QRect(position_list.at(0).toInt()+MARGIN,
|
{
|
||||||
position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
|
char *envStr = getenv("LANGUAGE");
|
||||||
this->width(),this->height());
|
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;
|
||||||
|
y = availableGeo.y() + availableGeo.height() - m_panelSize - this->height() - MARGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case PANEL_LEFT:
|
||||||
rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
|
{
|
||||||
position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
|
x = availableGeo.x() + m_panelSize + MARGIN;
|
||||||
this->width(),this->height());
|
y = availableGeo.y() + availableGeo.height() - this->height() - MARGIN;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
case PANEL_RIGHT:
|
||||||
rect = QRect(position_list.at(0).toInt()+position_list.at(2).toInt()-this->width()-MARGIN,
|
{
|
||||||
position_list.at(1).toInt()+reply.value().at(3).toInt()-this->height()-MARGIN,
|
x = availableGeo.x() + availableGeo.width() - m_panelSize - this->width() - MARGIN;
|
||||||
this->width(),this->height());
|
y = availableGeo.y() + availableGeo.height() - this->height() - MARGIN;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
kdk::WindowManager::setGeometry(this->windowHandle(), rect);
|
|
||||||
|
kdk::WindowManager::setGeometry(this->windowHandle(), QRect(x, y, this->width(), this->height()));
|
||||||
qDebug() << " Position of ukui-panel is " << m_panelPosition << "; Position of mainwindow is " << this->geometry() << "." << Q_FUNC_INFO << __LINE__;
|
qDebug() << " Position of ukui-panel is " << m_panelPosition << "; Position of mainwindow is " << this->geometry() << "." << Q_FUNC_INFO << __LINE__;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue