fix bug 143364
This commit is contained in:
parent
ab2f346c1d
commit
264bf84b97
|
@ -508,7 +508,7 @@ void MainWindow::showByWaylandHelper()
|
||||||
//去除窗管标题栏,传入参数为QWidget*
|
//去除窗管标题栏,传入参数为QWidget*
|
||||||
kdk::UkuiStyleHelper::self()->removeHeader(this);
|
kdk::UkuiStyleHelper::self()->removeHeader(this);
|
||||||
this->show();
|
this->show();
|
||||||
initPlatform();
|
getTabletMode();
|
||||||
resetWindowPosition();
|
resetWindowPosition();
|
||||||
//设置窗体位置,传入参数为QWindow*,QRect
|
//设置窗体位置,传入参数为QWindow*,QRect
|
||||||
|
|
||||||
|
@ -529,6 +529,29 @@ void MainWindow::setCentralWidgetType(IconActiveType iconStatus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::getTabletMode()
|
||||||
|
{
|
||||||
|
QDBusConnection::sessionBus().connect(QString("com.kylin.statusmanager.interfacer"),
|
||||||
|
QString("/"),
|
||||||
|
QString("qt5-ukui-platformtheme"),
|
||||||
|
QString("mode_change_signal"), this, SLOT(onTabletModeChanged(bool)));
|
||||||
|
|
||||||
|
QDBusInterface interface(QString("com.kylin.statusmanager.interfacer"),
|
||||||
|
QString("/"),
|
||||||
|
QString("qt5-ukui-platformtheme"),
|
||||||
|
QDBusConnection::sessionBus);
|
||||||
|
if(!interface.isValid()) {
|
||||||
|
m_isShowInCenter = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QDBusReply<bool> reply = interface->call("get_current_tabletmode");
|
||||||
|
if (!reply.isValid()) {
|
||||||
|
m_isShowInCenter = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_isShowInCenter = reply.value();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief MainWindow::onTrayIconActivated 点击托盘图标的槽函数
|
* @brief MainWindow::onTrayIconActivated 点击托盘图标的槽函数
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -161,6 +161,7 @@ private:
|
||||||
void showControlCenter();
|
void showControlCenter();
|
||||||
void showByWaylandHelper();
|
void showByWaylandHelper();
|
||||||
void setCentralWidgetType(IconActiveType iconStatus);
|
void setCentralWidgetType(IconActiveType iconStatus);
|
||||||
|
void getTabletMode();
|
||||||
double m_transparency=1.0; //透明度
|
double m_transparency=1.0; //透明度
|
||||||
QGSettings * m_transGsettings; //透明度配置文件
|
QGSettings * m_transGsettings; //透明度配置文件
|
||||||
int currentIconIndex=0;
|
int currentIconIndex=0;
|
||||||
|
|
|
@ -120,7 +120,6 @@ void vpnMainWindow::firstlyStart()
|
||||||
initDbusConnnect();
|
initDbusConnnect();
|
||||||
initWindowTheme();
|
initWindowTheme();
|
||||||
initTrayIcon();
|
initTrayIcon();
|
||||||
initPlatform();
|
|
||||||
installEventFilter(this);
|
installEventFilter(this);
|
||||||
m_secondaryStartTimer = new QTimer(this);
|
m_secondaryStartTimer = new QTimer(this);
|
||||||
connect(m_secondaryStartTimer, &QTimer::timeout, this, [ = ]() {
|
connect(m_secondaryStartTimer, &QTimer::timeout, this, [ = ]() {
|
||||||
|
@ -428,6 +427,7 @@ void vpnMainWindow::showByWaylandHelper()
|
||||||
//去除窗管标题栏,传入参数为QWidget*
|
//去除窗管标题栏,传入参数为QWidget*
|
||||||
kdk::UkuiStyleHelper::self()->removeHeader(this);
|
kdk::UkuiStyleHelper::self()->removeHeader(this);
|
||||||
this->show();
|
this->show();
|
||||||
|
getTabletMode();
|
||||||
resetWindowPosition();
|
resetWindowPosition();
|
||||||
//设置窗体位置,传入参数为QWindow*,QRect
|
//设置窗体位置,传入参数为QWindow*,QRect
|
||||||
|
|
||||||
|
@ -448,6 +448,29 @@ void vpnMainWindow::setCentralWidgetType(IconActiveType iconStatus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vpnMainWindow::getTabletMode()
|
||||||
|
{
|
||||||
|
QDBusConnection::sessionBus().connect(QString("com.kylin.statusmanager.interfacer"),
|
||||||
|
QString("/"),
|
||||||
|
QString("qt5-ukui-platformtheme"),
|
||||||
|
QString("mode_change_signal"), this, SLOT(onTabletModeChanged(bool)));
|
||||||
|
|
||||||
|
QDBusInterface interface(QString("com.kylin.statusmanager.interfacer"),
|
||||||
|
QString("/"),
|
||||||
|
QString("qt5-ukui-platformtheme"),
|
||||||
|
QDBusConnection::sessionBus);
|
||||||
|
if(!interface.isValid()) {
|
||||||
|
m_isShowInCenter = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QDBusReply<bool> reply = interface->call("get_current_tabletmode");
|
||||||
|
if (!reply.isValid()) {
|
||||||
|
m_isShowInCenter = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_isShowInCenter = reply.value();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief vpnMainWindow::onTrayIconActivated 点击托盘图标的槽函数
|
* @brief vpnMainWindow::onTrayIconActivated 点击托盘图标的槽函数
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -111,6 +111,7 @@ private:
|
||||||
// void showControlCenter();
|
// void showControlCenter();
|
||||||
void showByWaylandHelper();
|
void showByWaylandHelper();
|
||||||
void setCentralWidgetType(IconActiveType iconStatus);
|
void setCentralWidgetType(IconActiveType iconStatus);
|
||||||
|
void getTabletMode();
|
||||||
double m_transparency=1.0; //透明度
|
double m_transparency=1.0; //透明度
|
||||||
QGSettings * m_transGsettings; //透明度配置文件
|
QGSettings * m_transGsettings; //透明度配置文件
|
||||||
int m_currentIconIndex = 0;
|
int m_currentIconIndex = 0;
|
||||||
|
|
Loading…
Reference in New Issue