| 1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
|---|---|
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
| 5 | #include "historydiffwidget.h" |
| 6 | #include "historydiffview.h" |
| 7 | |
| 8 | #include "DiffInfo.h" |
| 9 | #include "DiffHelper.h" |
| 10 | |
| 11 | HistoryDiffWidget::HistoryDiffWidget(QWidget *parent) |
| 12 | : QSplitter (parent) |
| 13 | , oldView (new HistoryDiffView(HistoryDiffView::tr("Old File"))) |
| 14 | , newView (new HistoryDiffView(HistoryDiffView::tr("New File"))) |
| 15 | { |
| 16 | setStyleSheet("QSplitter{background-color: #2E2F30;}"); |
| 17 | oldView->setMinimumWidth(100); |
| 18 | newView->setMinimumWidth(100); |
| 19 | |
| 20 | addWidget(oldView); |
| 21 | setCollapsible(0, false); |
| 22 | addWidget(newView); |
| 23 | setCollapsible(1, false); |
| 24 | setHandleWidth(2); |
| 25 | } |
| 26 | |
| 27 | HistoryDiffView *HistoryDiffWidget::getOldView() const |
| 28 | { |
| 29 | return oldView; |
| 30 | } |
| 31 | |
| 32 | HistoryDiffView *HistoryDiffWidget::getNewView() const |
| 33 | { |
| 34 | return newView; |
| 35 | } |
| 36 |