Changeset View
Changeset View
Standalone View
Standalone View
shell/panelview.cpp
Show First 20 Lines • Show All 945 Lines • ▼ Show 20 Line(s) | 939 | { | |||
---|---|---|---|---|---|
946 | QRectF containmentRect(containmentItem->mapToScene(QPoint(0,0)), QSizeF(containmentItem->width(), containmentItem->height())); | 946 | QRectF containmentRect(containmentItem->mapToScene(QPoint(0,0)), QSizeF(containmentItem->width(), containmentItem->height())); | ||
947 | 947 | | |||
948 | return QPointF(qBound(containmentRect.left() + 2, point.x(), containmentRect.right() - 2), | 948 | return QPointF(qBound(containmentRect.left() + 2, point.x(), containmentRect.right() - 2), | ||
949 | qBound(containmentRect.top() + 2, point.y(), containmentRect.bottom() - 2)); | 949 | qBound(containmentRect.top() + 2, point.y(), containmentRect.bottom() - 2)); | ||
950 | } | 950 | } | ||
951 | 951 | | |||
952 | void PanelView::updateMask() | 952 | void PanelView::updateMask() | ||
953 | { | 953 | { | ||
954 | if (KWindowSystem::compositingActive()) { | 954 | QRegion mask; | ||
955 | setMask(QRegion()); | 955 | | ||
956 | } else { | 956 | QQuickItem *rootObject = this->rootObject(); | ||
957 | if (rootObject) { | ||||
958 | const QVariant maskProperty = rootObject->property("panelMask"); | ||||
959 | if (static_cast<QMetaType::Type>(maskProperty.type()) == QMetaType::QRegion) { | ||||
960 | mask = maskProperty.value<QRegion>(); | ||||
961 | } | ||||
962 | } | ||||
963 | | ||||
964 | // old hack for non-compositing: | ||||
965 | // assuming the desktoptheme uses "widgets/panel-background" for the panel | ||||
966 | // before "panelMask" was added to expected property set of panel objects | ||||
967 | // TODO: understand if still needed | ||||
968 | if (mask.isEmpty() && !KWindowSystem::compositingActive()) { | ||||
957 | if (!m_background) { | 969 | if (!m_background) { | ||
958 | m_background = new Plasma::FrameSvg(this); | 970 | m_background = new Plasma::FrameSvg(this); | ||
959 | m_background->setImagePath(QStringLiteral("widgets/panel-background")); | 971 | m_background->setImagePath(QStringLiteral("widgets/panel-background")); | ||
960 | } | 972 | } | ||
961 | 973 | | |||
962 | m_background->setEnabledBorders(enabledBorders()); | 974 | m_background->setEnabledBorders(enabledBorders()); | ||
963 | 975 | | |||
964 | m_background->resizeFrame(size()); | 976 | m_background->resizeFrame(size()); | ||
965 | setMask(m_background->mask()); | 977 | mask = m_background->mask(); | ||
966 | } | 978 | } | ||
979 | | ||||
980 | setMask(mask); | ||||
967 | } | 981 | } | ||
968 | 982 | | |||
969 | bool PanelView::canSetStrut() const | 983 | bool PanelView::canSetStrut() const | ||
970 | { | 984 | { | ||
971 | #if HAVE_X11 | 985 | #if HAVE_X11 | ||
972 | if (!KWindowSystem::isPlatformX11()) { | 986 | if (!KWindowSystem::isPlatformX11()) { | ||
973 | return true; | 987 | return true; | ||
974 | } | 988 | } | ||
▲ Show 20 Lines • Show All 288 Lines • Show Last 20 Lines |