Review Request: Port the Calculator applet to QML

Mark Gaiser markg85 at gmail.com
Tue Nov 6 22:18:45 UTC 2012



> On Nov. 6, 2012, 4:34 p.m., Mark Gaiser wrote:
> > applets/calculator/package/contents/ui/calculator.qml, lines 235-240
> > <http://git.reviewboard.kde.org/r/107001/diff/4/?file=93822#file93822line235>
> >
> >     Again my personal preference, but it cleans up your code. So here it is.
> >     
> >     I would put the button in a custom component since you are setting the width and height to the same value every time.
> >     
> >     // CustomButton.qml
> >     PlasmaComponents.Button {
> >         width: buttonWidth;
> >         height: buttonHeight;
> >     }
> >     
> >     Then in this case you call:
> >     CustomButton {
> >         text: "-"
> >         onClicked: setOperator("/")
> >     }
> >     
> >     The same for the other buttons. Seems cleaner to me..
> 
> Romário Rios wrote:
>     A repeater seems simpler to me in this case.
> 
> Mark Gaiser wrote:
>     Well, he tried (in the mailing list) and a repeater gets a bit tricky when you want different components. Most of them are buttons, but there are a few empty placeholders as well. How do you suggest to do that in a repeater?
>     
>     What he can do is repeat till the placeholders and continue manually from there. Even then he gets into trouble with the text and onClicked stuff.

.. ignore my comment above :p


- Mark


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107001/#review21491
-----------------------------------------------------------


On Nov. 6, 2012, 2:54 a.m., Romário Rios wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107001/
> -----------------------------------------------------------
> 
> (Updated Nov. 6, 2012, 2:54 a.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Description
> -------
> 
> This diff replaces the C++ Calculator applet by its QMLfied version, which seems to be feature-par with the latter.
> 
> 
> Diffs
> -----
> 
>   applets/calculator/CMakeLists.txt 732145c 
>   applets/calculator/calculator.h f7339be 
>   applets/calculator/calculator.cpp 6bc3ddc 
>   applets/calculator/package/contents/ui/calculator.qml PRE-CREATION 
>   applets/calculator/package/metadata.desktop PRE-CREATION 
>   applets/calculator/plasma-applet-calculator.desktop 0760729 
> 
> Diff: http://git.reviewboard.kde.org/r/107001/diff/
> 
> 
> Testing
> -------
> 
> Tested as both applet and popupapplet, with the Air theme and the Oxygen theme. It seems to work fine.
> 
> 
> Thanks,
> 
> Romário Rios
> 
>

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


More information about the Plasma-devel mailing list