MCPcopy Create free account
hub / github.com/LMMS/lmms / paintEvent

Method paintEvent

src/gui/SubWindow.cpp:96–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94
95
96void SubWindow::paintEvent( QPaintEvent * )
97{
98 QPainter p( this );
99 QRect rect( 0, 0, width(), m_titleBarHeight );
100
101 bool isActive = mdiArea()
102 ? mdiArea()->activeSubWindow() == this
103 : false;
104
105 p.fillRect( rect, isActive ? activeColor() : p.pen().brush() );
106
107 // window border
108 p.setPen( borderColor() );
109
110 // bottom, left, and right lines
111 p.drawLine( 0, height() - 1, width(), height() - 1 );
112 p.drawLine( 0, m_titleBarHeight, 0, height() - 1 );
113 p.drawLine( width() - 1, m_titleBarHeight, width() - 1, height() - 1 );
114
115 // window icon
116 if( widget() )
117 {
118 QPixmap winicon( widget()->windowIcon().pixmap( m_buttonSize ) );
119 p.drawPixmap( 3, 3, m_buttonSize.width(), m_buttonSize.height(), winicon );
120 }
121}
122
123
124

Callers

nothing calls this directly

Calls 3

widgetFunction · 0.85
drawLineMethod · 0.80
pixmapMethod · 0.45

Tested by

no test coverage detected