Review Request 119455: make Button a QtControl

David Edmundson david at davidedmundson.co.uk
Thu Jul 24 16:56:39 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119455/#review63091
-----------------------------------------------------------



src/declarativeimports/plasmacomponents/qml/styles/ButtonStyle.qml
<https://git.reviewboard.kde.org/r/119455/#comment43833>

    If you change Row to RowLayout this could be worked out for you.
    Layouts also have attached LayoutProperties on them. IMHO this makes the width calculation in the Button super easier too (just Layout.fillWidth: true)



src/declarativeimports/plasmacomponents/qml/styles/ButtonStyle.qml
<https://git.reviewboard.kde.org/r/119455/#comment43834>

    This isn't very declarative, is there a reason we can't do:
    
    Button
    {
      style: ButtonStyle{}
      property alias minimumWidth: style.minimumWidth 
    }
    
    and in this file
    
    property alias minimumWidth: buttonContent.minimumWidth
    
    same for height



src/declarativeimports/plasmacomponents/qml/styles/ButtonStyle.qml
<https://git.reviewboard.kde.org/r/119455/#comment43836>

    if you want fd-o icons, generally you use iconName instead of iconSource.
    
    We may need some changes for source compatibility, but that should be in the Button rather than the style I think.



src/declarativeimports/plasmacomponents/qml/styles/ButtonStyle.qml
<https://git.reviewboard.kde.org/r/119455/#comment43835>

    For the style I think we just want to do:
    
    source: control.iconName || control.iconSource
    
    as I think IconItem internally can handle both and choose the right thing



src/declarativeimports/plasmacomponents/qml/styles/ButtonStyle.qml
<https://git.reviewboard.kde.org/r/119455/#comment43837>

    style.labelImplicitWidth doesn't exist?


- David Edmundson


On July 24, 2014, 4:31 p.m., Marco Martin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119455/
> -----------------------------------------------------------
> 
> (Updated July 24, 2014, 4:31 p.m.)
> 
> 
> Review request for KDE Frameworks and Plasma.
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> -------
> 
> this makes Button inherit from the QtControl and annd an accompaining plasma-looking theme
> 
> now, the ugly part of the patch:
> iconSource is an url, so it screws up passing freedesktop compatible names (it expects names of pngs local to the qml file directory, testimony of the main platform target for controls actually being android/ios). one solution may be overriding iconSource as a normal string, but i would like the theme working also on a plain Button, so it extract only the filename from the url.
> 
> 
> Diffs
> -----
> 
>   examples/applets/widgetgallery/contents/ui/Buttons.qml 9134df9 
>   src/declarativeimports/core/iconitem.cpp 38012cc 
>   src/declarativeimports/plasmacomponents/qml/Button.qml 262e20f 
>   src/declarativeimports/plasmacomponents/qml/styles/ButtonStyle.qml PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/119455/diff/
> 
> 
> Testing
> -------
> 
> in both a normal plasma session or the widget gallery buttons work fine, painting is 100% identical
> 
> 
> Thanks,
> 
> Marco Martin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140724/ce3d8066/attachment-0001.html>


More information about the Plasma-devel mailing list