<div dir="ltr"><div><div><div>Hello,<br><br></div>I have completed the work .The feature seems to works fine and I have uploaded it to my github repo as well.Here's the link <br><br><a href="https://github.com/rish9511/GCompris-qt/tree/searchfeature">https://github.com/rish9511/GCompris-qt/tree/searchfeature</a>   <br><br></div>Should I generate a pull request? <br><br><br></div><div>Thanks for all the help :) <br></div><div>Rishabh <br></div><div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 20, 2016 at 2:42 PM, Johnny Jazeix <span dir="ltr"><<a href="mailto:jazeix@gmail.com" target="_blank">jazeix@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don't know exactly how it works internally in Qt but:<br>
if you want to access a c++ class attribute in qml, you have to add<br>
Q_PROPERTY with it.<br>
In qml, all the attributes (let's call it test for now) have an<br>
automated created signal/slot: onTestChanged.<br>
<br>
Then, for our case, I don't know how it is handled internally by Qt,<br>
but the change is done automatically (probably some signal emitted<br>
when width or height changes which update our boolean).<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
2016-01-20 4:41 GMT+01:00 RISHABH GUPTA <<a href="mailto:rishabh9511@gmail.com">rishabh9511@gmail.com</a>>:<br>
> Ok ...but like there is a Q_property defined in acitivityinfotree.h for<br>
> menutree which automatically updates the data is there any such thing<br>
> defined for this also ?<br>
><br>
> On 20-Jan-2016 12:57 am, "JAZEIX Johnny" <<a href="mailto:jazeix@gmail.com">jazeix@gmail.com</a>> wrote:<br>
>><br>
>> It's qml magic :).<br>
>><br>
>> It is automatically updated when the width become bigger/lesser than the<br>
>> height.<br>
>><br>
>> Then you can do like for sectionIconWidth:<br>
>> property int sectionIconWidth: horizontal ?<br>
>>                 Math.min(100 * ApplicationInfo.ratio, main.width /<br>
>> (sections.length + 1)) :<br>
>>                 Math.min(100 * ApplicationInfo.ratio, (main.height -<br>
>> bar.height) / (sections.length + 1))<br>
>><br>
>> => when the width becomes bigger/lesser than height, horizontal will<br>
>> automatically change its value leading sectionIconWidth to also change its<br>
>> value.<br>
>><br>
>> It uses qml bindings internally.<br>
>><br>
>> Johnny<br>
>><br>
>> On 01/19/16 20:03, RISHABH GUPTA wrote:<br>
>><br>
>> But how does it gets notified about the change ? Some signal slot?<br>
>><br>
>> On 20-Jan-2016 12:28 am, "JAZEIX Johnny" <<a href="mailto:jazeix@gmail.com">jazeix@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi,<br>
>>><br>
>>> in Menu.qml, you have the property: horizontal which tells you if you are<br>
>>> in portrait or landscape mode.<br>
>>> It changes when the screen is rotated because width will become lesser or<br>
>>> bigger than height.<br>
>>><br>
>>> On 01/19/16 19:51, RISHABH GUPTA wrote:<br>
>>><br>
>>> Hey ,i started working on this .It works fine on desktop  .To make it<br>
>>> work on android  i need to understand something ,how does the code gets to<br>
>>> know when the user rotates the phone .I came across 'isportraitmode' but i<br>
>>> don't know how and where it is being used .<br>
>>> When we rotate the phone the entire display changes because the position<br>
>>> of anchors get changed and since all this is done in menu.qml  i was<br>
>>> guessing 'isportraitmode' must be used here ,but it's not .<br>
>>><br>
>>> cheers<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> On Wed, Jan 13, 2016 at 2:58 PM, Johnny Jazeix <<a href="mailto:jazeix@gmail.com">jazeix@gmail.com</a>> wrote:<br>
>>>><br>
>>>> Hi, you can do it in Menu.qml (I give you one global idea, feel free<br>
>>>> to do it like you want):<br>
>>>> adding a section is done by adding a new value to the sections<br>
>>>> variant. It should automatically be displayed in the section list.<br>
>>>> Then, you can add the TextField with visible: tag="yourtag".<br>
>>>> You can anchor the top of the TextField to the sectionBar.bottom and<br>
>>>> anchor the top of the grid with activities to the TextField if we are<br>
>>>> in horizontalMode (in vertical mode you have to put undefined for the<br>
>>>> top, using ternary operator probably).<br>
>>>> If you want someoverlap of the TextField on the section grid, you have<br>
>>>> some properties in the anchors (horizontalAnchorsOffset or something<br>
>>>> like that <a href="http://doc.qt.io/qt-5/qml-qtquick-item.html#anchors-prop" rel="noreferrer" target="_blank">http://doc.qt.io/qt-5/qml-qtquick-item.html#anchors-prop</a>).<br>
>>>> Be careful to check if it works when resizing.<br>
>>>><br>
>>>> Also what do we do about other filters in search case? For the paying<br>
>>>> and non-enabled activities, I think we should not display them (so<br>
>>>> apply the filter first) but for the difficulty?<br>
>>>><br>
>>>> For the TextField, you should probably force the font to the one used<br>
>>>> in GCText (I don't remember the exact code to do it but it's not a big<br>
>>>> issue) and on tablet, the keyboard should pop up.<br>
>>>><br>
>>>> Johnny<br>
>>>><br>
>>>> 2016-01-13 7:51 GMT+01:00 RISHABH GUPTA <<a href="mailto:rishabh9511@gmail.com">rishabh9511@gmail.com</a>>:<br>
>>>> ><br>
>>>> ><br>
>>>> > On Tue, Jan 12, 2016 at 5:00 PM, Johnny Jazeix <<a href="mailto:jazeix@gmail.com">jazeix@gmail.com</a>><br>
>>>> > wrote:<br>
>>>> >><br>
>>>> >> Hi,<br>
>>>> >><br>
>>>> >> 2016-01-12 11:54 GMT+01:00 Bruno Coudoin<br>
>>>> >> <<a href="mailto:bruno.coudoin@gcompris.net">bruno.coudoin@gcompris.net</a>>:<br>
>>>> >> ><br>
>>>> >> ><br>
>>>> >> > Le 12/01/2016 10:39, Holger Kaelberer a écrit :<br>
>>>> >> ><br>
>>>> >> >> Me too.<br>
>>>> >> >><br>
>>>> >> >> Users (also the adult ones) tend to not read documentation and<br>
>>>> >> >> imho a<br>
>>>> >> >> "search" feature is useful enough to keep it visible. If we opt<br>
>>>> >> >> for<br>
>>>> >> >> the section header it could still be put at the right/lower of the<br>
>>>> >> >> list.<br>
>>>> >> > I agree the search feature is useful but not for all our user.<br>
>>>> >> > More, for<br>
>>>> >> > the smaller one they will enter it and get lost. At least this new<br>
>>>> >> > search button should not be there by default, better let the<br>
>>>> >> > advanced<br>
>>>> >> > users search a little bit for the option than confusing the new<br>
>>>> >> > ones<br>
>>>> >> > with an advanced feature.<br>
>>>> >><br>
>>>> >> One advantage of having it as a section is that when no search is<br>
>>>> >> entered, all the activities are displayed. For now, the user has to<br>
>>>> >> navigate to find the good section.<br>
>>>> >> I agree with putting it at the end of the list.<br>
>>>> >><br>
>>>> >><br>
>>>> >> We can also think to add an "advanced mode" in conf where we can add<br>
>>>> >> things that won't be used by children but by developers/parents.<br>
>>>> >><br>
>>>> >> >><br>
>>>> >> >>>><br>
>>>> >> >>>>     Maybe we can put<br>
>>>> >> >>>>     it on the section bar, with a setting to display it or not<br>
>>>> >> >>>> (false by<br>
>>>> >> >>>>     default)?<br>
>>>> >> >><br>
>>>> >> >> I don't like the bar option because imho it does not belong there.<br>
>>>> >> >> Activity selection is controlled via the section header and<br>
>>>> >> >> preselecting activities via a search feature is part of this task<br>
>>>> >> >> as<br>
>>>> >> >> is categorial grouping and personal favorites.<br>
>>>> >> > Here the suggestion was to use the 'section bar' so you agree. I<br>
>>>> >> > also<br>
>>>> >> > back you, I don't like much using the control bar for that.<br>
>>>> >> >><br>
>>>> >> >>>><br>
>>>> >> >>>>     For the sections on top, it is a list, so it should resize<br>
>>>> >> >>>>     automatically if we add one more.<br>
>>>> >> >><br>
>>>> >> >> +1<br>
>>>> >> >><br>
>>>> >> >> Add a magnifier icon (or so) to the section list and present a<br>
>>>> >> >> TextInput (or so) onClicked, either replacing the section bar (in<br>
>>>> >> >> landscape) or, maybe more generic, overlaying it on top of the<br>
>>>> >> >> whole<br>
>>>> >> >> scene.<br>
>>>> >> > I agree on that but more complex, in portrait mode the search bar<br>
>>>> >> > should<br>
>>>> >> > be on top anyway.<br>
>>>> >><br>
>>>> >> Yes, having the search bar on top in both case.<br>
>>>> ><br>
>>>> ><br>
>>>> >  The activities  take up the area on top .How do we place it on the<br>
>>>> > top ?<br>
>>>> ><br>
>>>> ><br>
>>>> >><br>
>>>> >> >><br>
>>>> >> >><br>
>>>> >> >>>><br>
>>>> >> >>>> So my proposal:<br>
>>>> >> >>>><br>
>>>> >> >>>> On desktop and mobile in landscape mode,we can place the icon on<br>
>>>> >> >>>> the<br>
>>>> >> >>>> bottom next to configuration<br>
>>>> >> >>>> icon ,since there is enough space ,on clicking it would expand<br>
>>>> >> >>>> to a<br>
>>>> >> >>>> search bar .<br>
>>>> >> >>>><br>
>>>> >> >>>>  For potrait mode  i like what bruno sir suggested .<br>
>>>> >> >>>><br>
>>>> >> >>>> If anyone else has any other suggestion then please provide<br>
>>>> >> >>>> them,would be a great help . :)<br>
>>>> >> >>> Another idea, we improve the bar as to make the buttons shrink to<br>
>>>> >> >>> suit the window width so it is not<br>
>>>> >> >>> a problem to put the option even in portait mode.<br>
>>>> >> >>><br>
>>>> >> > We can keep the idea of improving the control bar to make it suit<br>
>>>> >> > the<br>
>>>> >> > window width. But let's use the section bar to add the search<br>
>>>> >> > button.<br>
>>>> >> ><br>
>>>> >><br>
>>>> >> For me, I consider it a bug that the buttons in configuration can<br>
>>>> >> sometimes overlap the screen width. I didn't have time to dig it yet.<br>
>>>> >><br>
>>>> >> Johnny<br>
>>>> >><br>
>>>> >> > Idea, we could add a swipe gesture on the section bar to switch<br>
>>>> >> > from<br>
>>>> >> > section mode to search.<br>
>>>> >> ><br>
>>>> >> > Bruno.<br>
>>>> >> > _______________________________________________<br>
>>>> >> > GCompris-devel mailing list<br>
>>>> >> > <a href="mailto:GCompris-devel@kde.org">GCompris-devel@kde.org</a><br>
>>>> >> > <a href="https://mail.kde.org/mailman/listinfo/gcompris-devel" rel="noreferrer" target="_blank">https://mail.kde.org/mailman/listinfo/gcompris-devel</a><br>
>>>> >> _______________________________________________<br>
>>>> >> GCompris-devel mailing list<br>
>>>> >> <a href="mailto:GCompris-devel@kde.org">GCompris-devel@kde.org</a><br>
>>>> >> <a href="https://mail.kde.org/mailman/listinfo/gcompris-devel" rel="noreferrer" target="_blank">https://mail.kde.org/mailman/listinfo/gcompris-devel</a><br>
>>>> ><br>
>>>> ><br>
>>><br>
>>><br>
>>><br>
>><br>
><br>
</div></div></blockquote></div><br></div>