Skip to content

Commit

Permalink
Add tooltip event filter controlled by setting
Browse files Browse the repository at this point in the history
  • Loading branch information
softins committed Dec 31, 2024
1 parent 21d11da commit 734e8e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
{
setupUi ( this );

// install event filter for tooltips
qApp->installEventFilter ( this );

// Add help text to controls -----------------------------------------------
// input level meter
QString strInpLevH = "<b>" + tr ( "Input Level Meter" ) + ":</b> " +
Expand Down Expand Up @@ -1516,3 +1519,14 @@ void CClientDlg::SetPingTime ( const int iPingTime, const int iOverallDelayMs, c
// set current LED status
ledDelay->SetLight ( eOverallDelayLEDColor );
}

bool CClientDlg::eventFilter ( QObject* obj, QEvent* event )
{
if ( event->type() == QEvent::ToolTip && !pSettings->bShowToolTips )
{
return true; // don't show tooltip
}

// continue with normal processing of event
return CBaseDlg::eventFilter ( obj, event );
}
1 change: 1 addition & 0 deletions src/clientdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class CClientDlg : public CBaseDlg, private Ui_CClientDlgBase
virtual void dragEnterEvent ( QDragEnterEvent* Event ) { ManageDragNDrop ( Event, true ); }
virtual void dropEvent ( QDropEvent* Event ) { ManageDragNDrop ( Event, false ); }
void UpdateDisplay();
bool eventFilter ( QObject* obj, QEvent* event );

CClientSettingsDlg ClientSettingsDlg;
CChatDlg ChatDlg;
Expand Down

0 comments on commit 734e8e0

Please sign in to comment.