mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
working version with just flickable
This commit is contained in:
parent
43268c0f65
commit
fb7a66b110
4 changed files with 56 additions and 55 deletions
|
@ -141,14 +141,17 @@ Item {
|
|||
});
|
||||
}
|
||||
|
||||
Controls.PermissionPopup {
|
||||
id: permissionPopup
|
||||
}
|
||||
|
||||
onFeaturePermissionRequested: {
|
||||
console.log('feature');
|
||||
console.log(JSON.stringify(feature, null, 4));
|
||||
|
||||
if (feature === 0) return;
|
||||
console.log("Requesting permissions:")
|
||||
permissionPopup.visible = true;
|
||||
// grantFeaturePermission(securityOrigin, feature, false);
|
||||
console.log('security origin');
|
||||
console.log(JSON.stringify(securityOrigin, null, 4));
|
||||
permissionPopup.permissionsOptions.securityOrigin = securityOrigin;
|
||||
permissionPopup.permissionsOptions.feature = feature;
|
||||
}
|
||||
|
||||
//disable popup
|
||||
|
@ -193,4 +196,15 @@ Item {
|
|||
webViewCore.focus = false;
|
||||
}
|
||||
}
|
||||
|
||||
Controls.PermissionPopupBackground {
|
||||
id: permissionPopup
|
||||
onSendPermission: {
|
||||
console.log("security origin we are allowing", securityOrigin);
|
||||
console.log("feature we are allowing", securityOrigin);
|
||||
console.log("shouldGivePermission:", shouldGivePermission);
|
||||
webViewCore.grantFeaturePermission(securityOrigin, feature, shouldGivePermission)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,10 @@ Item {
|
|||
id: root
|
||||
width: 600
|
||||
height: 200
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
z:100
|
||||
signal permissionButtonPressed(real buttonNumber)
|
||||
|
||||
// anchors.top: buttons.bottom
|
||||
Rectangle {
|
||||
|
@ -20,7 +23,7 @@ Item {
|
|||
Row {
|
||||
id: webAccessHeaderContainer
|
||||
height: root.height * 0.30
|
||||
HifiStyles.RalewayLight {
|
||||
HifiStyles.RalewayBold {
|
||||
id: webAccessHeaderText
|
||||
text: "WEB CAMERA ACCESS REQUEST"
|
||||
width: mainContainer.width
|
||||
|
@ -41,7 +44,7 @@ Item {
|
|||
id: webAccessInfoText
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: "This domain is requesting access to your web camera and microphone"
|
||||
size: 17
|
||||
size: 15
|
||||
color: hifi.colors.black
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +52,7 @@ Item {
|
|||
Rectangle {
|
||||
id: permissionsButtonRow
|
||||
color: "#AAAAAA"
|
||||
anchors.topMargin: 10
|
||||
anchors.topMargin: 35
|
||||
height: 50
|
||||
width: leftButton.width + rightButton.width + (this.space * 3)
|
||||
anchors.top: webAccessInfoContainer.bottom
|
||||
|
@ -63,9 +66,13 @@ Item {
|
|||
|
||||
text: "Yes allow access"
|
||||
color: hifi.buttons.blue
|
||||
colorScheme: root.colorScheme
|
||||
// colorScheme: root.colorScheme
|
||||
enabled: true
|
||||
width: 155
|
||||
onClicked: {
|
||||
console.log("\n\n JUST CLICKED BUTTON 0, GOING TO SEND SIGNAL!")
|
||||
root.permissionButtonPressed(0)
|
||||
}
|
||||
}
|
||||
HifiControls.Button {
|
||||
id: rightButton
|
||||
|
@ -73,8 +80,12 @@ Item {
|
|||
anchors.leftMargin: permissionsButtonRow.space
|
||||
text: "Don't Allow"
|
||||
color: hifi.buttons.red
|
||||
colorScheme: root.colorScheme
|
||||
// colorScheme: root.colorScheme
|
||||
enabled: true
|
||||
onClicked: {
|
||||
console.log("\n\n JUST CLICKED BUTTON 1, GOING TO SEND SIGNAL!")
|
||||
root.permissionButtonPressed(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,28 +7,34 @@ import "../."
|
|||
Rectangle {
|
||||
id: permissionPopupBackground
|
||||
anchors.fill: parent
|
||||
color: QT.rgba(0, 0, 0, 0.7);
|
||||
color: Qt.rgba(0, 0, 0, 0.5);
|
||||
HifiConstants { id: hifi }
|
||||
visible: true
|
||||
property variant permissionsOptions: {'securityOrigin':'none','feature':'none'}
|
||||
signal sendPermission(string securityOrigin, string feature, bool shouldGivePermission)
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log("loaded component");
|
||||
// console.log("\n\n TESTING!! \n\n")
|
||||
}
|
||||
|
||||
PermissionPopup {
|
||||
id: permissionPopupItem
|
||||
visible: false
|
||||
Component.onCompleted: {
|
||||
console.log("\n\n TESTING!! \n\n")
|
||||
console.log("test");
|
||||
// console.log("\n\n TESTING!! \n\n")
|
||||
}
|
||||
}
|
||||
|
||||
onFeaturePermissionRequested: {
|
||||
permissionPopupItem.onLeftButtonClicked = function() {
|
||||
console.log("TEST FOR PERMISSIONS :: LEFT CLICKED");
|
||||
grantFeaturePermission(securityOrigin, feature, true);
|
||||
.visible = false;
|
||||
}
|
||||
permissionPopupItem.onRightButtonClicked = function() {
|
||||
console.log("TEST FOR PERMISSIONS :: RIGHT CLICKED");
|
||||
grantFeaturePermission(securityOrigin, feature, false);
|
||||
onPermissionButtonPressed: {
|
||||
console.log("JUST MADE IT TO ON PERMISSIONS PRESSEED!");
|
||||
console.log(buttonNumber);
|
||||
if (buttonNumber === 0) {
|
||||
permissionPopupBackground.sendPermission(permissionsOptions.securityOrigin, permissionsOptions.feature, true)
|
||||
} else {
|
||||
permissionPopupBackground.sendPermission(permissionsOptions.securityOrigin, permissionsOptions.feature, false)
|
||||
}
|
||||
permissionPopupBackground.visible = false;
|
||||
permissionsOptions.securityOrigin = "none";
|
||||
permissionsOptions.feature = "none";
|
||||
}
|
||||
permissionPopupBackground.visible = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -222,36 +222,6 @@ function onEmoteAppBarClosed() {
|
|||
emoteAppBarWindow = false;
|
||||
}
|
||||
|
||||
var PERMISSION_QML_PATH = Script.resourcesPath() + "qml/hifi/Permission.qml";
|
||||
var PERMISSION_WINDOW_TITLE = "Permissions";
|
||||
var PERMISSION_WINDOW_PRESENTATION_MODE = Desktop.PresentationMode.NATIVE;
|
||||
var PERMISSION_WINDOW_WIDTH_PX = 600;
|
||||
var PERMISSION_WINDOW_HEIGHT_PX = 200;
|
||||
var PERMISSION_WINDOW_FLAGS =
|
||||
0x00000001 | // Qt::Window
|
||||
0x00000800 | // Qt::FramelessWindowHint
|
||||
0x40000000 | // Qt::NoDropShadowWindowHint
|
||||
0x00200000; // Qt::WindowDoesNotAcceptFocus
|
||||
var PERMISSION_WINDOW_LEFT_MARGIN = 600;
|
||||
var PERMISSION_WINDOW_BOTTOM_MARGIN = 200;
|
||||
var permissionWindow = false;
|
||||
function showPermissionsWindow() {
|
||||
permissionWindow = Desktop.createWindow(PERMISSION_QML_PATH, {
|
||||
title: PERMISSION_WINDOW_TITLE,
|
||||
presentationMode: PERMISSION_WINDOW_PRESENTATION_MODE,
|
||||
size: {
|
||||
x: PERMISSION_WINDOW_WIDTH_PX,
|
||||
y: PERMISSION_WINDOW_HEIGHT_PX
|
||||
},
|
||||
position: {
|
||||
x: Window.x + PERMISSION_WINDOW_LEFT_MARGIN,
|
||||
y: Window.y + Window.innerHeight - PERMISSION_WINDOW_BOTTOM_MARGIN
|
||||
},
|
||||
overrideFlags: PERMISSION_WINDOW_FLAGS
|
||||
});
|
||||
// emoteAppBarWindow.fromQml.connect(onMessageFromEmoteAppBar);
|
||||
// emoteAppBarWindow.closed.connect(onEmoteAppBarClosed);
|
||||
}
|
||||
|
||||
var EMOTE_APP_BAR_QML_PATH = Script.resourcesPath() + "qml/hifi/simplifiedUI/emoteApp/bar/EmoteAppBar.qml";
|
||||
var EMOTE_APP_BAR_WINDOW_TITLE = "Emote";
|
||||
|
|
Loading…
Reference in a new issue