Commit bdbb3a27 authored by Stefano Pettini's avatar Stefano Pettini Committed by Matěj Laitl
Browse files

Use transparent background for lyrics browser

This makes the lyrics browser similar to every other context applet.
Please note that, when editing lyrics, the default textbox background
is still used.

REVIEW: 128246
BUG: 314854
parent 6c49cfdf
......@@ -12,6 +12,7 @@ VERSION 2.9.0
BUGFIXES:
* Fix integer fields, like length, always showing up as zero in filter creation
dialog; thanks to Stefano Pettini. (BR 341661)
* Fix background color of the lyrics applet, thanks to Stefano Pettini. (BR 314854)
VERSION 2.8.90
......
......@@ -41,7 +41,6 @@ LyricsBrowser::LyricsBrowser( QGraphicsWidget *parent )
native->setWordWrapMode( QTextOption::WordWrap );
native->setCursorWidth( 0 );
native->document()->setDocumentMargin( 10 );
native->viewport()->setAutoFillBackground( true );
native->setTextInteractionFlags( Qt::TextBrowserInteraction | Qt::TextSelectableByKeyboard );
Plasma::Svg *borderSvg = new Plasma::Svg( this );
......@@ -105,10 +104,11 @@ void LyricsBrowser::setLyrics( const QString &lyrics )
void LyricsBrowser::setReadOnly( bool readOnly )
{
QPalette::ColorRole bg = readOnly ? QPalette::Base : QPalette::AlternateBase;
nativeWidget()->viewport()->setBackgroundRole( bg );
nativeWidget()->setReadOnly( readOnly );
nativeWidget()->setCursorWidth( !readOnly ? 1 : 0 );
KTextBrowser *native = nativeWidget();
native->viewport()->setAutoFillBackground( !readOnly );
native->setReadOnly( readOnly );
native->setCursorWidth( !readOnly ? 1 : 0 );
}
void LyricsBrowser::setRichText( bool richText )
......@@ -122,8 +122,6 @@ void LyricsBrowser::paletteChanged( const QPalette &palette )
// set text color using app theme instead of plasma theme
p.setColor( QPalette::Text, qApp->palette().text().color() );
QPalette::ColorRole bg = isReadOnly() ? QPalette::Base : QPalette::AlternateBase;
nativeWidget()->viewport()->setBackgroundRole( bg );
nativeWidget()->setPalette( p );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment