Skip to content

Commit 4268f8d

Browse files
committed
Mosaic: The space betwwen the thumbnails can be transparent
1 parent e6458bd commit 4268f8d

12 files changed

+908
-713
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.vs/
12
build/
23
src/*.syo
34
src/ezwebgallery.suo

ezwebgallery.vcxproj

+49-49
Large diffs are not rendered by default.

src/CSkinParameters.cpp

+21-5
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ QString CSkinParameters::filePath( ) const
164164
/*******************************************************************
165165
* fromUi( )
166166
* ---------
167-
* Rempli les structures internes avec les donnes rcupres de l'UI
167+
* Rempli les structures internes avec les donnes recuperees de l'UI
168168
********************************************************************/
169169
void CSkinParameters::fromUi( )
170170
{
@@ -205,7 +205,8 @@ void CSkinParameters::fromUi( )
205205
m_styleSheet.addSelection( indexTitle );
206206
//Mosaic
207207
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);
209210
if( m_p_ui->checkBox_Mosaic_BckgColor_Enabled->isChecked() ) { //optional background color
210211
thumbsMosaic.setProperty( QString("background-color"), m_p_ui->cColorPicker_Mosaic_BckgColor->value() );
211212
} else {
@@ -217,7 +218,18 @@ void CSkinParameters::fromUi( )
217218
CCssSelection thumbSpacing( QString(".thumbBox") ); //Espace entre les vignettes
218219
this->thumbBoxBorderSize = m_p_ui->spinBox_Mosaic_SpacingWidth->value();
219220
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+
}
221233
//.thumbBox img -> thumbnail
222234
CCssSelection thumbnail( QString("img"));
223235
this->thumbImgBorderSize = m_p_ui->spinBox_Thumbnail_BorderWidth->value();
@@ -415,7 +427,7 @@ void CSkinParameters::toUi( )
415427
m_p_ui->spinBox_Mosaic_BorderWidth->setValue( thumbsMosaic.property("border-width").remove("px").toInt() );
416428
m_p_ui->cImagePicker_Mosaic_BckgTexture->setImage( m_resources.value("Mosaic_BckgTexture").absoluteFilePath() );
417429
//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");
419431
m_p_ui->cColorPicker_Mosaic_BckgColor->setEnabled( fHasBckgColor );
420432
if( fHasBckgColor ) {
421433
m_p_ui->cColorPicker_Mosaic_BckgColor->setColor( thumbsMosaic.property("background-color") );
@@ -425,8 +437,12 @@ void CSkinParameters::toUi( )
425437
path.clear();
426438
path << ".thumbBox";
427439
CCssSelection thumbSpacing = m_styleSheet.selection( path );
440+
const bool isSpacingTransparent = (thumbSpacing.property("ezwg-transparent") == "true");
428441
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"));
430446
//.thumbBox img Vignette
431447
path << "img";
432448
CCssSelection thumbnail = m_styleSheet.selection( path );

src/generation/CToolbar.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class CToolbarBehavior
9090
{
9191
public:
9292
//optional buttons
93-
typedef struct {
93+
typedef struct t_Buttons {
9494
bool fullscreen = false;
9595
} t_Buttons;
9696

1.18 KB
Binary file not shown.

0 commit comments

Comments
 (0)