D27695: WIP: Create a new TopArea element using widgets/toparea svg

Marco Martin noreply at phabricator.kde.org
Tue Mar 3 16:03:16 GMT 2020


mart added a comment.


  I would call the component PlasmoidHeading, to make clear it's only for use in plasmoids

INLINE COMMENTS

> TopArea.qml:28
> +    
> +    property bool flipped: false
> +     

enum Location {

  Header,
  Footer

(maybe a middle as well?)

  }

property Location location

> TopArea.qml:30
> +     
> +    Layout.fillWidth: true
> +    Layout.bottomMargin: flipped ? 0 : topAreaSvg.margins.top

shouldn't assume it's in a layout..
maybe keep Layout.fillwidth to keep it compact, layout margins shouldn't be necessary.

> TopArea.qml:37
> +    
> +    leftInset: -topAreaSvg.margins.left
> +    rightInset: -topAreaSvg.margins.right

topAreaSvg.fixedMargins so works also when you disable them

> TopArea.qml:43
> +    background: PlasmaCore.FrameSvgItem {
> +        id: topAreaSvg
> +        imagePath: "test"

you can check for headers:
plasmoid.location === Plasmacore.Types.TopEdge and disable the top border

same thing for footers, disabling bottom edge when 
plasmoid.location === Plasmacore.Types.BottomEdge

> TopArea.qml:44
> +        id: topAreaSvg
> +        imagePath: "test"
> +        prefix: flipped? 'flipped' : ''

"plasmoidheading" svg name

> TopArea.qml:45
> +        imagePath: "test"
> +        prefix: flipped? 'flipped' : ''
> +    }

prefixes as "header" and "footer"

REPOSITORY
  R242 Plasma Framework (Library)

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

To: niccolove, mart
Cc: davidedmundson, ahiemstra, kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200303/9cd843cd/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list