mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
consider scrollbar's width
This commit is contained in:
parent
6bb85c65b8
commit
0d748b93d6
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include <QEvent>
|
||||
#include <QLayout>
|
||||
#include <QScrollBar>
|
||||
#include <QDebug>
|
||||
|
||||
AdjustingScrollArea::AdjustingScrollArea(QWidget *parent) :
|
||||
|
@ -35,7 +36,10 @@ void AdjustingScrollArea::resizeEvent(QResizeEvent *ev)
|
|||
QSize AdjustingScrollArea::sizeHint() const
|
||||
{
|
||||
if (widget())
|
||||
return widget()->sizeHint();
|
||||
{
|
||||
int scrollbarWidth = verticalScrollBar()->isVisible() ? verticalScrollBar()->width() : 0;
|
||||
return widget()->sizeHint() + QSize(scrollbarWidth, 0);
|
||||
}
|
||||
|
||||
return QScrollArea::sizeHint();
|
||||
}
|
||||
|
|
|
@ -113,7 +113,6 @@ Widget::Widget(QWidget *parent)
|
|||
ui->mainHead->layout()->setSpacing(0);
|
||||
|
||||
QWidget* friendListWidget = new QWidget();
|
||||
//friendListWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
|
||||
friendListWidget->setLayout(new QVBoxLayout());
|
||||
friendListWidget->layout()->setSpacing(0);
|
||||
friendListWidget->layout()->setMargin(0);
|
||||
|
|
Loading…
Reference in New Issue
Block a user