MCPcopy Create free account
hub / github.com/KDE/kdiff3 / resizeEvent

Method resizeEvent

src/difftextwindow.cpp:1413–1426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1411}
1412
1413void DiffTextWindow::resizeEvent(QResizeEvent* e)
1414{
1415 QSize newSize = e->size();
1416 QFontMetrics fm = fontMetrics();
1417 LineType visibleLines = newSize.height() / fm.lineSpacing() - 2;
1418 //TODO: Fix after line number area is converted to a QWidget.
1419 qint32 visibleColumns = newSize.width() / fm.horizontalAdvance('0') - d->leftInfoWidth();
1420
1421 if(e->size().height() != e->oldSize().height())
1422 Q_EMIT resizeHeightChangedSignal(visibleLines);
1423 if(e->size().width() != e->oldSize().width())
1424 Q_EMIT resizeWidthChangedSignal(visibleColumns);
1425 QWidget::resizeEvent(e);
1426}
1427
1428LineType DiffTextWindow::getNofVisibleLines() const
1429{

Callers

nothing calls this directly

Calls 3

widthMethod · 0.80
leftInfoWidthMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected