1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-10-07 01:37:08 +02:00

Add easier navigation via globalNavigationhelper

This commit is contained in:
kelteseth 2018-02-27 14:06:52 +01:00
parent 693495f342
commit ade59ca0b3
2 changed files with 17 additions and 1 deletions

View File

@ -1,4 +1,5 @@
#include <QDebug>

#include <QDebug>
#include <QDir>
#include <QFontDatabase>
#include <QGuiApplication>
@ -32,6 +33,8 @@
#include "steamworkshop.h"
#include "steamworkshoplistmodel.h"
#include "widget.h"
#include "globalnavigationhelper.h"
int main(int argc, char* argv[])
{
@ -76,6 +79,7 @@ int main(int argc, char* argv[])
steamErrorAPIInit = true;
}
GlobalNavigationHelper gnh;
InstalledListModel installedListModel;
MonitorListModel monitorListModel;
PackageFileHandler packageFileHandler;
@ -122,6 +126,8 @@ int main(int argc, char* argv[])
settings.loadActiveProfiles();
QQmlApplicationEngine mainWindowEngine;
mainWindowEngine.rootContext()->setContextProperty("globalNavigationHelper", &gnh);
mainWindowEngine.rootContext()->setContextProperty("installedListFilter", &installedListFilter);
mainWindowEngine.rootContext()->setContextProperty("workshopListModel", &steamWorkshopListModel);
mainWindowEngine.rootContext()->setContextProperty("monitorListModel", &monitorListModel);

View File

@ -25,6 +25,12 @@ ApplicationWindow {
setY(Screen.height / 2 - height / 2)
}
}
Connections {
target: globalNavigationHelper
onRequestNavigation:{
switchPage(nav)
}
}
LinearGradient {
id: tabShadow
@ -244,6 +250,10 @@ ApplicationWindow {
left: parent.left
}
onChangePage: {
if(monitors.state === "active"){
monitors.state = "inactive"
}
switchPage(name)
}