| 3600 | } |
| 3601 | |
| 3602 | QDomElement MainWindow::saveSourceTimelineViewState(QDomDocument& doc) const { |
| 3603 | // Read the view chrome off the widgets; layout_xml owns the XML schema. |
| 3604 | layout_xml::SourceTimelineViewState state; |
| 3605 | if (source_timeline_ != nullptr) { |
| 3606 | state.zoom = source_timeline_->zoom(); |
| 3607 | state.scroll_left_ns = source_timeline_->viewportLeftDisplayNs(); |
| 3608 | state.name_column_width = source_timeline_->nameColumnWidth(); |
| 3609 | } |
| 3610 | if (ui_->timelineAlignRail != nullptr) { |
| 3611 | if (auto* snap = ui_->timelineAlignRail->findChild<QToolButton*>(QStringLiteral("buttonTimelineSnap"))) { |
| 3612 | state.snap = snap->isChecked(); |
| 3613 | } |
| 3614 | } |
| 3615 | return layout_xml::writeSourceTimelineViewState(doc, state); |
| 3616 | } |
| 3617 | |
| 3618 | void MainWindow::restoreSourceTimelineViewState(const QDomElement& element) { |
| 3619 | if (source_timeline_ == nullptr) { |
nothing calls this directly
no test coverage detected