D6188: [Desktop] Pad cellWidth/cellHeight with the extra space

Chris Holland noreply at phabricator.kde.org
Mon Jun 12 17:01:43 UTC 2017


Zren added a comment.


  In https://phabricator.kde.org/D6188#115778, @broulik wrote:
  
  > About panels covering the contents, perhaps you want to take into account `plasmoid.availableScreenRect` but `root` already has a `margin` based on this, so maybe just use the `ScrollView`'s size instead of `viewport`.
  
  
  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 `scrollView.width` was the **container's** width for some reason (it's not).
  
  F3781983: 2017-06-12___12-02-53.png <https://phabricator.kde.org/F3781983>
  
  It seems there's an `anchor.fill: parent` chain from GridView => FolderView => FolderViewLayer => all the way to the root object in `main.qml` which is a `FolderViewDropArea` with
  
    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
        }
    }
  
  The final state for "arranged in rows" with a 30px bottom panel is:
  
    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
  
  
  
    qml: bottomMargin folderViewLayer.ready true
    qml: bottomMargin folderViewLayer.view.overflowing false
    qml: bottomMargin flow == GridView.FlowTopToBottom false
    qml: bottomMargin return 0
  
  So it seems that it's hiccuping on `(folderViewLayer.view.overflowing || folderViewLayer.view.flow == GridView.FlowTopToBottom)`.
  
  For "arrange in columns" with a panel on the right (and bottom since I don't want to delete my main panel)
  
    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
  
  
  
    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
  
  So it's definitely the flow check. Gonna test without that condition in a bit.

REPOSITORY
  R119 Plasma Desktop

REVISION DETAIL
  https://phabricator.kde.org/D6188

To: Zren, hein
Cc: anthonyfieroni, broulik, plasma-devel, ZrenBot, spstarr, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170612/757f78ba/attachment-0001.html>


More information about the Plasma-devel mailing list