D23712: [Cuttlefish] Overhaul program, use Kirigami

Nathaniel Graham noreply at phabricator.kde.org
Wed Sep 11 23:38:22 BST 2019


ngraham added a comment.


  Some general comments:
  
  - Try to use QML Layouts as much as possible; for the most part, everything should be in a layout.
  - Anytime you're tempted to create a `Rectangle` with `color: "transparent"`, don't. Just use an `Item` instead. But you may not even need to do this if you use Layouts more.
  
  Idea: since the sidebar is now nice and wide, don't put the icon name inside the squeezed `FormLayout` below the icon montage. Instead, make it a header above the icon montage. Here's a patch to your patch that will implement these and other proposed changes: https://invent.kde.org/snippets/443. It will look like this:
  
  F7341810: Screenshot_20190911_163718.png <https://phabricator.kde.org/F7341810>

INLINE COMMENTS

> Preview.qml:78
>          anchors.fill: parent
> -        spacing: units.gridUnit / 2
> +        columns: 1
> +        Rectangle {

A GridLayout with one column is just a ColumnLayout; use that instead

> Preview.qml:135
>              }
> -            PlasmaCore.IconItem {
> -                source: iconName
> -                usesPlasmaTheme: cuttlefish.usesPlasmaTheme
> -                colorGroup: PlasmaCore.ColorScope.colorGroup
> -                Layout.preferredWidth: indexToSize(2)
> -                Layout.preferredHeight: indexToSize(2)
> -            }
> -            PlasmaCore.IconItem {
> -                source: iconName
> -                usesPlasmaTheme: cuttlefish.usesPlasmaTheme
> -                colorGroup: PlasmaCore.ColorScope.colorGroup
> -                Layout.preferredWidth: indexToSize(3)
> -                Layout.preferredHeight: indexToSize(3)
> -            }
> -            PlasmaCore.IconItem {
> -                source: iconName
> -                usesPlasmaTheme: cuttlefish.usesPlasmaTheme
> -                colorGroup: PlasmaCore.ColorScope.colorGroup
> -                Layout.preferredWidth: indexToSize(4)
> -                Layout.preferredHeight: indexToSize(4)
> -            }
> -        }
> +            QQC2.ToolButton {
> +                visible: !iconPreview.screenshotting

Center this button horizontally

> Tools.qml:36
> +        anchors.fill: parent
> +        anchors.leftMargin: Kirigami.Units.smallSpacing
> +        anchors.verticalCenter: parent.verticalCenter

Set the same thing for the right margin too

REPOSITORY
  R118 Plasma SDK

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

To: cblack, #vdg, ngraham
Cc: GB_2, trickyricky26, davidre, ndavis, filipf, davidedmundson, ngraham, plasma-devel, #vdg, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190911/3be7ef06/attachment-0001.html>


More information about the Plasma-devel mailing list