Merge branch '0720-newfrontend' into 'new-frontend'
Update MainWindow::centerToScreen(). See merge request kylin-desktop/ukui-search!97
This commit is contained in:
commit
d9c4d339ea
|
@ -403,16 +403,16 @@ void MainWindow::centerToScreen(QWidget* widget) {
|
||||||
int desk_y = desk_rect.height();
|
int desk_y = desk_rect.height();
|
||||||
int x = widget->width();
|
int x = widget->width();
|
||||||
int y = widget->height();
|
int y = widget->height();
|
||||||
QDBusInterface primaryScreenInterface("org.ukui.SettingsDaemon",
|
// QDBusInterface primaryScreenInterface("org.ukui.SettingsDaemon",
|
||||||
"/org/ukui/SettingsDaemon/wayland",
|
// "/org/ukui/SettingsDaemon/wayland",
|
||||||
"org.ukui.SettingsDaemon.wayland",
|
// "org.ukui.SettingsDaemon.wayland",
|
||||||
QDBusConnection::sessionBus());
|
// QDBusConnection::sessionBus());
|
||||||
if(QDBusReply<int>(primaryScreenInterface.call("x")).isValid()) {
|
// if(QDBusReply<int>(primaryScreenInterface.call("x")).isValid()) {
|
||||||
QDBusReply<int> width = primaryScreenInterface.call("width");
|
// QDBusReply<int> width = primaryScreenInterface.call("width");
|
||||||
QDBusReply<int> height = primaryScreenInterface.call("height");
|
// QDBusReply<int> height = primaryScreenInterface.call("height");
|
||||||
desk_x = width;
|
// desk_x = width;
|
||||||
desk_y = height;
|
// desk_y = height;
|
||||||
}
|
// }
|
||||||
widget->move(desk_x / 2 - x / 2 + desk_rect.left(), desk_y / 3 + desk_rect.top());
|
widget->move(desk_x / 2 - x / 2 + desk_rect.left(), desk_y / 3 + desk_rect.top());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue