Skip to content

Commit

Permalink
lightpreview: wrap properties panel in a vertical scroll bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwa committed Dec 24, 2023
1 parent 8db1d32 commit a928b13
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lightpreview/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,20 +241,23 @@ void MainWindow::createPropertiesSidebar()
auto *lightstyles_group = new QGroupBox(tr("Lightstyles"));
lightstyles_group->setLayout(lightstyles);

formLayout->addRow(lightstyles_group);

// wrap formLayout in a scroll area
auto *form = new QWidget();
form->setLayout(formLayout);

auto *scrollArea = new QScrollArea();
scrollArea->setWidgetResizable(true);
scrollArea->setWidget(lightstyles_group);
scrollArea->setWidget(form);
scrollArea->setBackgroundRole(QPalette::Window);
scrollArea->setFrameShadow(QFrame::Plain);
scrollArea->setFrameShape(QFrame::NoFrame);

formLayout->addRow(scrollArea);

auto *form = new QWidget();
form->setLayout(formLayout);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollArea->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);

// finish dock setup
dock->setWidget(form);
dock->setWidget(scrollArea);
addDockWidget(Qt::LeftDockWidgetArea, dock);
viewMenu->addAction(dock->toggleViewAction());

Expand Down

0 comments on commit a928b13

Please sign in to comment.