Bug 358849 - Minimum plasmoid width and height not respected
Summary: Minimum plasmoid width and height not respected
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Unclassified
Component: general (show other bugs)
Version: 5.5.4
Platform: Chakra Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL: https://trello-attachments.s3.amazona...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-31 22:46 UTC by Luca Giambonini
Modified: 2016-02-19 12:27 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Minimal example (8.57 KB, application/zip)
2016-02-01 21:22 UTC, David Edmundson
Details

Note You need to log in before you can comment on or make changes to this bug.
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