Put branches viewport into a scrollable area.

This commit is contained in:
mjbudd77 2021-12-12 13:40:23 -05:00
parent 8ab19f64f6
commit 6f3b25646d
2 changed files with 33 additions and 13 deletions

View File

@ -198,6 +198,9 @@ TasEditorWindow::TasEditorWindow(QWidget *parent)
mainHBox->addWidget( controlPanelContainerWidget );
mainLayout->addWidget(mainHBox);
mainHBox->setStretchFactor( 0, 5 );
mainHBox->setStretchFactor( 1, 1 );
menuBar = buildMenuBar();
setLayout(mainLayout);
@ -1033,7 +1036,7 @@ void TasEditorWindow::buildSideControlPanel(void)
QVBoxLayout *vbox;
QHBoxLayout *hbox;
QGridLayout *grid;
QScrollArea *scrollArea;
QScrollArea *scrollArea1, *scrollArea2;
QTreeWidgetItem *item;
ctlPanelMainVbox = new QVBoxLayout();
@ -1140,17 +1143,25 @@ void TasEditorWindow::buildSideControlPanel(void)
//hbox->addWidget( autoLuaCBox );
//luaGBox->setLayout( hbox );
scrollArea = new QScrollArea();
scrollArea->setWidgetResizable(false);
scrollArea->setSizeAdjustPolicy( QAbstractScrollArea::AdjustToContents );
scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
scrollArea->setMinimumSize( QSize( 128, 128 ) );
scrollArea->setWidget( &bookmarks );
scrollArea1 = new QScrollArea();
scrollArea1->setWidgetResizable(false);
scrollArea1->setSizeAdjustPolicy( QAbstractScrollArea::AdjustToContents );
scrollArea1->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
scrollArea1->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
scrollArea1->setMinimumSize( QSize( 128, 128 ) );
scrollArea1->setWidget( &bookmarks );
scrollArea2 = new QScrollArea();
scrollArea2->setWidgetResizable(true);
scrollArea2->setSizeAdjustPolicy( QAbstractScrollArea::AdjustToContents );
scrollArea2->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
scrollArea2->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
scrollArea2->setMinimumSize( QSize( 128, 128 ) );
scrollArea2->setWidget( &branches );
bkmkBrnchStack = new QTabWidget();
bkmkBrnchStack->addTab( scrollArea, tr("Bookmarks") );
bkmkBrnchStack->addTab( &branches , tr("Branches") );
bkmkBrnchStack->addTab( scrollArea1, tr("Bookmarks") );
bkmkBrnchStack->addTab( scrollArea2, tr("Branches") );
bkmkBrnchStack->addTab( histTree , tr("History") );
taseditorConfig.displayBranchesTree = 0;

View File

@ -107,8 +107,17 @@ void BRANCHES::calcFontData(void)
pxSelWidth = (pxBoxWidth * 7) / 8;
pxSelHeight = (pxBoxHeight * 7) / 8;
pxMinGridWidth = pxBoxWidth * 1;
pxMaxGridWidth = pxBoxWidth * 2;
pxMinGridWidth = (pxBoxWidth * 3) / 2;
pxMaxGridWidth = (pxBoxWidth * 2);
w = pxMaxGridWidth * 12;
h = pxMaxGridWidth * 10;
if (w < BRANCHES_BITMAP_WIDTH ) w = BRANCHES_BITMAP_WIDTH;
if (h < BRANCHES_BITMAP_HEIGHT) h = BRANCHES_BITMAP_HEIGHT;
this->setMinimumWidth(w);
this->setMinimumHeight(h);
}
void BRANCHES::init()