@@ -164,7 +164,7 @@ QString CSkinParameters::filePath( ) const
164
164
/* ******************************************************************
165
165
* fromUi( )
166
166
* ---------
167
- * Rempli les structures internes avec les donnes rcupres de l'UI
167
+ * Rempli les structures internes avec les donnes recuperees de l'UI
168
168
********************************************************************/
169
169
void CSkinParameters::fromUi ( )
170
170
{
@@ -205,7 +205,8 @@ void CSkinParameters::fromUi( )
205
205
m_styleSheet.addSelection ( indexTitle );
206
206
// Mosaic
207
207
CCssSelection thumbsMosaic ( QString (" #mosaic" ));
208
- thumbsMosaic.setProperty ( QString (" background-image" ), QString (" url(../images/" ) + QFileInfo (m_p_ui->cImagePicker_Mosaic_BckgTexture ->fileName ()).fileName () + QString (" )" ) );
208
+ const auto mosaic_img_bckg = QString (" url(../images/" ) + QFileInfo (m_p_ui->cImagePicker_Mosaic_BckgTexture ->fileName ()).fileName () + QString (" )" );
209
+ thumbsMosaic.setProperty ( QString (" background-image" ), mosaic_img_bckg);
209
210
if ( m_p_ui->checkBox_Mosaic_BckgColor_Enabled ->isChecked () ) { // optional background color
210
211
thumbsMosaic.setProperty ( QString (" background-color" ), m_p_ui->cColorPicker_Mosaic_BckgColor ->value () );
211
212
} else {
@@ -217,7 +218,18 @@ void CSkinParameters::fromUi( )
217
218
CCssSelection thumbSpacing ( QString (" .thumbBox" ) ); // Espace entre les vignettes
218
219
this ->thumbBoxBorderSize = m_p_ui->spinBox_Mosaic_SpacingWidth ->value ();
219
220
thumbSpacing.setProperty ( QString (" border-width" ), QString::number ( thumbBoxBorderSize ) + QString (" px" ) );
220
- thumbSpacing.setProperty ( QString (" border-color" ), m_p_ui->cColorPicker_Mosaic_SpacingColor ->value () );
221
+ if (!m_p_ui->checkBox_Mosaic_SpacingTransparent ->isChecked ()) {
222
+ thumbSpacing.setProperty (QString (" border-color" ), m_p_ui->cColorPicker_Mosaic_SpacingColor ->value ());
223
+ }
224
+ else { // same as the mosaic's background
225
+ thumbSpacing.setProperty (QString (" ezwg-transparent" ), " true" );
226
+ if (m_p_ui->checkBox_Mosaic_BckgColor_Enabled ->isChecked ()) {
227
+ thumbSpacing.setProperty (QString (" background-color" ), m_p_ui->cColorPicker_Mosaic_BckgColor ->value ());
228
+ }
229
+ else {
230
+ thumbSpacing.setProperty (QString (" border-image" ), mosaic_img_bckg);
231
+ }
232
+ }
221
233
// .thumbBox img -> thumbnail
222
234
CCssSelection thumbnail ( QString (" img" ));
223
235
this ->thumbImgBorderSize = m_p_ui->spinBox_Thumbnail_BorderWidth ->value ();
@@ -415,7 +427,7 @@ void CSkinParameters::toUi( )
415
427
m_p_ui->spinBox_Mosaic_BorderWidth ->setValue ( thumbsMosaic.property (" border-width" ).remove (" px" ).toInt () );
416
428
m_p_ui->cImagePicker_Mosaic_BckgTexture ->setImage ( m_resources.value (" Mosaic_BckgTexture" ).absoluteFilePath () );
417
429
// background color is optional
418
- bool fHasBckgColor = (thumbsMosaic.property (" ezwg-background-color-disabled" ) != " true" );
430
+ const bool fHasBckgColor = (thumbsMosaic.property (" ezwg-background-color-disabled" ) != " true" );
419
431
m_p_ui->cColorPicker_Mosaic_BckgColor ->setEnabled ( fHasBckgColor );
420
432
if ( fHasBckgColor ) {
421
433
m_p_ui->cColorPicker_Mosaic_BckgColor ->setColor ( thumbsMosaic.property (" background-color" ) );
@@ -425,8 +437,12 @@ void CSkinParameters::toUi( )
425
437
path.clear ();
426
438
path << " .thumbBox" ;
427
439
CCssSelection thumbSpacing = m_styleSheet.selection ( path );
440
+ const bool isSpacingTransparent = (thumbSpacing.property (" ezwg-transparent" ) == " true" );
428
441
m_p_ui->spinBox_Mosaic_SpacingWidth ->setValue ( thumbSpacing.property (" border-width" ).remove (" px" ).toInt () );
429
- m_p_ui->cColorPicker_Mosaic_SpacingColor ->setColor ( thumbSpacing.property (" border-color" ) );
442
+ m_p_ui->cColorPicker_Mosaic_SpacingColor ->setColor (thumbSpacing.property (" border-color" ));
443
+ m_p_ui->cColorPicker_Mosaic_SpacingColor ->setEnabled (!isSpacingTransparent);
444
+ m_p_ui->checkBox_Mosaic_SpacingTransparent ->setChecked (isSpacingTransparent);
445
+ // m_p_ui->cColorPicker_Mosaic_SpacingColor->setColor(thumbSpacing.property("border-color"));
430
446
// .thumbBox img Vignette
431
447
path << " img" ;
432
448
CCssSelection thumbnail = m_styleSheet.selection ( path );
0 commit comments