Color button fixes.
This commit is contained in:
@@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const int SWATCH_W = 100;
|
const int SWATCH_W = 24;
|
||||||
const int SWATCH_H = 24;
|
const int SWATCH_H = 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -47,6 +47,7 @@ namespace glabels
|
|||||||
|
|
||||||
setIcon( QIcon( ColorSwatch( SWATCH_W, SWATCH_H, color ) ) );
|
setIcon( QIcon( ColorSwatch( SWATCH_W, SWATCH_H, color ) ) );
|
||||||
setText( "" );
|
setText( "" );
|
||||||
|
setCheckable( true );
|
||||||
|
|
||||||
mDialog = new ColorPaletteDialog( defaultLabel, defaultColor, color );
|
mDialog = new ColorPaletteDialog( defaultLabel, defaultColor, color );
|
||||||
mDialog->setModal( true );
|
mDialog->setModal( true );
|
||||||
@@ -130,10 +131,12 @@ namespace glabels
|
|||||||
|
|
||||||
void ColorButton::onPaletteDialogChanged( ColorNode colorNode, bool isDefault )
|
void ColorButton::onPaletteDialogChanged( ColorNode colorNode, bool isDefault )
|
||||||
{
|
{
|
||||||
|
setDown( false );
|
||||||
|
|
||||||
mColorNode = colorNode;
|
mColorNode = colorNode;
|
||||||
mIsDefault = isDefault;
|
mIsDefault = isDefault;
|
||||||
|
|
||||||
emit colorChanged( colorNode, isDefault );
|
emit colorChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace glabels
|
|||||||
// Signals
|
// Signals
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
signals:
|
signals:
|
||||||
void colorChanged( ColorNode colorNode, bool isDefault );
|
void colorChanged();
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////
|
/////////////////////////////////
|
||||||
|
|||||||
@@ -125,6 +125,8 @@ namespace glabels
|
|||||||
QPushButton* mergeFieldButton = new QPushButton( "TODO: Field Button" );
|
QPushButton* mergeFieldButton = new QPushButton( "TODO: Field Button" );
|
||||||
layout->addWidget( mergeFieldButton, iAbsRow, 0, 1, PALETTE_COLS );
|
layout->addWidget( mergeFieldButton, iAbsRow, 0, 1, PALETTE_COLS );
|
||||||
|
|
||||||
|
setLayout( layout );
|
||||||
|
|
||||||
loadCustomColorHistory();
|
loadCustomColorHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ namespace glabels
|
|||||||
QWidget* parent )
|
QWidget* parent )
|
||||||
: QPushButton(parent), mId(id), mColor(color), mTip(tip)
|
: QPushButton(parent), mId(id), mColor(color), mTip(tip)
|
||||||
{
|
{
|
||||||
|
setFlat( true );
|
||||||
setIcon( QIcon( ColorSwatch( wSwatch, hSwatch, color ) ) );
|
setIcon( QIcon( ColorSwatch( wSwatch, hSwatch, color ) ) );
|
||||||
setToolTip( tip );
|
setToolTip( tip );
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ namespace glabels
|
|||||||
/// Constructor
|
/// Constructor
|
||||||
///
|
///
|
||||||
ColorSwatch::ColorSwatch( int w, int h, const QColor& color )
|
ColorSwatch::ColorSwatch( int w, int h, const QColor& color )
|
||||||
|
: QPixmap( w, h )
|
||||||
{
|
{
|
||||||
fill( Qt::transparent );
|
fill( Qt::transparent );
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
setupUi( this );
|
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 );
|
setEnabled( false );
|
||||||
hidePages();
|
hidePages();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user