<table><tr><td style="">Zren added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D6188" rel="noreferrer">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D6188#115778" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">D6188#115778</a>, <a href="https://phabricator.kde.org/p/broulik/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;" rel="noreferrer">@broulik</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p>About panels covering the contents, perhaps you want to take into account <tt style="background: #ebebeb; font-size: 13px;">plasmoid.availableScreenRect</tt> but <tt style="background: #ebebeb; font-size: 13px;">root</tt> already has a <tt style="background: #ebebeb; font-size: 13px;">margin</tt> based on this, so maybe just use the <tt style="background: #ebebeb; font-size: 13px;">ScrollView</tt>'s size instead of <tt style="background: #ebebeb; font-size: 13px;">viewport</tt>.</p></div>
</blockquote>

<p>I think my faulty logic for using viewport was because ScrollView goes under the panel. See below where the the purple outline goes under the panel. I mistakenly thought <tt style="background: #ebebeb; font-size: 13px;">scrollView.width</tt> was the <strong>container's</strong> width for some reason (it's not).</p>

<p><a href="https://phabricator.kde.org/F3781983" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F3781983: 2017-06-12___12-02-53.png</a></p>

<p>It seems there's an <tt style="background: #ebebeb; font-size: 13px;">anchor.fill: parent</tt> chain from GridView => FolderView => FolderViewLayer => all the way to the root object in <tt style="background: #ebebeb; font-size: 13px;">main.qml</tt> which is a <tt style="background: #ebebeb; font-size: 13px;">FolderViewDropArea</tt> with</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">FolderViewDropArea {

    // preferredWidth(...) and preferredHeight(...) return -1 when (isContainment || !folderViewLayer.ready),
    // so I've just expanded them as -1 for us. Basically they fill it will expand as far as it can.
    width: -1
    Layout.minimumWidth: -1
    Layout.preferredWidth: 0
    Plasmoid.switchWidth: -1

    height: -1
    Layout.minimumHeight: -1
    Layout.preferredHeight: 0
    Plasmoid.switchHeight: -1

    anchors {
        leftMargin: (isContainment && plasmoid.availableScreenRect) ? plasmoid.availableScreenRect.x : 0
        topMargin: (isContainment && plasmoid.availableScreenRect) ? plasmoid.availableScreenRect.y : 0

        // Don't apply the right margin if the folderView is in column mode and not overflowing.
        // In this way, the last column remains droppable even if a small part of the icon is behind a panel.
        rightMargin: folderViewLayer.ready && (folderViewLayer.view.overflowing || folderViewLayer.view.flow == GridView.FlowLeftToRight
            || folderViewLayer.view.layoutDirection == Qt.RightToLeft)
            && (isContainment && plasmoid.availableScreenRect) && parent
            ? parent.width - (plasmoid.availableScreenRect.x + plasmoid.availableScreenRect.width) : 0

        // Same mechanism as the right margin but applied here to the bottom when the folderView is in row mode.
        bottomMargin: folderViewLayer.ready && (folderViewLayer.view.overflowing || folderViewLayer.view.flow == GridView.FlowTopToBottom)
            && (isContainment && plasmoid.availableScreenRect) && parent
            ? parent.height - (plasmoid.availableScreenRect.y + plasmoid.availableScreenRect.height) : 0
    }
}</pre></div>

<p>The final state for "arranged in rows" with a 30px bottom panel is:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">qml: rightMargin folderViewLayer.ready true
qml: rightMargin folderViewLayer.view.overflowing false
qml: rightMargin flow == GridView.FlowLeftToRight true
qml: rightMargin layoutDirection == Qt.RightToLeft false
qml: rightMargin isContainment true
qml: rightMargin plasmoid.availableScreenRect QRect(0, 0, 1920, 1050)
qml: rightMargin parent ContainmentInterface(0x1d82390)
qml: rightMargin parent.width 1920
qml: rightMargin plasmoid.availableScreenRect.x 0
qml: rightMargin plasmoid.availableScreenRect.width 1920
qml: rightMargin return 0</pre></div>



<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">qml: bottomMargin folderViewLayer.ready true
qml: bottomMargin folderViewLayer.view.overflowing false
qml: bottomMargin flow == GridView.FlowTopToBottom false
qml: bottomMargin return 0</pre></div>

<p>So it seems that it's hiccuping on <tt style="background: #ebebeb; font-size: 13px;">(folderViewLayer.view.overflowing || folderViewLayer.view.flow == GridView.FlowTopToBottom)</tt>.</p>

<p>For "arrange in columns" with a panel on the right (and bottom since I don't want to delete my main panel)</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">qml: bottomMargin folderViewLayer.ready true
qml: bottomMargin folderViewLayer.view.overflowing false
qml: bottomMargin flow == GridView.FlowTopToBottom true
qml: bottomMargin isContainment true
qml: bottomMargin plasmoid.availableScreenRect QRect(0, 0, 1838, 1050)
qml: bottomMargin parent ContainmentInterface(0x1d82390)
qml: bottomMargin parent.height 1080
qml: bottomMargin plasmoid.availableScreenRect.y 0
qml: bottomMargin plasmoid.availableScreenRect.height 1050
qml: bottomMargin return 30</pre></div>



<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">qml: rightMargin folderViewLayer.ready true
qml: rightMargin folderViewLayer.view.overflowing false
qml: rightMargin flow == GridView.FlowLeftToRight false
qml: rightMargin layoutDirection == Qt.RightToLeft false
qml: rightMargin return 0</pre></div>

<p>So it's definitely the flow check. Gonna test without that condition in a bit.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6188" rel="noreferrer">https://phabricator.kde.org/D6188</a></div></div><br /><div><strong>To: </strong>Zren, hein<br /><strong>Cc: </strong>anthonyfieroni, broulik, plasma-devel, ZrenBot, spstarr, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas<br /></div>