119
119
property string searchEngine: settingsDefaults.searchEngine
120
120
property string allowOpenInBackgroundTab: settingsDefaults.allowOpenInBackgroundTab
121
121
property bool restoreSession: settingsDefaults.restoreSession
122
property int newTabDefaultSection: settingsDefaults.newTabDefaultSection
123
124
function restoreDefaults() {
124
125
homepage = settingsDefaults.homepage
125
126
searchEngine = settingsDefaults.searchEngine
126
127
allowOpenInBackgroundTab = settingsDefaults.allowOpenInBackgroundTab
127
128
restoreSession = settingsDefaults.restoreSession
129
newTabDefaultSection = settingsDefaults.newTabDefaultSection
135
137
readonly property string searchEngine: "google"
136
138
readonly property string allowOpenInBackgroundTab: "default"
137
139
readonly property bool restoreSession: true
140
readonly property int newTabDefaultSection: 0
141
144
anchors.fill: parent
142
visible: !settingsContainer.visible && !historyViewContainer.visible
145
visible: !settingsContainer.visible && !historyViewLoader.active
145
148
id: invisibleTabChrome
233
sourceComponent: browser.incognito ? newPrivateTabViewComponent : newTabViewComponent
237
sourceComponent: browser.incognito ? newPrivateTabView :
238
(browser.wide ? newTabViewWide : newTabView)
236
id: newTabViewComponent
239
historyModel: browser.historyModel
240
bookmarksModel: browser.bookmarksModel
241
settingsObject: settings
243
chrome.requestedUrl = url
244
currentWebview.url = url
245
tabContainer.forceActiveFocus()
247
onBookmarkRemoved: browser.bookmarksModel.remove(url)
248
onHistoryEntryClicked: {
249
chrome.requestedUrl = url
250
currentWebview.url = url
251
tabContainer.forceActiveFocus()
257
id: newPrivateTabViewComponent
259
NewPrivateTabView { }
245
historyModel: browser.historyModel
246
bookmarksModel: browser.bookmarksModel
247
settingsObject: settings
250
chrome.requestedUrl = url
251
currentWebview.url = url
252
tabContainer.forceActiveFocus()
254
onBookmarkRemoved: browser.bookmarksModel.remove(url)
255
onHistoryEntryClicked: {
256
chrome.requestedUrl = url
257
currentWebview.url = url
258
tabContainer.forceActiveFocus()
268
historyModel: browser.historyModel
269
bookmarksModel: browser.bookmarksModel
270
settingsObject: settings
273
chrome.requestedUrl = url
274
currentWebview.url = url
275
tabContainer.forceActiveFocus()
277
onBookmarkRemoved: browser.bookmarksModel.remove(url)
278
onHistoryEntryClicked: {
279
chrome.requestedUrl = url
280
currentWebview.url = url
281
tabContainer.forceActiveFocus()
283
onReleasingKeyboardFocus: chrome.focus = true
288
id: newPrivateTabView
290
NewPrivateTabView { anchors.fill: parent }
391
418
canSimplifyText: !browser.wide
392
419
editing: activeFocus || suggestionsList.activeFocus
394
Keys.onDownPressed: if (suggestionsList.count) suggestionsList.focus = true
421
Keys.onDownPressed: {
422
if (suggestionsList.count) suggestionsList.focus = true
423
else if (newTabViewLoader.status == Loader.Ready) {
424
newTabViewLoader.focus = true
395
428
Keys.onEscapePressed: {
396
429
if (chrome.findInPageMode) {
397
430
chrome.findInPageMode = false
719
id: historyViewContainer
720
objectName: "historyView"
752
id: historyViewLoader
722
visible: children.length > 0
723
754
anchors.fill: parent
756
sourceComponent: browser.wide ? historyViewWideComponent : historyViewComponent
759
if (status == Loader.Ready) {
760
historyViewLoader.item.forceActiveFocus()
762
internal.resetFocus()
766
Keys.onEscapePressed: historyViewLoader.active = false
769
// Set the model asynchronously to ensure
770
// the view is displayed as early as possible.
771
running: historyViewLoader.active
773
onTriggered: historyViewLoader.item.historyModel = browser.historyModel
726
777
id: historyViewComponent
729
780
anchors.fill: parent
730
visible: historyViewContainer.children.length == 1
782
onSeeMoreEntriesClicked: {
783
var view = expandedHistoryViewComponent.createObject(expandedHistoryViewContainer, {model: model})
784
view.onHistoryEntryClicked.connect(done)
786
onDone: historyViewLoader.active = false
789
id: expandedHistoryViewContainer
791
visible: children.length > 0
795
id: expandedHistoryViewComponent
797
ExpandedHistoryView {
800
onHistoryEntryClicked: {
801
browser.openUrlInNewTab(url, true)
804
onHistoryEntryRemoved: {
808
browser.historyModel.removeEntryByUrl(url)
818
id: historyViewWideComponent
733
823
Keys.onEscapePressed: {
824
historyViewLoader.active = false
735
825
internal.resetFocus()
743
833
onTriggered: historyModel = browser.historyModel
746
onSeeMoreEntriesClicked: {
747
var view = expandedHistoryViewComponent.createObject(historyViewContainer, {model: model})
748
view.onHistoryEntryClicked.connect(destroy)
755
id: expandedHistoryViewComponent
757
ExpandedHistoryView {
760
836
onHistoryEntryClicked: {
761
837
browser.openUrlInNewTab(url, true)
764
onHistoryEntryRemoved: {
768
browser.historyModel.removeEntryByUrl(url)
840
onHistoryEntryRemoved: browser.historyModel.removeEntryByUrl(url)
841
onNewTabRequested: browser.openUrlInNewTab("", true)
842
onDone: historyViewLoader.active = false
1449
1521
modifiers: Qt.ControlModifier
1451
1523
enabled: chrome.visible
1453
if (historyViewContainer.children.length === 0) {
1454
historyViewComponent.createObject(historyViewContainer)
1455
historyViewContainer.focus = true
1524
onTriggered: historyViewLoader.active = true
1460
1527
// Alt+← or Backspace: Goes to the previous page in history