mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-29 01:06:27 -05:00
Make DatabaseWidget ignore the size hint of non-active widgets.
This commit is contained in:
parent
e026f3d1eb
commit
3aac16f03e
@ -151,6 +151,32 @@ void DatabaseWidget::deleteGroup()
|
||||
}
|
||||
}
|
||||
|
||||
int DatabaseWidget::addWidget(QWidget* w)
|
||||
{
|
||||
w->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
||||
|
||||
int index = QStackedWidget::addWidget(w);
|
||||
|
||||
adjustSize();
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
void DatabaseWidget::setCurrentIndex(int index)
|
||||
{
|
||||
if (currentWidget()) {
|
||||
currentWidget()->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
||||
}
|
||||
|
||||
QStackedWidget::setCurrentIndex(index);
|
||||
|
||||
if (currentWidget()) {
|
||||
currentWidget()->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
}
|
||||
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
void DatabaseWidget::switchToView(bool accepted)
|
||||
{
|
||||
if (m_newGroup) {
|
||||
|
@ -42,6 +42,8 @@ public:
|
||||
void deleteEntry();
|
||||
void deleteGroup();
|
||||
bool canDeleteCurrentGoup();
|
||||
int addWidget(QWidget* w);
|
||||
void setCurrentIndex(int index);
|
||||
|
||||
Q_SIGNALS:
|
||||
void closeRequest();
|
||||
|
Loading…
Reference in New Issue
Block a user