Merge pull request #926 from diizy/stable-1.1

Fix styling of textFloat & whatsthis, make text floats consistent in sty...
This commit is contained in:
Vesa V
2014-07-03 14:12:38 +03:00
5 changed files with 46 additions and 23 deletions

View File

@@ -7,10 +7,6 @@ QLabel, QTreeWidget, QListWidget, QGroupBox {
color: #e0e0e0;
}
QWhatsThat {
color: black;
}
QMdiArea {
background-image: url(resources:background_artwork.png);
}
@@ -55,6 +51,14 @@ QToolTip {
color: #4afd85;
}
textFloat {
border-radius: 4px;
background: qlineargradient(spread:reflect, x1:0.5, y1:0.5, x2:0.5, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(50, 50, 50, 220));
opacity: 175;
border: 1.0px solid rgba(0,0,0,255);
color: #4afd85;
}
QMenu {
border:1px solid #747474;
@@ -748,5 +752,8 @@ LmmsPalette {
qproperty-brightText: #4afd85;
qproperty-highlight: #202020;
qproperty-highlightedText: #ffffff;
/* the next two are used for whatsthis dialogs */
qproperty-toolTipText: #000;
qproperty-toolTipBase: #c9c9c9;
}

View File

@@ -43,6 +43,8 @@ class EXPORT LmmsPalette : public QWidget
Q_PROPERTY( QColor brightText READ brightText WRITE setBrightText )
Q_PROPERTY( QColor highlight READ highlight WRITE setHighlight )
Q_PROPERTY( QColor highlightedText READ highlightedText WRITE setHighlightedText )
Q_PROPERTY( QColor toolTipText READ toolTipText WRITE setToolTipText )
Q_PROPERTY( QColor toolTipBase READ toolTipBase WRITE setToolTipBase )
public:
LmmsPalette( QWidget * parent, QStyle * stylearg );
@@ -63,6 +65,8 @@ public:
ACCESSMET( brightText, setBrightText )
ACCESSMET( highlight, setHighlight )
ACCESSMET( highlightedText, setHighlightedText )
ACCESSMET( toolTipText, setToolTipText )
ACCESSMET( toolTipBase, setToolTipBase )
#undef ACCESSMET
@@ -79,6 +83,8 @@ private:
QColor m_brightText;
QColor m_highlight;
QColor m_highlightedText;
QColor m_toolTipText;
QColor m_toolTipBase;
};

View File

@@ -23,8 +23,8 @@
*/
#ifndef _TEXT_FLOAT
#define _TEXT_FLOAT
#ifndef TEXT_FLOAT_H
#define TEXT_FLOAT_H
#include <QtGui/QWidget>
#include <QtGui/QPixmap>
@@ -34,6 +34,7 @@
class EXPORT textFloat : public QWidget
{
Q_OBJECT
public:
textFloat();
virtual ~textFloat()
@@ -76,7 +77,6 @@ private:
QString m_text;
QPixmap m_pixmap;
} ;
};
#endif

View File

@@ -43,7 +43,9 @@ LmmsPalette::LmmsPalette( QWidget * parent, QStyle * stylearg ) :
m_buttonText( 0,0,0 ),
m_brightText( 74, 253, 133 ),
m_highlight( 100, 100, 100 ),
m_highlightedText( 255, 255, 255 )
m_highlightedText( 255, 255, 255 ),
m_toolTipText( 0, 0, 0 ),
m_toolTipBase( 128, 128, 128 )
{
setStyle( stylearg );
stylearg->polish( this );
@@ -70,7 +72,8 @@ LmmsPalette::~LmmsPalette()
ACCESSMET( brightText, setBrightText )
ACCESSMET( highlight, setHighlight )
ACCESSMET( highlightedText, setHighlightedText )
ACCESSMET( toolTipText, setToolTipText )
ACCESSMET( toolTipBase, setToolTipBase )
QPalette LmmsPalette::palette() const
@@ -87,7 +90,8 @@ QPalette LmmsPalette::palette() const
pal.setColor( QPalette::Shadow, shadow() );
pal.setColor( QPalette::Highlight, highlight() );
pal.setColor( QPalette::HighlightedText, highlightedText() );
pal.setBrush( QPalette::ToolTipText, QBrush( toolTipText() ) );
pal.setBrush( QPalette::ToolTipBase, QBrush( toolTipBase() ) );
return pal;
}

View File

@@ -24,6 +24,7 @@
#include <QtCore/QTimer>
#include <QtGui/QPainter>
#include <QtGui/QStyleOption>
#include "text_float.h"
#include "gui_templates.h"
@@ -41,6 +42,8 @@ textFloat::textFloat() :
resize( 20, 20 );
hide();
setAttribute( Qt::WA_TranslucentBackground, true );
setStyle( QApplication::style() );
setFont( pointSize<8>( font() ) );
}
@@ -125,35 +128,38 @@ textFloat * textFloat::displayMessage( const QString & _title,
void textFloat::paintEvent( QPaintEvent * _pe )
{
QStyleOption opt;
opt.init( this );
QPainter p( this );
p.fillRect( 0, 0, width(), height(), QColor( 0, 0, 0, 0 ) );
p.setPen( QColor( 0, 0, 0 ) );
p.setBrush( QColor( 224, 224, 224 ) );
/* p.setPen( p.pen().brush().color() );
p.setBrush( p.background() );*/
p.setFont( pointSize<8>( p.font() ) );
style()->drawPrimitive( QStyle::PE_Widget, &opt, &p, this );
p.drawRect( 0, 0, rect().right(), rect().bottom() );
/* p.drawRect( 0, 0, rect().right(), rect().bottom() );*/
// p.setPen( Qt::black );
// small message?
if( m_title.isEmpty() )
{
p.drawText( 2, p.fontMetrics().height()-2, m_text );
p.drawText( opt.rect, Qt::AlignCenter, m_text );
}
else
{
int text_x = 2;
int text_x = opt.rect.left() + 2;
int text_y = opt.rect.top() + 12;
if( m_pixmap.isNull() == false )
{
p.drawPixmap( 5, 5, m_pixmap );
p.drawPixmap( opt.rect.topLeft() + QPoint( 5, 5 ), m_pixmap );
text_x += m_pixmap.width() + 8;
}
p.drawText( text_x, 28, m_text );
p.drawText( text_x, text_y + 16, m_text );
QFont f = p.font();
f.setBold( true );
p.setFont( f );
p.drawText( text_x, 12, m_title );
p.drawText( text_x, text_y, m_title );
}
}
@@ -194,4 +200,4 @@ void textFloat::updateSize()
#include "moc_text_float.cxx"