Color button fixes.

This commit is contained in:
Jim Evins
2015-08-18 14:58:30 -04:00
parent 4ab105e06f
commit 4131bedba5
6 changed files with 14 additions and 4 deletions
+6 -3
View File
@@ -26,8 +26,8 @@
namespace
{
const int SWATCH_W = 100;
const int SWATCH_H = 24;
const int SWATCH_W = 24;
const int SWATCH_H = 24;
}
@@ -47,6 +47,7 @@ namespace glabels
setIcon( QIcon( ColorSwatch( SWATCH_W, SWATCH_H, color ) ) );
setText( "" );
setCheckable( true );
mDialog = new ColorPaletteDialog( defaultLabel, defaultColor, color );
mDialog->setModal( true );
@@ -130,10 +131,12 @@ namespace glabels
void ColorButton::onPaletteDialogChanged( ColorNode colorNode, bool isDefault )
{
setDown( false );
mColorNode = colorNode;
mIsDefault = isDefault;
emit colorChanged( colorNode, isDefault );
emit colorChanged();
}
+1 -1
View File
@@ -49,7 +49,7 @@ namespace glabels
// Signals
/////////////////////////////////
signals:
void colorChanged( ColorNode colorNode, bool isDefault );
void colorChanged();
/////////////////////////////////
+2
View File
@@ -125,6 +125,8 @@ namespace glabels
QPushButton* mergeFieldButton = new QPushButton( "TODO: Field Button" );
layout->addWidget( mergeFieldButton, iAbsRow, 0, 1, PALETTE_COLS );
setLayout( layout );
loadCustomColorHistory();
}
+1
View File
@@ -45,6 +45,7 @@ namespace glabels
QWidget* parent )
: QPushButton(parent), mId(id), mColor(color), mTip(tip)
{
setFlat( true );
setIcon( QIcon( ColorSwatch( wSwatch, hSwatch, color ) ) );
setToolTip( tip );
+1
View File
@@ -40,6 +40,7 @@ namespace glabels
/// Constructor
///
ColorSwatch::ColorSwatch( int w, int h, const QColor& color )
: QPixmap( w, h )
{
fill( Qt::transparent );
+3
View File
@@ -39,6 +39,9 @@ namespace glabels
{
setupUi( this );
lineColorButton->init( "No line", QColor(0,0,0,0), QColor(0,0,0,255) );
fillColorButton->init( "No fill", QColor(0,0,0,0), QColor(0,0,0,255) );
setEnabled( false );
hidePages();
}