Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/widgets/kis_widget_chooser.cpp
Context not available. | |||||
111 | layout->setSpacing(0); | 111 | layout->setSpacing(0); | ||
---|---|---|---|---|---|
112 | 112 | | |||
113 | for(Iterator i=m_widgets.begin(); i!=m_widgets.end(); ++i) { | 113 | for(Iterator i=m_widgets.begin(); i!=m_widgets.end(); ++i) { | ||
114 | if(i->choosen) { | 114 | if(i->chosen) { | ||
115 | if (i->label) { | 115 | if (i->label) { | ||
116 | layout->addWidget(i->label); | 116 | layout->addWidget(i->label); | ||
117 | } | 117 | } | ||
Context not available. | |||||
137 | QList<QAbstractButton*> buttons = m_buttons->buttons(); | 137 | QList<QAbstractButton*> buttons = m_buttons->buttons(); | ||
138 | 138 | | |||
139 | for(Iterator i=m_widgets.begin(); i!=m_widgets.end(); ++i) { | 139 | for(Iterator i=m_widgets.begin(); i!=m_widgets.end(); ++i) { | ||
140 | if(!i->choosen) { | 140 | if(!i->chosen) { | ||
141 | if(row == buttons.size()) { | 141 | if(row == buttons.size()) { | ||
142 | QToolButton* bn = new QToolButton(); | 142 | QToolButton* bn = new QToolButton(); | ||
143 | 143 | | |||
Context not available. | |||||
169 | delete m_buttons; | 169 | delete m_buttons; | ||
170 | 170 | | |||
171 | m_buttons = group; | 171 | m_buttons = group; | ||
172 | connect(m_buttons, SIGNAL(buttonClicked(int)), SLOT(slotWidgetChoosen(int))); | 172 | connect(m_buttons, SIGNAL(buttonClicked(int)), SLOT(slotWidgetChosen(int))); | ||
173 | 173 | | |||
174 | return layout; | 174 | return layout; | ||
175 | } | 175 | } | ||
Context not available. | |||||
179 | Iterator data = std::find(m_widgets.begin(), m_widgets.end(), Data(id)); | 179 | Iterator data = std::find(m_widgets.begin(), m_widgets.end(), Data(id)); | ||
180 | 180 | | |||
181 | if(data != m_widgets.end()) { | 181 | if(data != m_widgets.end()) { | ||
182 | if(!data->choosen) { | 182 | if(!data->chosen) { | ||
183 | delete m_popup->layout(); | 183 | delete m_popup->layout(); | ||
184 | m_popup->setLayout(createPopupLayout()); | 184 | m_popup->setLayout(createPopupLayout()); | ||
185 | m_popup->adjustSize(); | 185 | m_popup->adjustSize(); | ||
Context not available. | |||||
196 | 196 | | |||
197 | QWidget* KisWidgetChooser::chooseWidget(const QString& id) | 197 | QWidget* KisWidgetChooser::chooseWidget(const QString& id) | ||
198 | { | 198 | { | ||
199 | QWidget* choosenWidget = 0; | 199 | QWidget* chosenWidget = 0; | ||
200 | 200 | | |||
201 | for(Iterator i=m_widgets.begin(); i!=m_widgets.end(); ++i) { | 201 | for(Iterator i=m_widgets.begin(); i!=m_widgets.end(); ++i) { | ||
202 | if(i->id == id) { | 202 | if(i->id == id) { | ||
203 | choosenWidget = i->widget; | 203 | chosenWidget = i->widget; | ||
204 | i->choosen = true; | 204 | i->chosen = true; | ||
205 | } | 205 | } | ||
206 | else i->choosen = false; | 206 | else i->chosen = false; | ||
207 | } | 207 | } | ||
208 | 208 | | |||
209 | delete m_popup->layout(); | 209 | delete m_popup->layout(); | ||
Context not available. | |||||
216 | KisConfig cfg(false); | 216 | KisConfig cfg(false); | ||
217 | cfg.setToolbarSlider(m_chooserid, id); | 217 | cfg.setToolbarSlider(m_chooserid, id); | ||
218 | 218 | | |||
219 | return choosenWidget; | 219 | return chosenWidget; | ||
220 | } | 220 | } | ||
221 | 221 | | |||
222 | QWidget* KisWidgetChooser::getWidget(const QString& id) const | 222 | QWidget* KisWidgetChooser::getWidget(const QString& id) const | ||
Context not available. | |||||
264 | showPopupWidget(); | 264 | showPopupWidget(); | ||
265 | } | 265 | } | ||
266 | 266 | | |||
267 | void KisWidgetChooser::slotWidgetChoosen(int index) | 267 | void KisWidgetChooser::slotWidgetChosen(int index) | ||
268 | { | 268 | { | ||
269 | chooseWidget(m_widgets[index].id); | 269 | chooseWidget(m_widgets[index].id); | ||
270 | m_popup->hide(); | 270 | m_popup->hide(); | ||
Context not available. |