20
20
import Ubuntu.Components 1.3
21
21
import Ubuntu.Components.Popups 1.3
22
import com.canonical.Oxide 1.0 as Oxide
22
import com.canonical.Oxide 1.8 as Oxide
24
24
import "urlManagement.js" as UrlManagement
40
40
property bool canSimplifyText: true
41
41
property bool editing: false
42
42
property bool showFavicon: true
43
property bool findInPageMode: false
44
property var findController: null
44
46
property var securityStatus: null
182
secondaryItem: MouseArea {
184
objectName: "bookmarkToggle"
186
192
height: textField.height
187
width: visible ? height : 0
189
visible: internal.idle && addressbar.actualUrl.toString()
192
height: parent.height - units.gu(2)
194
anchors.centerIn: parent
196
name: addressbar.bookmarked ? "starred" : "non-starred"
197
color: addressbar.bookmarked ? UbuntuColors.orange : UbuntuColors.darkGrey
195
objectName: "findInPageCounter"
196
anchors.verticalCenter: parent.verticalCenter
198
color: UbuntuColors.darkGrey
199
opacity: findController && findController.count > 0 ? 1.0 : 0.6
200
visible: findInPageMode
202
// TRANSLATORS: %2 refers to the total number of find in page results and %1 to the highlighted result
203
text: i18n.tr("%1/%2").arg(current).arg(count)
204
property int current: findController ? findController.current : 0
205
property int count: findController ? findController.count : 0
200
onClicked: addressbar.bookmarked = !addressbar.bookmarked
203
id: bookmarkTogglePlaceHolderItem
210
objectName: "bookmarkToggle"
212
height: parent.height
213
width: visible ? height : 0
215
visible: !findInPageMode && internal.idle && addressbar.actualUrl.toString()
218
height: parent.height - units.gu(2)
220
anchors.centerIn: parent
222
name: addressbar.bookmarked ? "starred" : "non-starred"
223
color: addressbar.bookmarked ? UbuntuColors.orange : UbuntuColors.darkGrey
226
onClicked: addressbar.bookmarked = !addressbar.bookmarked
229
id: bookmarkTogglePlaceHolderItem
209
236
color: UbuntuColors.darkGrey
210
237
inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhUrlCharactersOnly
212
placeholderText: i18n.tr("search or enter an address")
239
placeholderText: findInPageMode ? i18n.tr("find in page")
240
: i18n.tr("search or enter an address")
214
242
// Work around the "fix" for http://pad.lv/1089370 which
215
243
// unsets focus on the TextField when it becomes invisible
326
366
onCanSimplifyTextChanged: {
367
if (editing || findInPageMode) return
328
368
if (canSimplifyText && !loading && actualUrl.toString()) {
329
369
text = internal.simplifyUrl(actualUrl)
330
370
internal.simplified = true
399
onFindInPageModeChanged: {
400
if (findInPageMode) return
401
if (canSimplifyText) {
402
text = internal.simplifyUrl(actualUrl)
403
internal.simplified = true
406
internal.simplified = false
359
410
function showSecurityCertificateDetails() {
360
411
if (!internal.securityCertificateDetails) {
361
412
internal.securityCertificateDetails = PopupUtils.open(Qt.resolvedUrl("SecurityCertificatePopover.qml"), certificatePopoverPositioner, {"securityStatus": securityStatus})