MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / paintHeader

Method paintHeader

MiniZincIDE/codeeditor.cpp:666–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

664}
665
666void CodeEditor::paintHeader(QPaintEvent *event)
667{
668 QPainter painter(editorHeader);
669 QFont lineNoFont = font();
670 QFontMetrics fm(lineNoFont);
671 int origFontHeight = fm.height();
672 lineNoFont.setPointSizeF(lineNoFont.pointSizeF()*0.8);
673 QFontMetrics fm2(lineNoFont);
674 int heightDiff = (origFontHeight-fm2.height());
675 painter.setFont(lineNoFont);
676
677
678 painter.fillRect(event->rect(), theme.backgroundColor.get(darkMode));
679 int baseX = debugInfo->geometry().x();
680 painter.setPen(theme.textColor.get(darkMode));
681 painter.drawText(baseX, heightDiff/2, DEBUG_TAB_SIZE, debugInfoOffset(), Qt::AlignCenter, "Cons");
682 painter.drawText(baseX + DEBUG_TAB_SIZE, heightDiff/2, DEBUG_TAB_SIZE, debugInfoOffset(), Qt::AlignCenter, "Vars");
683 painter.drawText(baseX + DEBUG_TAB_SIZE*2, heightDiff/2, DEBUG_TAB_SIZE, debugInfoOffset(), Qt::AlignCenter, "Time");
684}
685
686void CodeEditor::setEditorFont(QFont& font)
687{

Callers 1

codeeditor.hFile · 0.80

Calls 2

heightMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected