[GCompris-devel] Search feature

Johnny Jazeix jazeix at gmail.com
Fri Jan 22 10:26:29 UTC 2016


Hi,

great!

Please do a PR, we will need to review the code.

Johnny



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


More information about the GCompris-devel mailing list