mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 09:48:44 +02:00
commit
64a07440cc
5 changed files with 18 additions and 12 deletions
|
@ -20,8 +20,10 @@ Windows.Window {
|
||||||
property string newTabSource
|
property string newTabSource
|
||||||
property alias tabView: tabView
|
property alias tabView: tabView
|
||||||
onParentChanged: {
|
onParentChanged: {
|
||||||
x = 120;
|
if (parent) {
|
||||||
y = 120;
|
x = 120;
|
||||||
|
y = 120;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings {
|
Settings {
|
||||||
|
|
|
@ -11,10 +11,7 @@ import "../js/Utils.js" as Utils
|
||||||
FocusScope {
|
FocusScope {
|
||||||
id: desktop
|
id: desktop
|
||||||
objectName: "desktop"
|
objectName: "desktop"
|
||||||
|
anchors.fill: parent
|
||||||
// Allow the scale of the desktop to be changed without screwing up the size relative to the parent.
|
|
||||||
height: parent.height / scale
|
|
||||||
width: parent.width / scale
|
|
||||||
|
|
||||||
onHeightChanged: d.repositionAll();
|
onHeightChanged: d.repositionAll();
|
||||||
onWidthChanged: d.repositionAll();
|
onWidthChanged: d.repositionAll();
|
||||||
|
|
|
@ -254,15 +254,15 @@ QMessageBox::StandardButton OffscreenUi::critical(const QString& title, const QS
|
||||||
}
|
}
|
||||||
QMessageBox::StandardButton OffscreenUi::information(const QString& title, const QString& text,
|
QMessageBox::StandardButton OffscreenUi::information(const QString& title, const QString& text,
|
||||||
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
||||||
return DependencyManager::get<OffscreenUi>()->messageBox(QMessageBox::Icon::Critical, title, text, buttons, defaultButton);
|
return DependencyManager::get<OffscreenUi>()->messageBox(QMessageBox::Icon::Information, title, text, buttons, defaultButton);
|
||||||
}
|
}
|
||||||
QMessageBox::StandardButton OffscreenUi::question(const QString& title, const QString& text,
|
QMessageBox::StandardButton OffscreenUi::question(const QString& title, const QString& text,
|
||||||
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
||||||
return DependencyManager::get<OffscreenUi>()->messageBox(QMessageBox::Icon::Critical, title, text, buttons, defaultButton);
|
return DependencyManager::get<OffscreenUi>()->messageBox(QMessageBox::Icon::Question, title, text, buttons, defaultButton);
|
||||||
}
|
}
|
||||||
QMessageBox::StandardButton OffscreenUi::warning(const QString& title, const QString& text,
|
QMessageBox::StandardButton OffscreenUi::warning(const QString& title, const QString& text,
|
||||||
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) {
|
||||||
return DependencyManager::get<OffscreenUi>()->messageBox(QMessageBox::Icon::Critical, title, text, buttons, defaultButton);
|
return DependencyManager::get<OffscreenUi>()->messageBox(QMessageBox::Icon::Warning, title, text, buttons, defaultButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ public:
|
||||||
}
|
}
|
||||||
/// Same design as QMessageBox::question(), will block, returns result
|
/// Same design as QMessageBox::question(), will block, returns result
|
||||||
static QMessageBox::StandardButton question(void* ignored, const QString& title, const QString& text,
|
static QMessageBox::StandardButton question(void* ignored, const QString& title, const QString& text,
|
||||||
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
|
QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No,
|
||||||
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) {
|
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) {
|
||||||
return question(title, text, buttons, defaultButton);
|
return question(title, text, buttons, defaultButton);
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,18 +124,25 @@ void VrMenu::addMenu(QMenu* menu) {
|
||||||
new MenuUserData(menu, result);
|
new MenuUserData(menu, result);
|
||||||
auto menuAction = menu->menuAction();
|
auto menuAction = menu->menuAction();
|
||||||
updateQmlItemFromAction(result, menuAction);
|
updateQmlItemFromAction(result, menuAction);
|
||||||
QObject::connect(menuAction, &QAction::changed, [=] {
|
auto connection = QObject::connect(menuAction, &QAction::changed, [=] {
|
||||||
updateQmlItemFromAction(result, menuAction);
|
updateQmlItemFromAction(result, menuAction);
|
||||||
});
|
});
|
||||||
|
QObject::connect(qApp, &QCoreApplication::aboutToQuit, [=] {
|
||||||
|
QObject::disconnect(connection);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void bindActionToQmlAction(QObject* qmlAction, QAction* action) {
|
void bindActionToQmlAction(QObject* qmlAction, QAction* action) {
|
||||||
new MenuUserData(action, qmlAction);
|
new MenuUserData(action, qmlAction);
|
||||||
updateQmlItemFromAction(qmlAction, action);
|
updateQmlItemFromAction(qmlAction, action);
|
||||||
QObject::connect(action, &QAction::changed, [=] {
|
auto connection = QObject::connect(action, &QAction::changed, [=] {
|
||||||
updateQmlItemFromAction(qmlAction, action);
|
updateQmlItemFromAction(qmlAction, action);
|
||||||
});
|
});
|
||||||
|
QObject::connect(qApp, &QCoreApplication::aboutToQuit, [=] {
|
||||||
|
QObject::disconnect(connection);
|
||||||
|
});
|
||||||
|
|
||||||
QObject::connect(action, &QAction::toggled, [=](bool checked) {
|
QObject::connect(action, &QAction::toggled, [=](bool checked) {
|
||||||
qmlAction->setProperty("checked", checked);
|
qmlAction->setProperty("checked", checked);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue