{"action":"created","comment":{"url":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/comments/76771366","id":76771366,"diff_hunk":"@@ -0,0 +1,248 @@\n+/****************************************************************************************\n+**\n+** Copyright (C) 2013-2016 Jolla Ltd., Damien Caliste\n+** Contact: Raine Makelainen <raine.makelainen@jollamobile.com>\n+** Contact: Damien Caliste <dcaliste@free.fr>\n+** All rights reserved.\n+**\n+** This file is part of Sailfish Office package and is a modified\n+** version of SearchField.qml from Sailfish Silica package to add\n+** next and previous button, modify the clear button action to support\n+** cancellation and also introduce a new iconized state.\n+**\n+** You may use this file under the terms of BSD license as follows:\n+**\n+** Redistribution and use in source and binary forms, with or without\n+** modification, are permitted provided that the following conditions are met:\n+**     * Redistributions of source code must retain the above copyright\n+**       notice, this list of conditions and the following disclaimer.\n+**     * Redistributions in binary form must reproduce the above copyright\n+**       notice, this list of conditions and the following disclaimer in the\n+**       documentation and/or other materials provided with the distribution.\n+**     * Neither the name of the Jolla Ltd nor the\n+**       names of its contributors may be used to endorse or promote products\n+**       derived from this software without specific prior written permission.\n+**\n+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n+** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR\n+** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n+** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n+** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+**\n+****************************************************************************************/\n+\n+import QtQuick 2.0\n+import Sailfish.Silica 1.0\n+\n+BackgroundItem {\n+    id: root\n+\n+    property bool iconized: true\n+    property int modelCount: -1\n+    property real iconizedWidth\n+\n+    property real _margin: Math.max((iconizedWidth - searchIcon.width) / 2., 0.)\n+\n+    signal requestSearch(string text)\n+    signal requestPreviousMatch()\n+    signal requestNextMatch()\n+    signal requestCancel()\n+\n+    onClicked: iconized = false\n+    onIconizedChanged: if (!iconized) searchField.forceActiveFocus()\n+\n+    states: [State {\n+                 name: \"extended\"\n+                 when: !root.iconized\n+                 PropertyChanges {\n+                     target: root\n+                     _margin: Theme.horizontalPageMargin\n+                 }\n+             },\n+             State {\n+                 name: \"iconized\"\n+                 when: root.iconized\n+                 PropertyChanges {\n+                     target: root\n+                     width: iconizedWidth\n+                 }\n+             }]\n+    transitions: Transition {\n+        NumberAnimation {\n+            properties: \"_margin, width\"\n+            easing.type: Easing.InOutQuad\n+            duration: 400\n+        }\n+    }\n+    highlighted: down || searchIcon.down\n+\n+    IconButton {\n+        id: searchIcon\n+        anchors {\n+            left: parent.left\n+            leftMargin: _margin\n+        }\n+        width: icon.width\n+        height: parent.height\n+        icon.source: \"image://theme/icon-m-search\"\n+        highlighted: down || root.down || searchField.activeFocus\n+\n+        enabled: root.enabled","path":"plugin/SearchBarItem.qml","position":95,"original_position":95,"commit_id":"4cb3607660637884d7b433a79fbf54d36d68be8b","original_commit_id":"4cb3607660637884d7b433a79fbf54d36d68be8b","user":{"login":"dcaliste","id":5889532,"avatar_url":"https://avatars.githubusercontent.com/u/5889532?v=3","gravatar_id":"","url":"https://api.github.com/users/dcaliste","html_url":"https://github.com/dcaliste","followers_url":"https://api.github.com/users/dcaliste/followers","following_url":"https://api.github.com/users/dcaliste/following{/other_user}","gists_url":"https://api.github.com/users/dcaliste/gists{/gist_id}","starred_url":"https://api.github.com/users/dcaliste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcaliste/subscriptions","organizations_url":"https://api.github.com/users/dcaliste/orgs","repos_url":"https://api.github.com/users/dcaliste/repos","events_url":"https://api.github.com/users/dcaliste/events{/privacy}","received_events_url":"https://api.github.com/users/dcaliste/received_events","type":"User","site_admin":false},"body":"It's an old inheritance from SearchField.qml that I didn't removed. I will.","created_at":"2016-08-30T10:44:37Z","updated_at":"2016-08-30T10:44:37Z","html_url":"https://github.com/sailfishos/sailfish-office/pull/86#discussion_r76771366","pull_request_url":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/86","_links":{"self":{"href":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/comments/76771366"},"html":{"href":"https://github.com/sailfishos/sailfish-office/pull/86#discussion_r76771366"},"pull_request":{"href":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/86"}}},"pull_request":{"url":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/86","id":81622590,"html_url":"https://github.com/sailfishos/sailfish-office/pull/86","diff_url":"https://github.com/sailfishos/sailfish-office/pull/86.diff","patch_url":"https://github.com/sailfishos/sailfish-office/pull/86.patch","issue_url":"https://api.github.com/repos/sailfishos/sailfish-office/issues/86","number":86,"state":"open","locked":false,"title":"Design update of the toolbar","user":{"login":"dcaliste","id":5889532,"avatar_url":"https://avatars.githubusercontent.com/u/5889532?v=3","gravatar_id":"","url":"https://api.github.com/users/dcaliste","html_url":"https://github.com/dcaliste","followers_url":"https://api.github.com/users/dcaliste/followers","following_url":"https://api.github.com/users/dcaliste/following{/other_user}","gists_url":"https://api.github.com/users/dcaliste/gists{/gist_id}","starred_url":"https://api.github.com/users/dcaliste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcaliste/subscriptions","organizations_url":"https://api.github.com/users/dcaliste/orgs","repos_url":"https://api.github.com/users/dcaliste/repos","events_url":"https://api.github.com/users/dcaliste/events{/privacy}","received_events_url":"https://api.github.com/users/dcaliste/received_events","type":"User","site_admin":false},"body":"This pull request should match the new ui design for current capabilities of the toolbar, *i.e* page counter and search. The toolbar content is modified to contain BackgroundItem which width are the page width divided by the number of children in the toolbar. Like that, we can later easily add items for highlight and annotate.\r\n\r\n* The first commit modifies the page counter to use this new design and also match the design mockups (replace « / » by « | » and don't use any icon).\r\n* The second commit modifies the search tool by introducing a new Item called SearchBar that is a modified version of SearchField.qml (I kept the header for licences reasons) to add the two prev / next buttons and add an iconized state when in the tool bar. Also handle the number of matches with the label property (not shown in the mockups but present in the text).\r\n* The third commit is a bug correction commit, to avoid the toolbar to continue hiding on action. For instance, when taping on the search icon while the bar is transitioning to hide, the search field was not displayed because the toolbar was finishing its transition regardless of autoShowHide becoming false.\r\n\r\nImplementation is working on all orientations.","created_at":"2016-08-17T10:58:44Z","updated_at":"2016-08-30T10:44:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f169fac494e837a3cfeca902cd0d71d3d9275d3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/86/commits","review_comments_url":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/86/comments","review_comment_url":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sailfishos/sailfish-office/issues/86/comments","statuses_url":"https://api.github.com/repos/sailfishos/sailfish-office/statuses/4cb3607660637884d7b433a79fbf54d36d68be8b","head":{"label":"dcaliste:design","ref":"design","sha":"4cb3607660637884d7b433a79fbf54d36d68be8b","user":{"login":"dcaliste","id":5889532,"avatar_url":"https://avatars.githubusercontent.com/u/5889532?v=3","gravatar_id":"","url":"https://api.github.com/users/dcaliste","html_url":"https://github.com/dcaliste","followers_url":"https://api.github.com/users/dcaliste/followers","following_url":"https://api.github.com/users/dcaliste/following{/other_user}","gists_url":"https://api.github.com/users/dcaliste/gists{/gist_id}","starred_url":"https://api.github.com/users/dcaliste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcaliste/subscriptions","organizations_url":"https://api.github.com/users/dcaliste/orgs","repos_url":"https://api.github.com/users/dcaliste/repos","events_url":"https://api.github.com/users/dcaliste/events{/privacy}","received_events_url":"https://api.github.com/users/dcaliste/received_events","type":"User","site_admin":false},"repo":{"id":32389480,"name":"sailfish-office","full_name":"dcaliste/sailfish-office","owner":{"login":"dcaliste","id":5889532,"avatar_url":"https://avatars.githubusercontent.com/u/5889532?v=3","gravatar_id":"","url":"https://api.github.com/users/dcaliste","html_url":"https://github.com/dcaliste","followers_url":"https://api.github.com/users/dcaliste/followers","following_url":"https://api.github.com/users/dcaliste/following{/other_user}","gists_url":"https://api.github.com/users/dcaliste/gists{/gist_id}","starred_url":"https://api.github.com/users/dcaliste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcaliste/subscriptions","organizations_url":"https://api.github.com/users/dcaliste/orgs","repos_url":"https://api.github.com/users/dcaliste/repos","events_url":"https://api.github.com/users/dcaliste/events{/privacy}","received_events_url":"https://api.github.com/users/dcaliste/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dcaliste/sailfish-office","description":"Sailfish Office","fork":true,"url":"https://api.github.com/repos/dcaliste/sailfish-office","forks_url":"https://api.github.com/repos/dcaliste/sailfish-office/forks","keys_url":"https://api.github.com/repos/dcaliste/sailfish-office/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcaliste/sailfish-office/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcaliste/sailfish-office/teams","hooks_url":"https://api.github.com/repos/dcaliste/sailfish-office/hooks","issue_events_url":"https://api.github.com/repos/dcaliste/sailfish-office/issues/events{/number}","events_url":"https://api.github.com/repos/dcaliste/sailfish-office/events","assignees_url":"https://api.github.com/repos/dcaliste/sailfish-office/assignees{/user}","branches_url":"https://api.github.com/repos/dcaliste/sailfish-office/branches{/branch}","tags_url":"https://api.github.com/repos/dcaliste/sailfish-office/tags","blobs_url":"https://api.github.com/repos/dcaliste/sailfish-office/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcaliste/sailfish-office/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcaliste/sailfish-office/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcaliste/sailfish-office/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcaliste/sailfish-office/statuses/{sha}","languages_url":"https://api.github.com/repos/dcaliste/sailfish-office/languages","stargazers_url":"https://api.github.com/repos/dcaliste/sailfish-office/stargazers","contributors_url":"https://api.github.com/repos/dcaliste/sailfish-office/contributors","subscribers_url":"https://api.github.com/repos/dcaliste/sailfish-office/subscribers","subscription_url":"https://api.github.com/repos/dcaliste/sailfish-office/subscription","commits_url":"https://api.github.com/repos/dcaliste/sailfish-office/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcaliste/sailfish-office/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcaliste/sailfish-office/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcaliste/sailfish-office/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcaliste/sailfish-office/contents/{+path}","compare_url":"https://api.github.com/repos/dcaliste/sailfish-office/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcaliste/sailfish-office/merges","archive_url":"https://api.github.com/repos/dcaliste/sailfish-office/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcaliste/sailfish-office/downloads","issues_url":"https://api.github.com/repos/dcaliste/sailfish-office/issues{/number}","pulls_url":"https://api.github.com/repos/dcaliste/sailfish-office/pulls{/number}","milestones_url":"https://api.github.com/repos/dcaliste/sailfish-office/milestones{/number}","notifications_url":"https://api.github.com/repos/dcaliste/sailfish-office/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcaliste/sailfish-office/labels{/name}","releases_url":"https://api.github.com/repos/dcaliste/sailfish-office/releases{/id}","deployments_url":"https://api.github.com/repos/dcaliste/sailfish-office/deployments","created_at":"2015-03-17T11:28:28Z","updated_at":"2016-01-14T11:31:20Z","pushed_at":"2016-08-30T09:51:46Z","git_url":"git://github.com/dcaliste/sailfish-office.git","ssh_url":"git@github.com:dcaliste/sailfish-office.git","clone_url":"https://github.com/dcaliste/sailfish-office.git","svn_url":"https://github.com/dcaliste/sailfish-office","homepage":null,"size":679,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"sailfishos:master","ref":"master","sha":"1746e57a099c6da6bccd5408af01d08d4b1f650b","user":{"login":"sailfishos","id":6198659,"avatar_url":"https://avatars.githubusercontent.com/u/6198659?v=3","gravatar_id":"","url":"https://api.github.com/users/sailfishos","html_url":"https://github.com/sailfishos","followers_url":"https://api.github.com/users/sailfishos/followers","following_url":"https://api.github.com/users/sailfishos/following{/other_user}","gists_url":"https://api.github.com/users/sailfishos/gists{/gist_id}","starred_url":"https://api.github.com/users/sailfishos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sailfishos/subscriptions","organizations_url":"https://api.github.com/users/sailfishos/orgs","repos_url":"https://api.github.com/users/sailfishos/repos","events_url":"https://api.github.com/users/sailfishos/events{/privacy}","received_events_url":"https://api.github.com/users/sailfishos/received_events","type":"Organization","site_admin":false},"repo":{"id":20478568,"name":"sailfish-office","full_name":"sailfishos/sailfish-office","owner":{"login":"sailfishos","id":6198659,"avatar_url":"https://avatars.githubusercontent.com/u/6198659?v=3","gravatar_id":"","url":"https://api.github.com/users/sailfishos","html_url":"https://github.com/sailfishos","followers_url":"https://api.github.com/users/sailfishos/followers","following_url":"https://api.github.com/users/sailfishos/following{/other_user}","gists_url":"https://api.github.com/users/sailfishos/gists{/gist_id}","starred_url":"https://api.github.com/users/sailfishos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sailfishos/subscriptions","organizations_url":"https://api.github.com/users/sailfishos/orgs","repos_url":"https://api.github.com/users/sailfishos/repos","events_url":"https://api.github.com/users/sailfishos/events{/privacy}","received_events_url":"https://api.github.com/users/sailfishos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sailfishos/sailfish-office","description":"Sailfish Office","fork":false,"url":"https://api.github.com/repos/sailfishos/sailfish-office","forks_url":"https://api.github.com/repos/sailfishos/sailfish-office/forks","keys_url":"https://api.github.com/repos/sailfishos/sailfish-office/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sailfishos/sailfish-office/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sailfishos/sailfish-office/teams","hooks_url":"https://api.github.com/repos/sailfishos/sailfish-office/hooks","issue_events_url":"https://api.github.com/repos/sailfishos/sailfish-office/issues/events{/number}","events_url":"https://api.github.com/repos/sailfishos/sailfish-office/events","assignees_url":"https://api.github.com/repos/sailfishos/sailfish-office/assignees{/user}","branches_url":"https://api.github.com/repos/sailfishos/sailfish-office/branches{/branch}","tags_url":"https://api.github.com/repos/sailfishos/sailfish-office/tags","blobs_url":"https://api.github.com/repos/sailfishos/sailfish-office/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sailfishos/sailfish-office/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sailfishos/sailfish-office/git/refs{/sha}","trees_url":"https://api.github.com/repos/sailfishos/sailfish-office/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sailfishos/sailfish-office/statuses/{sha}","languages_url":"https://api.github.com/repos/sailfishos/sailfish-office/languages","stargazers_url":"https://api.github.com/repos/sailfishos/sailfish-office/stargazers","contributors_url":"https://api.github.com/repos/sailfishos/sailfish-office/contributors","subscribers_url":"https://api.github.com/repos/sailfishos/sailfish-office/subscribers","subscription_url":"https://api.github.com/repos/sailfishos/sailfish-office/subscription","commits_url":"https://api.github.com/repos/sailfishos/sailfish-office/commits{/sha}","git_commits_url":"https://api.github.com/repos/sailfishos/sailfish-office/git/commits{/sha}","comments_url":"https://api.github.com/repos/sailfishos/sailfish-office/comments{/number}","issue_comment_url":"https://api.github.com/repos/sailfishos/sailfish-office/issues/comments{/number}","contents_url":"https://api.github.com/repos/sailfishos/sailfish-office/contents/{+path}","compare_url":"https://api.github.com/repos/sailfishos/sailfish-office/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sailfishos/sailfish-office/merges","archive_url":"https://api.github.com/repos/sailfishos/sailfish-office/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sailfishos/sailfish-office/downloads","issues_url":"https://api.github.com/repos/sailfishos/sailfish-office/issues{/number}","pulls_url":"https://api.github.com/repos/sailfishos/sailfish-office/pulls{/number}","milestones_url":"https://api.github.com/repos/sailfishos/sailfish-office/milestones{/number}","notifications_url":"https://api.github.com/repos/sailfishos/sailfish-office/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sailfishos/sailfish-office/labels{/name}","releases_url":"https://api.github.com/repos/sailfishos/sailfish-office/releases{/id}","deployments_url":"https://api.github.com/repos/sailfishos/sailfish-office/deployments","created_at":"2014-06-04T10:08:14Z","updated_at":"2016-08-16T16:07:23Z","pushed_at":"2016-08-30T09:51:47Z","git_url":"git://github.com/sailfishos/sailfish-office.git","ssh_url":"git@github.com:sailfishos/sailfish-office.git","clone_url":"https://github.com/sailfishos/sailfish-office.git","svn_url":"https://github.com/sailfishos/sailfish-office","homepage":null,"size":685,"stargazers_count":43,"watchers_count":43,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":14,"forks":20,"open_issues":14,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/86"},"html":{"href":"https://github.com/sailfishos/sailfish-office/pull/86"},"issue":{"href":"https://api.github.com/repos/sailfishos/sailfish-office/issues/86"},"comments":{"href":"https://api.github.com/repos/sailfishos/sailfish-office/issues/86/comments"},"review_comments":{"href":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/86/comments"},"review_comment":{"href":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sailfishos/sailfish-office/pulls/86/commits"},"statuses":{"href":"https://api.github.com/repos/sailfishos/sailfish-office/statuses/4cb3607660637884d7b433a79fbf54d36d68be8b"}}}}
{"actor":{"display_login":"dcaliste"}}