~ubuntu-clock-dev/ubuntu-clock-app/saucy

« back to all changes in this revision

Viewing changes to clock/SearchBox.qml

  • Committer: Tarmac
  • Author(s): Victor Thompson
  • Date: 2014-02-01 15:22:38 UTC
  • mfrom: (314.1.2 fix-1274710)
  • Revision ID: tarmac-20140201152238-p6xmtqgr4yx50z5m
Force active focus of SearchBox text field. Fixes: https://bugs.launchpad.net/bugs/1274710.

Approved by Nekhelesh Ramananthan, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    // Property to hold the string inputted by the user. This is required in other places such as the XML Model for initiating an online query.
28
28
    property alias search_string: searchLabel.text
29
29
 
 
30
    // Property to store the focus property of the search field
 
31
    property bool setFocus: false
 
32
 
30
33
    // Signal connected to the search_timer triggered signal to expose it to outside objects
31
34
    signal searchTriggered()
32
35
 
33
 
    Component.onCompleted: search_timer.triggered.connect(searchTriggered)
34
 
    
 
36
    Component.onCompleted: {
 
37
        search_timer.triggered.connect(searchTriggered)
 
38
        if (setFocus) 
 
39
            searchLabel.forceActiveFocus()
 
40
    }
 
41
 
35
42
    // Search Label
36
43
    TextField {
37
44
        id: searchLabel