mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04: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)
|
void DatabaseWidget::switchToView(bool accepted)
|
||||||
{
|
{
|
||||||
if (m_newGroup) {
|
if (m_newGroup) {
|
||||||
|
@ -42,6 +42,8 @@ public:
|
|||||||
void deleteEntry();
|
void deleteEntry();
|
||||||
void deleteGroup();
|
void deleteGroup();
|
||||||
bool canDeleteCurrentGoup();
|
bool canDeleteCurrentGoup();
|
||||||
|
int addWidget(QWidget* w);
|
||||||
|
void setCurrentIndex(int index);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void closeRequest();
|
void closeRequest();
|
||||||
|
Loading…
Reference in New Issue
Block a user