Changeset View
Changeset View
Standalone View
Standalone View
src/app/qml/Book.qml
Show First 20 Lines • Show All 416 Lines • ▼ Show 20 Line(s) | 413 | onSheetOpenChanged: { | |||
---|---|---|---|---|---|
417 | else { | 417 | else { | ||
418 | controlsShown = applicationWindow().controlsVisible; | 418 | controlsShown = applicationWindow().controlsVisible; | ||
419 | applicationWindow().controlsVisible = true; | 419 | applicationWindow().controlsVisible = true; | ||
420 | } | 420 | } | ||
421 | } | 421 | } | ||
422 | property bool controlsShown; | 422 | property bool controlsShown; | ||
423 | property QtObject currentBook: fakeBook; | 423 | property QtObject currentBook: fakeBook; | ||
424 | property QtObject fakeBook: Peruse.PropertyContainer { | 424 | property QtObject fakeBook: Peruse.PropertyContainer { | ||
425 | property string author: ""; | 425 | property var author: [""]; | ||
426 | property string title: ""; | 426 | property string title: ""; | ||
427 | property string filename: ""; | 427 | property string filename: ""; | ||
428 | property string publisher: ""; | 428 | property string publisher: ""; | ||
429 | property string thumbnail: ""; | 429 | property string thumbnail: ""; | ||
430 | property string currentPage: "0"; | 430 | property string currentPage: "0"; | ||
431 | property string totalPages: "0"; | 431 | property string totalPages: "0"; | ||
432 | property string comment: ""; | ||||
433 | property var tags: [""]; | ||||
434 | property var description: [""]; | ||||
435 | property string rating: "0"; | ||||
432 | } | 436 | } | ||
433 | Column { | 437 | Column { | ||
434 | clip: true; | 438 | clip: true; | ||
435 | width: root.width - Kirigami.Units.largeSpacing * 2; | 439 | width: root.width - Kirigami.Units.largeSpacing * 2; | ||
436 | height: childrenRect.height + Kirigami.Units.largeSpacing * 2; | 440 | height: childrenRect.height + Kirigami.Units.largeSpacing * 2; | ||
437 | spacing: Kirigami.Units.largeSpacing; | 441 | spacing: Kirigami.Units.largeSpacing; | ||
438 | ListComponents.BookTile { | 442 | ListComponents.BookTile { | ||
439 | id: detailsTile; | 443 | id: detailsTile; | ||
440 | height: neededHeight; | 444 | height: neededHeight; | ||
441 | width: parent.width; | 445 | width: parent.width; | ||
442 | author: bookInfo.currentBook.readProperty("author"); | 446 | author: bookInfo.currentBook.readProperty("author"); | ||
443 | publisher: bookInfo.currentBook.readProperty("publisher"); | 447 | publisher: bookInfo.currentBook.readProperty("publisher"); | ||
444 | title: bookInfo.currentBook.readProperty("title"); | 448 | title: bookInfo.currentBook.readProperty("title"); | ||
445 | filename: bookInfo.currentBook.readProperty("filename"); | 449 | filename: bookInfo.currentBook.readProperty("filename"); | ||
446 | thumbnail: bookInfo.currentBook.readProperty("thumbnail"); | 450 | thumbnail: bookInfo.currentBook.readProperty("thumbnail"); | ||
447 | categoryEntriesCount: 0; | 451 | categoryEntriesCount: 0; | ||
448 | currentPage: bookInfo.currentBook.readProperty("currentPage"); | 452 | currentPage: bookInfo.currentBook.readProperty("currentPage"); | ||
449 | totalPages: bookInfo.currentBook.readProperty("totalPages"); | 453 | totalPages: bookInfo.currentBook.readProperty("totalPages"); | ||
454 | description: bookInfo.currentBook.readProperty("description"); | ||||
450 | onBookSelected: { | 455 | onBookSelected: { | ||
451 | if(root.file !== filename) { | 456 | if(root.file !== filename) { | ||
452 | openSelected(); | 457 | openSelected(); | ||
453 | } | 458 | } | ||
454 | } | 459 | } | ||
455 | onBookDeleteRequested: { | 460 | onBookDeleteRequested: { | ||
456 | // Not strictly needed for the listview itself, but it's kind of | 461 | // Not strictly needed for the listview itself, but it's kind of | ||
457 | // nice for making sure the details tile is right | 462 | // nice for making sure the details tile is right | ||
458 | var oldIndex = seriesListView.currentIndex; | 463 | var oldIndex = seriesListView.currentIndex; | ||
459 | seriesListView.currentIndex = -1; | 464 | seriesListView.currentIndex = -1; | ||
460 | contentList.removeBook(detailsTile.filename, true); | 465 | contentList.removeBook(detailsTile.filename, true); | ||
461 | seriesListView.currentIndex = oldIndex; | 466 | seriesListView.currentIndex = oldIndex; | ||
462 | } | 467 | } | ||
463 | } | 468 | } | ||
464 | // tags and ratings, comment by self | 469 | // tags and ratings, comment by self | ||
465 | // store hook for known series with more content | 470 | // store hook for known series with more content | ||
466 | ListView { | 471 | ListView { | ||
467 | id: seriesListView; | 472 | id: seriesListView; | ||
468 | width: parent.width; | 473 | width: parent.width; | ||
469 | height: Kirigami.Units.gridUnit * 12; | 474 | height: Kirigami.Units.gridUnit * 12; | ||
470 | orientation: ListView.Horizontal; | 475 | orientation: ListView.Horizontal; | ||
471 | NumberAnimation { id: seriesListAnimation; target: seriesListView; property: "contentX"; duration: applicationWindow().animationDuration; easing.type: Easing.InOutQuad; } | 476 | NumberAnimation { id: seriesListAnimation; target: seriesListView; property: "contentX"; duration: applicationWindow().animationDuration; easing.type: Easing.InOutQuad; } | ||
472 | delegate: ListComponents.BookTileTall { | 477 | delegate: ListComponents.BookTileTall { | ||
473 | height: model.filename != "" ? neededHeight : 1; | 478 | height: model.filename !== "" ? neededHeight : 1; | ||
474 | width: seriesListView.width / 3; | 479 | width: seriesListView.width / 3; | ||
475 | author: model.author; | 480 | author: model.author; | ||
476 | title: model.title; | 481 | title: model.title; | ||
477 | filename: model.filename; | 482 | filename: model.filename; | ||
478 | thumbnail: model.thumbnail; | 483 | thumbnail: model.thumbnail; | ||
479 | categoryEntriesCount: 0; | 484 | categoryEntriesCount: 0; | ||
480 | currentPage: model.currentPage; | 485 | currentPage: model.currentPage; | ||
481 | totalPages: model.totalPages; | 486 | totalPages: model.totalPages; | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |