mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Merge branch 'release/20.12'
This commit is contained in:
commit
d80d79024d
|
@ -13,6 +13,7 @@
|
|||
#include <KXMLGUIFactory>
|
||||
#include <KXmlGuiWindow>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDomDocument>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
|
@ -90,10 +91,20 @@ void DolphinNavigatorsWidgetAction::followViewContainersGeometry(
|
|||
int globalXOfPrimary, int widthOfPrimary,
|
||||
int globalXOfSecondary, int widthOfSecondary)
|
||||
{
|
||||
m_globalXOfSplitter = m_splitter->mapToGlobal(QPoint(0,0)).x();
|
||||
m_globalXOfPrimary = globalXOfPrimary;
|
||||
if (QApplication::layoutDirection() == Qt::LeftToRight) {
|
||||
m_globalXOfSplitter = m_splitter->mapToGlobal(QPoint(0,0)).x();
|
||||
m_globalXOfPrimary = globalXOfPrimary;
|
||||
m_globalXOfSecondary = globalXOfSecondary;
|
||||
} else {
|
||||
// When the direction is reversed, globalX does not change.
|
||||
// For the adjustSpacing() code to work we need globalX to measure from right to left
|
||||
// and to measure up to the rightmost point of a widget instead of the leftmost.
|
||||
m_globalXOfSplitter = (-1) * (m_splitter->mapToGlobal(QPoint(0,0)).x() + m_splitter->width());
|
||||
m_globalXOfPrimary = (-1) * (globalXOfPrimary + widthOfPrimary);
|
||||
m_globalXOfSecondary = (globalXOfSecondary == INT_MIN) ? INT_MIN :
|
||||
(-1) * (globalXOfSecondary + widthOfSecondary);
|
||||
}
|
||||
m_widthOfPrimary = widthOfPrimary;
|
||||
m_globalXOfSecondary = globalXOfSecondary;
|
||||
m_widthOfSecondary = widthOfSecondary;
|
||||
adjustSpacing();
|
||||
}
|
||||
|
|
|
@ -1488,7 +1488,8 @@ QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStrin
|
|||
if (icon.isNull()) {
|
||||
icon = QIcon(name);
|
||||
}
|
||||
if (icon.isNull()) {
|
||||
if (icon.isNull()
|
||||
|| icon.pixmap(size / qApp->devicePixelRatio(), size / qApp->devicePixelRatio(), mode).isNull()) {
|
||||
icon = fallbackIcon;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue