MCPcopy Create free account
hub / github.com/KDE/falkon / containsUpdateIcon

Method containsUpdateIcon

src/plugins/GreaseMonkey/settings/gm_settingslistwidget.cpp:73–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73bool GM_SettingsListWidget::containsUpdateIcon(const QPoint &pos) const
74{
75 QListWidgetItem *item = itemAt(pos);
76 if (!item)
77 return false;
78
79 GM_Script *script = static_cast<GM_Script*>(item->data(Qt::UserRole + 10).value<void*>());
80 if (!script || script->downloadUrl().isEmpty())
81 return false;
82
83 const QRect rect = visualItemRect(item);
84 const int updateIconPosition = rect.right() - m_delegate->padding() * 2 - 16 * 2;
85 const int center = rect.height() / 2 + rect.top();
86 const int updateIconYPos = center - (16 / 2);
87
88 QRect updateIconRect(updateIconPosition, updateIconYPos, 16, 16);
89
90 return updateIconRect.contains(pos);
91}

Callers

nothing calls this directly

Calls 5

downloadUrlMethod · 0.80
paddingMethod · 0.80
heightMethod · 0.80
dataMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected