MCPcopy Create free account
hub / github.com/KDE/kdevelop / doInlineNoteLayout

Function doInlineNoteLayout

plugins/problemreporter/probleminlinenoteprovider.cpp:169–182  ·  view source on GitHub ↗

Design of note: following basically the message widget design, but reduced to only a colored border on the left side |_O_description_

Source from the content-addressed store, hash-verified

167// |_O_description_
168// <vertical borderline><left margin><icon><spacing><description text><right margin>
169static void doInlineNoteLayout(const KTextEditor::InlineNote& note,
170 InlineNoteLayout* layout)
171{
172 const auto* view = note.view();
173 const auto* style = view->style();
174 const int leftMargin = style->pixelMetric(QStyle::PM_LayoutLeftMargin, nullptr, view);
175 layout->rightMargin = style->pixelMetric(QStyle::PM_LayoutRightMargin, nullptr, view);
176 const int noteSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, nullptr, view);
177
178 layout->iconSize = iconHeight(note);
179
180 layout->iconX = noteBorderWidth + leftMargin;
181 layout->descriptionX = layout->iconX + layout->iconSize + noteSpacing;
182}
183
184QSize ProblemInlineNoteProvider::inlineNoteSize(const KTextEditor::InlineNote& note) const
185{

Callers 2

inlineNoteSizeMethod · 0.85
paintInlineNoteMethod · 0.85

Calls 3

iconHeightFunction · 0.85
styleMethod · 0.80
viewMethod · 0.45

Tested by

no test coverage detected