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