Lines Matching refs:arg

104   Parameters arg =  in paint()  local
123 if (arg.cg == QPalette::Normal && !(option.state & QStyle::State_Active)) in paint()
124 arg.cg = QPalette::Inactive; in paint()
126 arg.text = var.toString(); in paint()
128 fillBackground(arg); in paint()
129 drawGrid(arg, !(index.model()->columnCount() - index.column() - 1)); in paint()
130 prepareForeground(arg, index.data(ContactListModel::OnlineAnimationRole)); in paint()
132 switch (arg.itemType) in paint()
135 drawBar(arg); in paint()
139 drawCarAnimation(arg, var.toInt()); in paint()
141 drawStatusIcon(arg); in paint()
142 if (arg.itemType == ContactListModel::GroupItem) in paint()
143 arg.align = Qt::AlignLeft | Qt::AlignVCenter; in paint()
144 drawText(arg); in paint()
145 drawExtIcons(arg); in paint()
151 void ContactDelegate::drawExtIcon(Parameters& arg, IconManager::IconType iconType) const in drawExtIcon() argument
153 drawExtIcon(arg, in drawExtIcon()
157 void ContactDelegate::drawExtIcon(Parameters& arg, const QPixmap* icon) const in drawExtIcon() argument
159 if (icon->isNull() || arg.width < icon->width()) in drawExtIcon()
163 int align = arg.align; in drawExtIcon()
168 y = (arg.height - icon->height()) / 2; in drawExtIcon()
171 y = arg.height - icon->height(); in drawExtIcon()
180 x = arg.width - icon->width(); in drawExtIcon()
182 arg.p->drawPixmap(x, y, *icon); in drawExtIcon()
184 arg.width -= icon->width() + 3; in drawExtIcon()
186 arg.p->translate(icon->width() + 3, 0); in drawExtIcon()
189 void ContactDelegate::fillBackground(Parameters& arg) const in fillBackground()
192 arg.p->fillRect(0, 0, arg.width, arg.height, (color)) in fillBackground()
196 if (arg.option.state & QStyle::State_Selected) in fillBackground()
197 FILL(arg.option.palette.brush(arg.cg, QPalette::Highlight)); in fillBackground()
199 FILL(arg.option.palette.brush(arg.cg, QPalette::Base)); in fillBackground()
205 if (arg.itemType == ContactListModel::GroupItem || in fillBackground()
206 arg.itemType == ContactListModel::BarItem) in fillBackground()
208 if (!arg.skin->groupBackImage.isNull()) in fillBackground()
209 if (arg.skin->tileGroupBackImage) in fillBackground()
210 arg.p->drawTiledPixmap(0, 0, arg.width, arg.height, in fillBackground()
211 QPixmap::fromImage(arg.skin->groupBackImage)); in fillBackground()
213 arg.p->drawImage(0, 0, in fillBackground()
214 arg.skin->groupBackImage.scaled(arg.width, arg.height)); in fillBackground()
216 if (arg.option.state & QStyle::State_Selected) in fillBackground()
217 if (arg.skin->groupHighBackColor.isValid()) in fillBackground()
218 FILL(arg.skin->groupHighBackColor); in fillBackground()
220 FILL(arg.option.palette.brush(arg.cg, QPalette::Highlight)); in fillBackground()
222 if (arg.skin->groupBackColor.isValid()) in fillBackground()
223 FILL(arg.skin->groupBackColor); in fillBackground()
227 if ((arg.option.state & QStyle::State_Selected) != 0) in fillBackground()
229 if (arg.skin->highBackColor.isValid()) in fillBackground()
230 FILL(arg.skin->highBackColor); in fillBackground()
232 FILL(arg.option.palette.brush(arg.cg, QPalette::Highlight)); in fillBackground()
238 void ContactDelegate::drawGrid(Parameters& arg, bool last) const in drawGrid() argument
241 arg.itemType == ContactListModel::UserItem) in drawGrid()
243 arg.p->setPen(arg.skin->gridlineColor); in drawGrid()
244 arg.p->drawRect(0, 0, arg.width, arg.height); in drawGrid()
249 arg.p->drawLine(arg.width - 1, 0, arg.width - 1, arg.height - 1); in drawGrid()
253 void ContactDelegate::prepareForeground(Parameters& arg, QVariant animate) const in prepareForeground() argument
255 arg.option.displayAlignment = (Qt::AlignmentFlag)arg.align; in prepareForeground()
258 arg.option.font.setItalic(false); in prepareForeground()
259 arg.option.font.setStrikeOut(false); in prepareForeground()
260 arg.option.font.setWeight(QFont::Normal); in prepareForeground()
264 switch (arg.itemType) in prepareForeground()
270 if (arg.extStatus & ContactListModel::OnlineNotifyStatus) in prepareForeground()
271 arg.option.font.setWeight(QFont::DemiBold); in prepareForeground()
272 if (arg.extStatus & ContactListModel::InvisibleListStatus) in prepareForeground()
273 arg.option.font.setStrikeOut(true); in prepareForeground()
274 if (arg.extStatus & ContactListModel::VisibleListStatus) in prepareForeground()
275 arg.option.font.setItalic(true); in prepareForeground()
279 textColor = arg.skin->offlineColor; in prepareForeground()
280 else if ((arg.option.state & QStyle::State_Selected) != 0) in prepareForeground()
281 textColor = arg.skin->highTextColor; in prepareForeground()
282 else if (arg.extStatus & ContactListModel::NewUserStatus) in prepareForeground()
283 textColor = arg.skin->newUserColor; in prepareForeground()
284 else if (arg.extStatus & ContactListModel::AwaitingAuthStatus) in prepareForeground()
285 textColor = arg.skin->awaitingAuthColor; in prepareForeground()
288 if (arg.status == User::OfflineStatus) in prepareForeground()
289 textColor = arg.skin->offlineColor; in prepareForeground()
290 else if (arg.status & (User::AwayStatuses | User::IdleStatus)) in prepareForeground()
291 textColor = arg.skin->awayColor; in prepareForeground()
293 textColor = arg.skin->onlineColor; in prepareForeground()
301 if (arg.itemType == ContactListModel::GroupItem) in prepareForeground()
302 arg.option.font.setWeight(QFont::Bold); in prepareForeground()
303 if (arg.option.font.pointSize() > 2) in prepareForeground()
304 arg.option.font.setPointSize(arg.option.font.pointSize() - 2); in prepareForeground()
305 if ((arg.option.state & QStyle::State_Selected) != 0) in prepareForeground()
306 textColor = arg.skin->groupHighTextColor; in prepareForeground()
308 textColor = arg.skin->groupTextColor; in prepareForeground()
314 arg.option.palette.setColor(QPalette::Text, textColor); in prepareForeground()
315 arg.p->setPen(textColor); in prepareForeground()
320 if ((arg.option.state & QStyle::State_Selected) != 0) in prepareForeground()
321 arg.p->setPen(arg.option.palette.color(arg.cg, QPalette::HighlightedText)); in prepareForeground()
323 if ((arg.itemType == ContactListModel::GroupItem || in prepareForeground()
324 arg.itemType == ContactListModel::BarItem) && in prepareForeground()
325 arg.skin->gridlineColor.isValid()) in prepareForeground()
326 arg.p->setPen(arg.skin->gridlineColor); in prepareForeground()
328 arg.p->setPen(arg.option.palette.color(arg.cg, QPalette::Text)); in prepareForeground()
331 arg.p->setFont(arg.option.font); in prepareForeground()
334 void ContactDelegate::drawBar(Parameters& arg) const in drawBar()
336 int textWidth = arg.p->fontMetrics().width(arg.text); in drawBar()
337 int barWidth = (arg.width >> 1) - 20 - (textWidth >> 1) - 5; in drawBar()
341 int barHeight = arg.height >> 1; in drawBar()
343 qDrawShadeLine(arg.p, in drawBar()
346 arg.option.palette); in drawBar()
347 qDrawShadeLine(arg.p, in drawBar()
348 arg.width - 20 - barWidth, barHeight, in drawBar()
349 arg.width - 20, barHeight, in drawBar()
350 arg.option.palette); in drawBar()
353 if (!arg.text.isEmpty()) in drawBar()
354 arg.p->drawText(0, 0, arg.width, arg.height, Qt::AlignCenter, arg.text); in drawBar()
357 void ContactDelegate::drawStatusIcon(Parameters& arg) const in drawStatusIcon()
362 if (arg.itemType == ContactListModel::UserItem) in drawStatusIcon()
364 QVariant var = arg.index.data(ContactListModel::EventAnimationRole); in drawStatusIcon()
367 arg.index.data(ContactListModel::EventTypeRole).toUInt()); in drawStatusIcon()
370 arg.index.data(ContactListModel::StatusRole).toUInt(), in drawStatusIcon()
371 arg.index.data(ContactListModel::UserIdRole).value<Licq::UserId>()); in drawStatusIcon()
373 else if (arg.itemType == ContactListModel::GroupItem) in drawStatusIcon()
375 if (myUserView->isExpanded(arg.index)) in drawStatusIcon()
385 arg.p->drawPixmap( in drawStatusIcon()
387 (arg.height - icon->height()) / 2, in drawStatusIcon()
392 arg.width -= iconWidth + 2; in drawStatusIcon()
393 arg.p->translate(iconWidth + 2, 0); in drawStatusIcon()
397 void ContactDelegate::drawCarAnimation(Parameters& arg, int counter) const in drawCarAnimation() argument
402 QPen tmp = arg.p->pen(); in drawCarAnimation()
403 arg.p->setPen((counter & 1) ? Qt::white : Qt::black); in drawCarAnimation()
407 arg.p->drawLine(0, 0, arg.width - 1, 0); in drawCarAnimation()
408 arg.p->drawLine(0, arg.height - 1, arg.width - 1, arg.height - 1); in drawCarAnimation()
409 if (arg.index.column() == 0) in drawCarAnimation()
410 arg.p->drawLine(0, 0, 0, arg.height - 1); in drawCarAnimation()
411 if (arg.index.column() == arg.index.model()->columnCount() - 1) in drawCarAnimation()
412 arg.p->drawLine(arg.width - 1, 0, arg.width - 1, arg.height - 1); in drawCarAnimation()
413 arg.p->setPen(tmp); in drawCarAnimation()
416 void ContactDelegate::drawText(Parameters& arg) const in drawText()
418 if (arg.text.isEmpty()) in drawText()
421 QStringList lines = arg.text.split('\n'); in drawText()
424 lines[i] = arg.p->fontMetrics().elidedText( in drawText()
425 lines[i], arg.option.textElideMode, arg.width - 6); in drawText()
429 arg.p->drawText(2, 0, arg.width - 4, arg.height, arg.align, elidedText); in drawText()
431 int textWidth = arg.p->fontMetrics().width(elidedText); in drawText()
433 switch (arg.align & Qt::AlignHorizontal_Mask) in drawText()
436 textWidth += arg.width - 2; in drawText()
439 arg.p->translate(textWidth + 6, 0); in drawText()
441 arg.width -= textWidth + 6; in drawText()
445 void ContactDelegate::drawExtIcons(Parameters& arg) const in drawExtIcons()
450 if (arg.itemType == ContactListModel::GroupItem) in drawExtIcons()
452 if (arg.index.data(ContactListModel::UnreadEventsRole).toInt() > 0 && in drawExtIcons()
453 !myUserView->isExpanded(arg.index)) in drawExtIcons()
454 drawExtIcon(arg, IconManager::StandardMessageIcon); in drawExtIcons()
458 if (Config::ContactList::instance()->columnFormat(arg.index.column()) in drawExtIcons()
463 QVariant var = arg.index.data(ContactListModel::UserIconRole); in drawExtIcons()
467 if (tmp.height() > arg.height - 2) in drawExtIcons()
468 tmp = tmp.scaledToHeight(arg.height - 2, Qt::SmoothTransformation); in drawExtIcons()
470 drawExtIcon(arg, pic); in drawExtIcons()
476 if (arg.extStatus & (status)) \ in drawExtIcons()
477 drawExtIcon(arg, (icon)) in drawExtIcons()
490 if (arg.extStatus & ContactListModel::GpgKeyStatus) in drawExtIcons()
495 drawExtIcon(arg, IconManager::GpgKeyDisabledIcon); in drawExtIcons()
498 if (arg.status != User::OfflineStatus) in drawExtIcons()