Bug 358849

Summary: Minimum plasmoid width and height not respected
Product: [Plasma] plasmashell Reporter: Luca Giambonini <luca86>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED FIXED    
Severity: normal CC: bhush94, demm, kde, luca86, plasma-bugs
Priority: NOR    
Version: 5.5.4   
Target Milestone: 1.0   
Platform: Chakra   
OS: Linux   
URL: https://trello-attachments.s3.amazonaws.com/56abd64f97b1bfc661e26b82/798x280/bfb8839da8d85dbc0d8026e1869cbb8f/chakra-welcome-plasmoid.png
Latest Commit: Version Fixed In:
Attachments: Minimal example

Description Luca Giambonini 2016-01-31 22:46:25 UTC
When I add a new plasmoid the minimum width and height are not respected.
All plasmoids are affected. For instance if I add the note plasmoid an icon is shown instead of the "post-it" image.

This is the QML code that set the minimum layout values:
    property int minimumWidth: 540
    property int minimumHeight: 480
    Layout.minimumWidth: minimumWidth < buttonRow.width ? buttonRow.width : minimumWidth
    Layout.minimumHeight: minimumHeight

Reproducible: Always
Comment 1 David Edmundson 2016-02-01 21:22:21 UTC
Created attachment 96963 [details]
Minimal example
Comment 2 David Edmundson 2016-02-01 21:24:39 UTC
We fail this check.

    //this should never happen, since we ask to create it if doesn't exists
    if (!ownLayout) {

Which is brilliant.

In theory we should have a layout because of the line

    //HACK: check the Layout properties we wrote
    QQmlProperty p(this, "Layout.minimumWidth", QtQml::qmlContext(d->qmlObject->rootObject()));

However, that code does nothing. p.isValid() returns false.

It used to work because the containment code later creates the layout attached, and the timer masked the root problem.

Don't know a good fix ATM.
Comment 3 Luca Giambonini 2016-02-04 21:33:23 UTC
which is the exact pkg affected, plasma-workspace or plasma-framework?
How I can help to fix this bug? There is a workaround that I can use to have a minimum size of the plasmoid?
Comment 4 David Edmundson 2016-02-06 00:38:07 UTC
Plasma-framework is the affected part; ./src/plasmaquick/appletquickitem.cpp to be exact

You can help fix it by fixing it. That's about it, I'm afraid.

There's no good workaround.
Comment 5 Luca Giambonini 2016-02-16 22:10:56 UTC
Reverting this changes fixed my problem temporarily. I consider it as a workaround.
https://quickgit.kde.org/?p=plasma-framework.git&a=commit&h=344dbeb93884af36f66e9a5133e7be7bd1b1e70d
Comment 6 David Rosca 2016-02-19 12:27:46 UTC
Git commit 82e172cc9e96bb530a591310ba6d8c294dc9f597 by David Rosca.
Committed on 19/02/2016 at 12:23.
Pushed by drosca into branch 'master'.

AppletQuickItem: Fix finding own attached layout

Regression from 344dbeb938
REVIEW: 127073

M  +21   -4    src/plasmaquick/appletquickitem.cpp
M  +1    -0    src/plasmaquick/appletquickitem.h
M  +2    -0    src/plasmaquick/private/appletquickitem_p.h

http://commits.kde.org/plasma-framework/82e172cc9e96bb530a591310ba6d8c294dc9f597