mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-10 10:18:34 +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: {
|
onFeaturePermissionRequested: {
|
||||||
|
console.log('feature');
|
||||||
|
console.log(JSON.stringify(feature, null, 4));
|
||||||
|
|
||||||
|
if (feature === 0) return;
|
||||||
console.log("Requesting permissions:")
|
console.log("Requesting permissions:")
|
||||||
permissionPopup.visible = true;
|
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
|
//disable popup
|
||||||
|
@ -193,4 +196,15 @@ Item {
|
||||||
webViewCore.focus = false;
|
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
|
id: root
|
||||||
width: 600
|
width: 600
|
||||||
height: 200
|
height: 200
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
z:100
|
z:100
|
||||||
|
signal permissionButtonPressed(real buttonNumber)
|
||||||
|
|
||||||
// anchors.top: buttons.bottom
|
// anchors.top: buttons.bottom
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -20,7 +23,7 @@ Item {
|
||||||
Row {
|
Row {
|
||||||
id: webAccessHeaderContainer
|
id: webAccessHeaderContainer
|
||||||
height: root.height * 0.30
|
height: root.height * 0.30
|
||||||
HifiStyles.RalewayLight {
|
HifiStyles.RalewayBold {
|
||||||
id: webAccessHeaderText
|
id: webAccessHeaderText
|
||||||
text: "WEB CAMERA ACCESS REQUEST"
|
text: "WEB CAMERA ACCESS REQUEST"
|
||||||
width: mainContainer.width
|
width: mainContainer.width
|
||||||
|
@ -41,7 +44,7 @@ Item {
|
||||||
id: webAccessInfoText
|
id: webAccessInfoText
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: "This domain is requesting access to your web camera and microphone"
|
text: "This domain is requesting access to your web camera and microphone"
|
||||||
size: 17
|
size: 15
|
||||||
color: hifi.colors.black
|
color: hifi.colors.black
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,7 +52,7 @@ Item {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: permissionsButtonRow
|
id: permissionsButtonRow
|
||||||
color: "#AAAAAA"
|
color: "#AAAAAA"
|
||||||
anchors.topMargin: 10
|
anchors.topMargin: 35
|
||||||
height: 50
|
height: 50
|
||||||
width: leftButton.width + rightButton.width + (this.space * 3)
|
width: leftButton.width + rightButton.width + (this.space * 3)
|
||||||
anchors.top: webAccessInfoContainer.bottom
|
anchors.top: webAccessInfoContainer.bottom
|
||||||
|
@ -63,9 +66,13 @@ Item {
|
||||||
|
|
||||||
text: "Yes allow access"
|
text: "Yes allow access"
|
||||||
color: hifi.buttons.blue
|
color: hifi.buttons.blue
|
||||||
colorScheme: root.colorScheme
|
// colorScheme: root.colorScheme
|
||||||
enabled: true
|
enabled: true
|
||||||
width: 155
|
width: 155
|
||||||
|
onClicked: {
|
||||||
|
console.log("\n\n JUST CLICKED BUTTON 0, GOING TO SEND SIGNAL!")
|
||||||
|
root.permissionButtonPressed(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
HifiControls.Button {
|
HifiControls.Button {
|
||||||
id: rightButton
|
id: rightButton
|
||||||
|
@ -73,8 +80,12 @@ Item {
|
||||||
anchors.leftMargin: permissionsButtonRow.space
|
anchors.leftMargin: permissionsButtonRow.space
|
||||||
text: "Don't Allow"
|
text: "Don't Allow"
|
||||||
color: hifi.buttons.red
|
color: hifi.buttons.red
|
||||||
colorScheme: root.colorScheme
|
// colorScheme: root.colorScheme
|
||||||
enabled: true
|
enabled: true
|
||||||
|
onClicked: {
|
||||||
|
console.log("\n\n JUST CLICKED BUTTON 1, GOING TO SEND SIGNAL!")
|
||||||
|
root.permissionButtonPressed(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,28 +7,34 @@ import "../."
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: permissionPopupBackground
|
id: permissionPopupBackground
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: QT.rgba(0, 0, 0, 0.7);
|
color: Qt.rgba(0, 0, 0, 0.5);
|
||||||
HifiConstants { id: hifi }
|
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 {
|
PermissionPopup {
|
||||||
id: permissionPopupItem
|
id: permissionPopupItem
|
||||||
visible: false
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
console.log("\n\n TESTING!! \n\n")
|
console.log("test");
|
||||||
|
// console.log("\n\n TESTING!! \n\n")
|
||||||
}
|
}
|
||||||
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
permissionPopupBackground.visible = false;
|
permissionPopupBackground.visible = false;
|
||||||
}
|
permissionsOptions.securityOrigin = "none";
|
||||||
permissionPopupBackground.visible = true;
|
permissionsOptions.feature = "none";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,36 +222,6 @@ function onEmoteAppBarClosed() {
|
||||||
emoteAppBarWindow = false;
|
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_QML_PATH = Script.resourcesPath() + "qml/hifi/simplifiedUI/emoteApp/bar/EmoteAppBar.qml";
|
||||||
var EMOTE_APP_BAR_WINDOW_TITLE = "Emote";
|
var EMOTE_APP_BAR_WINDOW_TITLE = "Emote";
|
||||||
|
|
Loading…
Reference in a new issue