Krita Source Code Documentation
Loading...
Searching...
No Matches
KisToolOptionsPopup::Private Struct Reference

Public Member Functions

void recreateLayout (const QList< QPointer< QWidget > > &optionWidgetList)
 

Public Attributes

QSet< QWidget * > currentAuxWidgets
 
QList< QPointer< QWidget > > currentWidgetList
 
QWidget * hiderWidget
 
QGridLayout * housekeeperLayout
 
bool ignoreHideEvents
 
QFont smallFont
 

Detailed Description

Definition at line 29 of file kis_tool_options_popup.cpp.

Member Function Documentation

◆ recreateLayout()

void KisToolOptionsPopup::Private::recreateLayout ( const QList< QPointer< QWidget > > & optionWidgetList)
inline

Definition at line 40 of file kis_tool_options_popup.cpp.

41 {
42 Q_FOREACH (QPointer<QWidget> widget, currentWidgetList) {
43 if (!widget.isNull() && widget && hiderWidget) {
44 widget->setParent(hiderWidget);
45 }
46 }
47 qDeleteAll(currentAuxWidgets);
48 currentAuxWidgets.clear();
49
50 currentWidgetList = optionWidgetList;
51 if (currentWidgetList.isEmpty()) return;
52
53 // need to unstretch row that have previously been stretched
54 housekeeperLayout->setRowStretch(housekeeperLayout->rowCount()-1, 0);
55
56 int cnt = 0;
57 QFrame *s;
58 QLabel *l;
59 housekeeperLayout->setHorizontalSpacing(0);
60 housekeeperLayout->setVerticalSpacing(2);
61 int specialCount = 0;
62 Q_FOREACH (QPointer<QWidget> widget, currentWidgetList) {
63 if (widget.isNull() || widget->objectName().isEmpty()) {
64 continue; // skip this docker in release build when assert don't crash
65 }
66
67 widget->setMinimumWidth(300);
68
69 if (!widget->windowTitle().isEmpty()) {
70 housekeeperLayout->addWidget(l = new QLabel(widget->windowTitle()), cnt++, 0);
71 currentAuxWidgets.insert(l);
72 }
73 housekeeperLayout->addWidget(widget, cnt++, 0);
74 QLayout *subLayout = widget->layout();
75 if (subLayout) {
76 for (int i = 0; i < subLayout->count(); ++i) {
77 QWidget *spacerWidget = subLayout->itemAt(i)->widget();
78 if (spacerWidget && spacerWidget->objectName().contains("SpecialSpacer")) {
79 specialCount++;
80 }
81 }
82 }
83 widget->show();
84 if (widget != currentWidgetList.last()) {
85 housekeeperLayout->addWidget(s = new QFrame(), cnt++, 0);
86 s->setFrameStyle(QFrame::HLine | QFrame::Sunken);
87 currentAuxWidgets.insert(s);
88 }
89 }
90 if (specialCount == currentWidgetList.count() || qApp->applicationName().contains("krita")) {
91 housekeeperLayout->setRowStretch(cnt, 10000);
92 }
93
94 housekeeperLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
95 housekeeperLayout->invalidate();
96 }
QList< QPointer< QWidget > > currentWidgetList

References currentAuxWidgets, currentWidgetList, hiderWidget, and housekeeperLayout.

Member Data Documentation

◆ currentAuxWidgets

QSet<QWidget *> KisToolOptionsPopup::Private::currentAuxWidgets

Definition at line 36 of file kis_tool_options_popup.cpp.

◆ currentWidgetList

QList<QPointer<QWidget> > KisToolOptionsPopup::Private::currentWidgetList

Definition at line 35 of file kis_tool_options_popup.cpp.

◆ hiderWidget

QWidget* KisToolOptionsPopup::Private::hiderWidget

Definition at line 37 of file kis_tool_options_popup.cpp.

◆ housekeeperLayout

QGridLayout* KisToolOptionsPopup::Private::housekeeperLayout

Definition at line 38 of file kis_tool_options_popup.cpp.

◆ ignoreHideEvents

bool KisToolOptionsPopup::Private::ignoreHideEvents

Definition at line 33 of file kis_tool_options_popup.cpp.

◆ smallFont

QFont KisToolOptionsPopup::Private::smallFont

Definition at line 32 of file kis_tool_options_popup.cpp.


The documentation for this struct was generated from the following file: