mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:18:05 +02:00
put application in full screen mode
This commit is contained in:
parent
05c4c32e30
commit
8a57a64617
3 changed files with 31 additions and 29 deletions
|
@ -11,14 +11,13 @@ if (ANDROID)
|
||||||
set(ANDROID_ACTIVITY_NAME io.highfidelity.gvrinterface.InterfaceActivity)
|
set(ANDROID_ACTIVITY_NAME io.highfidelity.gvrinterface.InterfaceActivity)
|
||||||
set(ANDROID_APK_VERSION_NAME "0.1")
|
set(ANDROID_APK_VERSION_NAME "0.1")
|
||||||
set(ANDROID_APK_VERSION_CODE 1)
|
set(ANDROID_APK_VERSION_CODE 1)
|
||||||
|
set(ANDROID_APK_FULLSCREEN TRUE)
|
||||||
set(ANDROID_DEPLOY_QT_INSTALL "--install")
|
set(ANDROID_DEPLOY_QT_INSTALL "--install")
|
||||||
|
|
||||||
set(BUILD_SHARED_LIBS ON)
|
set(BUILD_SHARED_LIBS ON)
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ANDROID_APK_OUTPUT_DIR}/libs/${ANDROID_ABI}")
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ANDROID_APK_OUTPUT_DIR}/libs/${ANDROID_ABI}")
|
||||||
|
|
||||||
setup_hifi_library(Gui Widgets AndroidExtras)
|
setup_hifi_library(Gui Widgets AndroidExtras)
|
||||||
|
|
||||||
add_definitions(-DANDROID)
|
|
||||||
else ()
|
else ()
|
||||||
setup_hifi_project(Gui Widgets)
|
setup_hifi_project(Gui Widgets)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
#include "GVRMainWindow.h"
|
#include "GVRMainWindow.h"
|
||||||
|
|
||||||
GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
||||||
QMainWindow(parent)
|
QMainWindow(parent),
|
||||||
|
_menuBar(NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
|
@ -35,25 +36,7 @@ GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
||||||
setFixedSize(NOTE_4_WIDTH / 2, NOTE_4_HEIGHT / 2);
|
setFixedSize(NOTE_4_WIDTH / 2, NOTE_4_HEIGHT / 2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QMenu* fileMenu = new QMenu("File");
|
setupMenuBar();
|
||||||
QMenu* helpMenu = new QMenu("Help");
|
|
||||||
|
|
||||||
menuBar()->addMenu(fileMenu);
|
|
||||||
menuBar()->addMenu(helpMenu);
|
|
||||||
|
|
||||||
QAction* goToAddress = new QAction("Go to Address", fileMenu);
|
|
||||||
connect(goToAddress, &QAction::triggered, this, &GVRMainWindow::showAddressBar);
|
|
||||||
fileMenu->addAction(goToAddress);
|
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
QAction* goFullScreen = new QAction("Enter Full Screen", fileMenu);
|
|
||||||
connect(goFullScreen, &QAction::triggered, this, &GVRMainWindow::goFullScreen);
|
|
||||||
fileMenu->addAction(goFullScreen);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QAction* aboutQt = new QAction("About Qt", helpMenu);
|
|
||||||
connect(aboutQt, &QAction::triggered, qApp, &QApplication::aboutQt);
|
|
||||||
helpMenu->addAction(aboutQt);
|
|
||||||
|
|
||||||
QWidget* baseWidget = new QWidget(this);
|
QWidget* baseWidget = new QWidget(this);
|
||||||
|
|
||||||
|
@ -70,12 +53,28 @@ GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
||||||
new InterfaceView(baseWidget);
|
new InterfaceView(baseWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GVRMainWindow::goFullScreen() {
|
GVRMainWindow::~GVRMainWindow() {
|
||||||
#ifdef ANDROID
|
delete _menuBar;
|
||||||
menuBar()->hide();
|
}
|
||||||
#else
|
|
||||||
showFullScreen();
|
void GVRMainWindow::setupMenuBar() {
|
||||||
#endif
|
QMenu* fileMenu = new QMenu("File");
|
||||||
|
QMenu* helpMenu = new QMenu("Help");
|
||||||
|
|
||||||
|
_menuBar = new QMenuBar(0);
|
||||||
|
|
||||||
|
_menuBar->addMenu(fileMenu);
|
||||||
|
_menuBar->addMenu(helpMenu);
|
||||||
|
|
||||||
|
QAction* goToAddress = new QAction("Go to Address", fileMenu);
|
||||||
|
connect(goToAddress, &QAction::triggered, this, &GVRMainWindow::showAddressBar);
|
||||||
|
fileMenu->addAction(goToAddress);
|
||||||
|
|
||||||
|
QAction* aboutQt = new QAction("About Qt", helpMenu);
|
||||||
|
connect(aboutQt, &QAction::triggered, qApp, &QApplication::aboutQt);
|
||||||
|
helpMenu->addAction(aboutQt);
|
||||||
|
|
||||||
|
setMenuBar(_menuBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GVRMainWindow::showAddressBar() {
|
void GVRMainWindow::showAddressBar() {
|
||||||
|
|
|
@ -14,17 +14,21 @@
|
||||||
|
|
||||||
#include <QtWidgets/QMainWindow>
|
#include <QtWidgets/QMainWindow>
|
||||||
|
|
||||||
|
class QMenuBar;
|
||||||
class QVBoxLayout;
|
class QVBoxLayout;
|
||||||
|
|
||||||
class GVRMainWindow : public QMainWindow {
|
class GVRMainWindow : public QMainWindow {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
GVRMainWindow(QWidget* parent = 0);
|
GVRMainWindow(QWidget* parent = 0);
|
||||||
|
~GVRMainWindow();
|
||||||
public slots:
|
public slots:
|
||||||
void showAddressBar();
|
void showAddressBar();
|
||||||
void goFullScreen();
|
|
||||||
private:
|
private:
|
||||||
|
void setupMenuBar();
|
||||||
|
|
||||||
QVBoxLayout* _mainLayout;
|
QVBoxLayout* _mainLayout;
|
||||||
|
QMenuBar* _menuBar;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_GVRMainWindow_h
|
#endif // hifi_GVRMainWindow_h
|
||||||
|
|
Loading…
Reference in a new issue