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

Method eventFilter

src/difftextwindow.cpp:2070–2098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2068}
2069
2070bool DiffTextWindowFrame::eventFilter([[maybe_unused]] QObject* o, QEvent* e)
2071{
2072 if(e->type() == QEvent::FocusIn || e->type() == QEvent::FocusOut)
2073 {
2074 QColor c1 = gOptions->backgroundColor();
2075 QColor c2;
2076 if(m_winIdx == e_SrcSelector::A)
2077 c2 = gOptions->aColor();
2078 else if(m_winIdx == e_SrcSelector::B)
2079 c2 = gOptions->bColor();
2080 else if(m_winIdx == e_SrcSelector::C)
2081 c2 = gOptions->cColor();
2082
2083 QPalette p = m_pTopLineWidget->palette();
2084 if(e->type() == QEvent::FocusOut)
2085 std::swap(c1, c2);
2086
2087 p.setColor(QPalette::Window, c2);
2088 setPalette(p);
2089
2090 p.setColor(QPalette::WindowText, c1);
2091 m_pLabel->setPalette(p);
2092 m_pTopLine->setPalette(p);
2093 m_pEncoding->setPalette(p);
2094 m_pLineEndStyle->setPalette(p);
2095 }
2096
2097 return false;
2098}
2099
2100void DiffTextWindowFrame::slotReturnPressed()
2101{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected