Today
-
Yesterday
-
Total
-
  • gittyup comment widget 에 splitter 적용
    공부하자 2023. 6. 13. 12:13
    반응형

    - patch code image -

    < 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();
    반응형

    댓글

Designed by Tistory.