take into account device pixel ratio
make sure framesvgitem returns the proper implicitWidth/height Change-Id: I6d756e474c69bb32d2abef1a34d989c339d28ef9
This commit is contained in:
parent
919694a1de
commit
306e353fe6
@ -273,13 +273,9 @@ void FrameSvgItem::setImagePath(const QString &path)
|
|||||||
m_frameSvg->setElementPrefix(m_prefix);
|
m_frameSvg->setElementPrefix(m_prefix);
|
||||||
updateDevicePixelRatio();
|
updateDevicePixelRatio();
|
||||||
|
|
||||||
if (implicitWidth() <= 0) {
|
|
||||||
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
|
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
|
||||||
}
|
|
||||||
|
|
||||||
if (implicitHeight() <= 0) {
|
|
||||||
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
|
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
|
||||||
}
|
|
||||||
|
|
||||||
emit imagePathChanged();
|
emit imagePathChanged();
|
||||||
m_margins->update();
|
m_margins->update();
|
||||||
@ -305,13 +301,9 @@ void FrameSvgItem::setPrefix(const QString &prefix)
|
|||||||
m_frameSvg->setElementPrefix(prefix);
|
m_frameSvg->setElementPrefix(prefix);
|
||||||
m_prefix = prefix;
|
m_prefix = prefix;
|
||||||
|
|
||||||
if (implicitWidth() <= 0) {
|
|
||||||
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
|
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
|
||||||
}
|
|
||||||
|
|
||||||
if (implicitHeight() <= 0) {
|
|
||||||
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
|
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
|
||||||
}
|
|
||||||
|
|
||||||
emit prefixChanged();
|
emit prefixChanged();
|
||||||
m_margins->update();
|
m_margins->update();
|
||||||
@ -372,13 +364,9 @@ void FrameSvgItem::geometryChanged(const QRectF &newGeometry,
|
|||||||
|
|
||||||
void FrameSvgItem::doUpdate()
|
void FrameSvgItem::doUpdate()
|
||||||
{
|
{
|
||||||
if (implicitWidth() <= 0) {
|
|
||||||
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
|
setImplicitWidth(m_frameSvg->marginSize(Plasma::Types::LeftMargin) + m_frameSvg->marginSize(Plasma::Types::RightMargin));
|
||||||
}
|
|
||||||
|
|
||||||
if (implicitHeight() <= 0) {
|
|
||||||
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
|
setImplicitHeight(m_frameSvg->marginSize(Plasma::Types::TopMargin) + m_frameSvg->marginSize(Plasma::Types::BottomMargin));
|
||||||
}
|
|
||||||
|
|
||||||
QString prefix = m_frameSvg->actualPrefix();
|
QString prefix = m_frameSvg->actualPrefix();
|
||||||
bool hasOverlay = !prefix.startsWith(QStringLiteral("mask-")) && m_frameSvg->hasElement(prefix % "overlay");
|
bool hasOverlay = !prefix.startsWith(QStringLiteral("mask-")) && m_frameSvg->hasElement(prefix % "overlay");
|
||||||
|
@ -83,8 +83,8 @@ Item {
|
|||||||
id: background
|
id: background
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: _isVertical ? barSvg.elementSize("hint-bar-size").width : parent.width
|
width: _isVertical ? Math.round(barSvg.elementSize("hint-bar-size").width * units.devicePixelRatio) : parent.width
|
||||||
height: _isVertical ? parent.height : barSvg.elementSize("hint-bar-size").height
|
height: _isVertical ? parent.height : Math.round(barSvg.elementSize("hint-bar-size").height * units.devicePixelRatio)
|
||||||
|
|
||||||
imagePath: barSvg.imagePath
|
imagePath: barSvg.imagePath
|
||||||
prefix: "bar-inactive"
|
prefix: "bar-inactive"
|
||||||
|
@ -27,7 +27,7 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
|
|||||||
QtQuickControlStyle.ScrollViewStyle {
|
QtQuickControlStyle.ScrollViewStyle {
|
||||||
property Flickable flickableItem: control.flickableItem
|
property Flickable flickableItem: control.flickableItem
|
||||||
|
|
||||||
property real widthHint: scrollbarSvg.hasElement("hint-scrollbar-size") ? scrollbarSvg.elementSize("hint-scrollbar-size").width : scrollbarSvg.elementSize("arrow-up").width
|
property real widthHint: Math.round( (scrollbarSvg.hasElement("hint-scrollbar-size") ? scrollbarSvg.elementSize("hint-scrollbar-size").width : scrollbarSvg.elementSize("arrow-up").width) * units.devicePixelRatio)
|
||||||
|
|
||||||
frame: Item {
|
frame: Item {
|
||||||
PlasmaCore.Svg {
|
PlasmaCore.Svg {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user