Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma Mobile
Angelfish
Commits
2fcbd9ba
Verified
Commit
2fcbd9ba
authored
Oct 14, 2019
by
Jonah Brüchert
Browse files
Comment and simplify code
parent
22da7c72
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/contents/ui/WebView.qml
View file @
2fcbd9ba
...
...
@@ -33,7 +33,16 @@ WebEngineView {
property
string
errorCode
:
""
property
string
errorString
:
""
/**
* User agent used on mobile devices
*/
property
string
mobileUserAgent
:
"
Mozilla/5.0 (Linux; Plasma Mobile, like Android 9.0 ) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/69.0.3497.128 Mobile Safari/537.36
"
/**
* User agent used on desktop devices,
* Defaults to QtWebEngine's default (it is only supported on desktop devices by Qt currently)
*/
property
string
desktopUserAgent
:
profile
.
httpUserAgent
width
:
pageWidth
...
...
@@ -74,9 +83,11 @@ WebEngineView {
}
settings
{
// Disable builtin error pages in favor of our own
errorPageEnabled
:
false
}
// Custom context menu
Controls.Menu
{
property
var
request
id
:
contextMenu
...
...
src/contents/ui/webbrowser.qml
View file @
2fcbd9ba
...
...
@@ -71,6 +71,9 @@ Kirigami.ApplicationWindow {
width
:
Kirigami
.
Units
.
gridUnit
*
20
height
:
Kirigami
.
Units
.
gridUnit
*
30
/**
* Add page of currently active webview to history
*/
function
addHistoryEntry
()
{
//print("Adding history");
var
request
=
new
Object
;
// FIXME
...
...
@@ -80,8 +83,8 @@ Kirigami.ApplicationWindow {
browserManager
.
addToHistory
(
request
);
}
// Only show ToolBar if a layer is open
property
bool
layerShown
:
pageStack
.
layers
.
depth
>
1
pageStack.globalToolBar.style
:
layerShown
?
Kirigami
.
ApplicationHeaderStyle
.
Auto
:
Kirigami
.
ApplicationHeaderStyle
.
None
globalDrawer
:
Kirigami.GlobalDrawer
{
...
...
@@ -134,6 +137,7 @@ Kirigami.ApplicationWindow {
handleVisible
:
false
}
// Main Page
pageStack.initialPage
:
Kirigami.Page
{
id
:
rootPage
leftPadding
:
0
...
...
@@ -228,17 +232,14 @@ Kirigami.ApplicationWindow {
id
:
permissionQuestion
text
:
{
var
text
=
""
if
(
permission
===
WebEngineView
.
Geolocation
)
text
=
i18n
(
"
Do you want to allow the website to access the geo location?
"
)
i18n
(
"
Do you want to allow the website to access the geo location?
"
)
else
if
(
permission
===
WebEngineView
.
MediaAudioCapture
)
text
=
i18n
(
"
Do you want to allow the website to access the microphone?
"
)
i18n
(
"
Do you want to allow the website to access the microphone?
"
)
else
if
(
permission
===
WebEngineView
.
MediaVideoCapture
)
text
=
i18n
(
"
Do you want to allow the website to access the camera?
"
)
i18n
(
"
Do you want to allow the website to access the camera?
"
)
else
if
(
permission
===
WebEngineView
.
MediaAudioVideoCapture
)
text
=
i18n
(
"
Do you want to allow the website to access the camera and the microphone?
"
)
text
i18n
(
"
Do you want to allow the website to access the camera and the microphone?
"
)
}
showCloseButton
:
false
anchors.bottom
:
navigation
.
top
...
...
@@ -294,6 +295,7 @@ Kirigami.ApplicationWindow {
}
// Find in page
InputSheet
{
id
:
findSheet
title
:
i18n
(
"
Find in page
"
)
...
...
@@ -302,11 +304,12 @@ Kirigami.ApplicationWindow {
onAccepted
:
currentWebView
.
findText
(
findSheet
.
text
)
}
// Share page
ShareSheet
{
id
:
shareSheet
}
// The menu at the to
p
right
// The menu at the
bot
to
m
right
contextualActions
:
[
Kirigami.Action
{
icon.name
:
"
edit-find
"
...
...
@@ -365,6 +368,7 @@ Kirigami.ApplicationWindow {
}
]
// Bottom navigation bar
Navigation
{
id
:
navigation
navigationShown
:
!
webappcontainer
&&
webBrowser
.
visibility
!==
Window
.
FullScreen
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment