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:
parent
693495f342
commit
ade59ca0b3
@ -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);
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user