Commit a98fbf2d authored by LordTermor's avatar LordTermor

Various fixes

parent 9dcdb379
......@@ -96,6 +96,9 @@ void Application::restoreGeometry()
void Application::loadMainWindow()
{
if(m_objects["mainWindow"]!=nullptr){
return;
}
qmlRegisterSingletonType<QmlDialogRunner>("DialogRunner",1,0,"DialogRunner",
[](QQmlEngine *m_engine, QJSEngine *scriptEngine)->QObject*{
Q_UNUSED(scriptEngine)
......@@ -103,9 +106,6 @@ void Application::loadMainWindow()
return new QmlDialogRunner("mainWindow", m_engine);
});
if(m_objects["mainWindow"]!=nullptr){
return;
}
m_engine.load(QUrl(QStringLiteral("qrc:/src/qml/Pages/MainWindow.qml")));
restoreGeometry();
......@@ -114,7 +114,6 @@ void Application::loadMainWindow()
saveGeometry();
m_objects.take("mainWindow")->deleteLater();
});
}
void Application::loadOpenWithDialog(const QString &filename)
......
......@@ -42,9 +42,9 @@ LoaderDelegate{
}
onDoubleClicked: {
if(list.packageList.every(value=>JSUtils.qmlTypeOf(value,"LibQPamac::AlpmPackage")))
stackView.push("../Pages/PagePackageInfo.qml",{pkg: packageList[index]})
stackView.push("../Pages/PagePackageInfo.qml",{pkg: packageList.filter((value)=>value.name===model.name)[0]})
else
stackView.push("../Pages/PageAURPackageInfo.qml",{pkg: packageList[index]})
stackView.push("../Pages/PageAURPackageInfo.qml",{pkg: packageList.filter((value)=>value.name===model.name)[0]})
}
onClicked: {
list.selectedRows = [];
......
......@@ -6,7 +6,6 @@ ListView {
boundsBehavior: Flickable.StopAtBounds
model: ["Description","Dependecies","Build files"]
delegate: Components.MenuItemDelegate{
backgroundColor: systemPalette.alternateBase
id:packageInfoDelegate
text:modelData
onClicked: {
......
......@@ -6,8 +6,12 @@ import QPamac.Async 1.0
import QtQuick.Layouts 1.3
import "../../js/JSUtils.js" as Utils
import "../Components/SideMenu" as SideMenu
import "../Components" as Components
Page {
background: Rectangle{
color: systemPalette.base
}
FutureWatcher{
id:detailsFutureWatcher
......@@ -27,10 +31,6 @@ Page {
}
SideMenu.Drawer {
background: Rectangle {
color: systemPalette.alternateBase
}
id: drawer
initialItem: SideMenu.SideMenuAURPackageInfo {
}
......@@ -273,7 +273,7 @@ Page {
height: contentHeight
boundsBehavior: Flickable.StopAtBounds
model: pkg.depends
delegate: ItemDelegate {
delegate: Components.MenuItemDelegate {
height: 25
text: modelData
......@@ -294,9 +294,10 @@ Page {
boundsBehavior: Flickable.StopAtBounds
width: 110
height: contentHeight
delegate: ItemDelegate {
delegate: Components.MenuItemDelegate {
height: 25
text: modelData
backgroundColor: systemPalette.base
onClicked: {
......@@ -308,6 +309,9 @@ Page {
}
}
Pane{
background: Rectangle{
color: systemPalette.base
}
id:buildFilesPage
anchors.fill: parent
property var buildFolder
......
......@@ -180,25 +180,31 @@ Page {
anchors.leftMargin: 0
wrapMode: Text.WordWrap
}
Image {
visible: source
id: screenshot
width: height * (sourceSize.width / sourceSize.height)
RowLayout{
visible: screenshotRepeater.model
height: visible ? 200 : 0
asynchronous: true
cache: false
fillMode: Image.PreserveAspectFit
source: pkg.screenshotUrl
MouseArea{
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
DialogRunner.exec("qrc:/src/qml/ScreenshotViewerDialog.qml",{source:screenshot.source})
Repeater{
id:screenshotRepeater
model: pkg.screenshots
Image {
id: screenshot
width: height * (sourceSize.width / sourceSize.height)
asynchronous: true
cache: false
fillMode: Image.PreserveAspectFit
source: modelData
MouseArea{
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
DialogRunner.exec("qrc:/src/qml/ScreenshotViewerDialog.qml",{source:screenshot.source})
}
}
}
}
}
Grid {
anchors.right: parent.right
anchors.rightMargin: 0
......@@ -376,9 +382,8 @@ Page {
delegate: Components.MenuItemDelegate {
height: 25
text: modelData
backgroundColor: systemPalette.base
onClicked: {
stackView.push("PagePackageInfo.qml", {"pkg" : Database.getPkg(modelData)});
}
}
......@@ -394,6 +399,7 @@ Page {
width: 110
height: contentHeight
delegate: Components.MenuItemDelegate {
backgroundColor: systemPalette.base
height: 25
text: modelData
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment