forked from openkylin/ukui-menu
!24 替换任务栏高度获取接口;解决全屏开始菜单定位问题
Merge pull request !24 from lixueman/upstream
This commit is contained in:
commit
aa0e37f5c3
|
@ -375,7 +375,7 @@ QStringList UkuiMenuInterface::getDesktopFilePath()
|
||||||
m_filePathList.removeAll("/usr/share/applications/kylin-io-monitor.desktop");
|
m_filePathList.removeAll("/usr/share/applications/kylin-io-monitor.desktop");
|
||||||
m_filePathList.removeAll("/usr/share/applications/wps-office-uninstall.desktop");
|
m_filePathList.removeAll("/usr/share/applications/wps-office-uninstall.desktop");
|
||||||
m_filePathList.removeAll("/usr/share/applications/wps-office-misc.desktop");
|
m_filePathList.removeAll("/usr/share/applications/wps-office-misc.desktop");
|
||||||
m_filePathList.removeAll("/usr/share/applications/kylin-installer.desktop");
|
// m_filePathList.removeAll("/usr/share/applications/kylin-installer.desktop");
|
||||||
QStringList desktopList;
|
QStringList desktopList;
|
||||||
|
|
||||||
for (int i = 0; i < m_filePathList.count(); ++i) {
|
for (int i = 0; i < m_filePathList.count(); ++i) {
|
||||||
|
|
|
@ -170,7 +170,7 @@ void FullCommonUseWidget::resizeScrollAreaControls()
|
||||||
rowcount = listview->model()->rowCount() / dividend;
|
rowcount = listview->model()->rowCount() / dividend;
|
||||||
}
|
}
|
||||||
|
|
||||||
listview->setFixedSize(m_listView->width(), listview->gridSize().height() * rowcount);
|
listview->setFixedSize(Style::m_applistAreaWidth, listview->gridSize().height() * rowcount);
|
||||||
m_scrollArea->widget()->setFixedSize(listview->size());
|
m_scrollArea->widget()->setFixedSize(listview->size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,11 +275,13 @@ void FullCommonUseWidget::updateListView()
|
||||||
void FullCommonUseWidget::repaintWidget()
|
void FullCommonUseWidget::repaintWidget()
|
||||||
{
|
{
|
||||||
m_scrollArea->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
|
m_scrollArea->setFixedSize(Style::m_applistAreaWidth, Style::m_applistWidHeight);
|
||||||
|
m_scrollArea->setWidgetResizable(true);
|
||||||
m_scrollAreaWidLayout->removeWidget(m_listView);
|
m_scrollAreaWidLayout->removeWidget(m_listView);
|
||||||
m_listView->setParent(nullptr);
|
m_listView->setParent(nullptr);
|
||||||
delete m_listView;
|
delete m_listView;
|
||||||
initAppListWidget();
|
initAppListWidget();
|
||||||
fillAppList();
|
fillAppList();
|
||||||
|
m_scrollAreaWid->adjustSize();
|
||||||
m_scrollAreaWidHeight = m_scrollAreaWid->height();
|
m_scrollAreaWidHeight = m_scrollAreaWid->height();
|
||||||
initVerticalScrollBar();
|
initVerticalScrollBar();
|
||||||
on_setAreaScrollBarValue(0);
|
on_setAreaScrollBarValue(0);
|
||||||
|
|
|
@ -1382,8 +1382,14 @@ void MainWindow::repaintWidget()
|
||||||
int y = Style::m_primaryScreenY;
|
int y = Style::m_primaryScreenY;
|
||||||
int width = Style::m_availableScreenWidth;
|
int width = Style::m_availableScreenWidth;
|
||||||
int height = Style::m_availableScreenHeight;
|
int height = Style::m_availableScreenHeight;
|
||||||
|
|
||||||
setMinWindowPos();
|
setMinWindowPos();
|
||||||
m_fullWindow->move(x, y);
|
|
||||||
|
if (g_platform.startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) {
|
||||||
|
kdk::WindowManager::setGeometry(m_fullWindow->windowHandle(), QRect(x, y, width, height));
|
||||||
|
} else {
|
||||||
|
m_fullWindow->move(x, y);
|
||||||
|
}
|
||||||
m_fullWindow->setFixedSize(width, height);
|
m_fullWindow->setFixedSize(width, height);
|
||||||
m_fullWindow->repaintWidget();
|
m_fullWindow->repaintWidget();
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,23 +138,24 @@ QVariantList getScreenGeometryList()
|
||||||
QRect rect;
|
QRect rect;
|
||||||
rect = qApp->primaryScreen()->geometry();
|
rect = qApp->primaryScreen()->geometry();
|
||||||
int panelSize = 0;
|
int panelSize = 0;
|
||||||
int position = 0;
|
int panelPosition = 0;
|
||||||
QVariantList list;
|
QVariantList list;
|
||||||
list.clear();
|
list.clear();
|
||||||
QDBusInterface iface(DBUS_NAME,
|
|
||||||
DBUS_PATH,
|
|
||||||
DBUS_INTERFACE,
|
|
||||||
QDBusConnection::sessionBus());
|
|
||||||
QDBusReply<QVariantList> reply = iface.call("GetPrimaryScreenPhysicalGeometry");
|
|
||||||
|
|
||||||
if (reply.isValid()) {
|
if (QGSettings::isSchemaInstalled(QString("org.ukui.panel.settings").toLocal8Bit())) {
|
||||||
panelSize = reply.value().at(4).toInt();
|
QGSettings gsetting(QString("org.ukui.panel.settings").toLocal8Bit());
|
||||||
position = reply.value().at(5).toInt();
|
if (gsetting.keys().contains("panelposition")) {
|
||||||
|
panelPosition = gsetting.get("panelposition").toInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gsetting.keys().contains("panelsize")) {
|
||||||
|
panelSize = gsetting.get("panelsize").toInt();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> posIndex;
|
QList<int> posIndex;
|
||||||
|
|
||||||
switch (position) {
|
switch (panelPosition) {
|
||||||
case BOTTOM:
|
case BOTTOM:
|
||||||
posIndex = {0, 0, 0, -1};
|
posIndex = {0, 0, 0, -1};
|
||||||
break;
|
break;
|
||||||
|
@ -173,7 +174,7 @@ QVariantList getScreenGeometryList()
|
||||||
list.append(rect.width() + posIndex[2] * panelSize);
|
list.append(rect.width() + posIndex[2] * panelSize);
|
||||||
list.append(rect.height() + posIndex[3] * panelSize);
|
list.append(rect.height() + posIndex[3] * panelSize);
|
||||||
list.append(panelSize);
|
list.append(panelSize);
|
||||||
list.append(position);
|
list.append(panelPosition);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue