-
gittyup comment widget 에 splitter 적용공부하자 2023. 6. 13. 12:13반응형
< patch >
version : 1.3.0
git base : db545a2582f48c769836178fb0a92f7d462e4490
diff --git a/src/ui/DetailView.cpp b/src/ui/DetailView.cpp index b05dee5..b1e9df8 100644 --- a/src/ui/DetailView.cpp +++ b/src/ui/DetailView.cpp @@ -492,9 +492,13 @@ DetailView::DetailView(const git::Repository &repo, QWidget *parent) layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); + mSplitter = new QSplitter(Qt::Vertical, this); // ksahn.add + mSplitter->setHandleWidth(5); // ksahn.add + mDetail = new StackedWidget(this); mDetail->setVisible(false); - layout->addWidget(mDetail); + //layout->addWidget(mDetail); // ksahn.modify + mSplitter->addWidget(mDetail); // ksahn.add mDetail->addWidget(new CommitDetail(this)); @@ -503,6 +507,7 @@ DetailView::DetailView(const git::Repository &repo, QWidget *parent) connect(mAuthorLabel, &QLabel::linkActivated, this, &DetailView::authorLinkActivated); updateAuthor(); + mSplitter->addWidget(mAuthorLabel); // ksahn.add mCommitEditor = new CommitEditor(repo, this); @@ -514,10 +519,15 @@ DetailView::DetailView(const git::Repository &repo, QWidget *parent) mDetail->addWidget(editorFrame); mContent = new QStackedWidget(this); - layout->addWidget(mContent, 1); + //layout->addWidget(mContent, 1); // ksahn.modify + mSplitter->addWidget(mContent); // ksahn.add mContent->addWidget(new DoubleTreeWidget(repo, this)); mContent->addWidget(new TreeWidget(repo, this)); + + mSplitter->setStretchFactor(0, 0); // ksahn.add + mSplitter->setStretchFactor(1, 1); // ksahn.add + layout->addWidget(mSplitter); // ksahn.add } DetailView::~DetailView() {} diff --git a/src/ui/DetailView.h b/src/ui/DetailView.h index 3324e42..f61a67e 100644 --- a/src/ui/DetailView.h +++ b/src/ui/DetailView.h @@ -13,6 +13,7 @@ #include "RepoView.h" #include <QLabel> #include <QWidget> +#include <QLabel> class QStackedWidget; @@ -96,6 +97,7 @@ private: QString mOverrideUser; QString mOverrideEmail; CommitEditor *mCommitEditor; + QSplitter *mSplitter; void authorLinkActivated(const QString &href); void updateAuthor();
반응형'공부하자' 카테고리의 다른 글
Spyder IDE for python 바로가기 생성 (0) 2023.04.10 virtualbox 에서 com 포트를 ubuntu 로 사용 (0) 2019.12.10 Ubuntu 16.04 에 python 3.7.2 설치 (0) 2019.12.03 Ubuntu 18.04 apt 의존성 문제 (0) 2019.11.13 calibmgr 없이 다음 라운드 진행 (0) 2018.10.27