diff --git a/README.md b/README.md index 8c265fb..14a2b78 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,7 @@ UMWP Autochanger is a little tool for multi-monitors windows users. I has two ma * randomly and periodically change the wallpaper of all your monitors, * manage sets of wallpapers, allowing you to quickly change which images are used. -Version : 2.0 -Release date : 28/06/2015 -Author : Damien "Mistic" Sorel -Website : http://www.strangeplanet.fr/work/umwp-autochanger -License : GNU General Public License Version 3 +[Documentation](http://www.strangeplanet.fr/work/umwp-autochanger#help) ![screenshot](http://www.strangeplanet.fr/work/umwp-autochanger/src/screenshot-main.png) @@ -29,4 +25,8 @@ You will need Qt 5.4. ### Branding -UMWP originally meant **UltraMon Wallpaper**. When I removed UltraMon dependency in version 2 I searched a new name that match with the acronym. And I came with **Ultimate Monitor Wallpaper**, which is very pompous ! \ No newline at end of file +UMWP originally meant **UltraMon Wallpaper**. When I removed UltraMon dependency in version 2 I searched a new name that match with the acronym. And I came with **Ultimate Monitor Wallpaper**, which is very pompous ! + + +### License +UMWP Autochanger is released under GNU General Public License Version 3. \ No newline at end of file diff --git a/src/constants.h b/src/constants.h index 5554393..b4dbff4 100644 --- a/src/constants.h +++ b/src/constants.h @@ -21,7 +21,7 @@ #define APP_VERSION_URL "http://www.strangeplanet.fr/work/umwp-autochanger/last-version.txt" #define APP_ISSUES_URL "https://github.com/mistic100/UMWP-Autochanger/issues" -#define APP_INSTALLER_SIZE 5000000 +#define APP_INSTALLER_SIZE 6000000 #define APP_MAX_TRAVERSAL 3 #define APP_MAX_APP_RUNNING_MESSAGE_COUNT 3 #define APP_MIN_WIDTH 450 diff --git a/src/customlayout.h b/src/customlayout.h index 7f17160..63309f8 100644 --- a/src/customlayout.h +++ b/src/customlayout.h @@ -19,6 +19,7 @@ struct CustomLayout { short mainCols; UM::ALIGN mainPos; bool borderEnabled; + bool borderScreenEnabled; short borderWidth; QRgb borderColor; @@ -34,7 +35,8 @@ struct CustomLayout { mainCols(4), mainPos(UM::ALIGN_CENTER_CENTER), borderEnabled(true), - borderWidth(3), + borderScreenEnabled(false), + borderWidth(10), borderColor(Qt::black) {} }; diff --git a/src/gui/customlayoutdialog.cpp b/src/gui/customlayoutdialog.cpp index fc2f5e0..b0829f5 100644 --- a/src/gui/customlayoutdialog.cpp +++ b/src/gui/customlayoutdialog.cpp @@ -73,6 +73,7 @@ void CustomLayoutDialog::showEvent(QShowEvent*) connect(ui->mainCols, SIGNAL(valueChanged(int)), this, SLOT(renderPreview())); connect(ui->mainRows, SIGNAL(valueChanged(int)), this, SLOT(renderPreview())); connect(ui->borderEnabled, SIGNAL(toggled(bool)), this, SLOT(renderPreview())); + connect(ui->borderScreenEnabled, SIGNAL(toggled(bool)), this, SLOT(renderPreview())); connect(ui->borderWidth, SIGNAL(valueChanged(int)), this, SLOT(renderPreview())); connect(ui->borderColor, SIGNAL(colorChanged(QColor)), this, SLOT(renderPreview())); @@ -109,11 +110,13 @@ void CustomLayoutDialog::setCustLayout(const CustomLayout &_layout) ui_mainPosition->setCheckedId(_layout.mainPos); ui->borderEnabled->setChecked(_layout.borderEnabled); + ui->borderScreenEnabled->setChecked(_layout.borderScreenEnabled); ui->borderWidth->setValue(_layout.borderWidth); ui->borderColor->setColor(QColor(_layout.borderColor)); on_rows_valueChanged(_layout.rows); on_cols_valueChanged(_layout.cols); + on_borderWidth_valueChanged(_layout.borderWidth); } /** @@ -132,6 +135,7 @@ CustomLayout CustomLayoutDialog::getCustLayout() const layout.maxCols = ui->tileCols->upperValue(); layout.mainEnabled = ui->mainEnabled->isChecked(); + layout.borderScreenEnabled = ui->borderScreenEnabled->isChecked(); layout.mainRows = ui->mainRows->value(); layout.mainCols = ui->mainCols->value(); layout.mainPos = static_cast(ui_mainPosition->checkedId()); @@ -171,6 +175,15 @@ void CustomLayoutDialog::on_cols_valueChanged(int _val) ui->mainColsMaxLabel->setText(QString::number(_val)); } +/** + * @brief Update border width label + * @param _val + */ +void CustomLayoutDialog::on_borderWidth_valueChanged(int _val) +{ + ui->borderWidthLabel->setText(QString::number(_val)); +} + /** * @brief Render the preview */ @@ -196,19 +209,25 @@ void CustomLayoutDialog::renderPreview() { QRect newBlock = UM::scaledRect(block, wRatio, hRatio); - if (qAbs(newBlock.left() - size.width()) <= 2) + if (qAbs(newBlock.left() - size.width()) <= 3) { - newBlock.setLeft(size.width()); + newBlock.setLeft(size.width()-1); } - if (qAbs(newBlock.bottom() - size.height()) <= 2) + if (qAbs(newBlock.bottom() - size.height()) <= 3) { - newBlock.setBottom(size.height()); + newBlock.setBottom(size.height()-1); } blocks.append(newBlock); } + // draw background the same color of borders + if (layout.borderEnabled) + { + m_scene->addRect(QRect(QPoint(0, 0), size), Qt::NoPen, QBrush(QColor(layout.borderColor))); + } + // draw blocks int i = 0; foreach (const QRect block, blocks) @@ -235,6 +254,7 @@ void CustomLayoutDialog::renderPreview() QPen pen; pen.setColor(QColor(layout.borderColor)); + pen.setJoinStyle(Qt::MiterJoin); pen.setWidth(qRound((double) layout.borderWidth * size.width() / monitorWidth)); foreach (const QRect block, blocks) @@ -256,6 +276,12 @@ void CustomLayoutDialog::renderPreview() } } } + + if (layout.borderScreenEnabled) + { + QRect borderRect(pen.width()/2, pen.width()/2, size.width()-pen.width()-2, size.height()-pen.width()-2); + m_scene->addRect(borderRect, pen, Qt::NoBrush); + } } ui->view->update(); diff --git a/src/gui/customlayoutdialog.h b/src/gui/customlayoutdialog.h index 39045ac..d8bb966 100644 --- a/src/gui/customlayoutdialog.h +++ b/src/gui/customlayoutdialog.h @@ -46,6 +46,7 @@ private slots: void renderPreview(); void on_rows_valueChanged(int _val); void on_cols_valueChanged(int _val); + void on_borderWidth_valueChanged(int _val); }; #endif // CustomLayoutDialog_H diff --git a/src/gui/customlayoutdialog.ui b/src/gui/customlayoutdialog.ui index 1449625..ca84da0 100644 --- a/src/gui/customlayoutdialog.ui +++ b/src/gui/customlayoutdialog.ui @@ -10,7 +10,7 @@ 0 0 780 - 360 + 375 @@ -28,7 +28,7 @@ true - + 6 @@ -85,10 +85,10 @@ - + - + Color @@ -98,6 +98,26 @@ + + + + + 26 + 0 + + + + 10 + + + + + + + Screen border + + + diff --git a/src/lang/en_GB/changelog.htm b/src/lang/en_GB/changelog.htm index 89105aa..d93facf 100644 --- a/src/lang/en_GB/changelog.htm +++ b/src/lang/en_GB/changelog.htm @@ -1,5 +1,5 @@
-
Version 2.1.0
+
Version 2.1.0 January 17th 2016
  • New "Custom" wallpaper style: displays multiple images in a configurable grid
  • diff --git a/src/lang/en_GB/main.ts b/src/lang/en_GB/main.ts index 4b4d4a1..62e9bb1 100644 --- a/src/lang/en_GB/main.ts +++ b/src/lang/en_GB/main.ts @@ -201,46 +201,51 @@ - + Grid - - - + + + Rows - + + Screen border + + + + Width - + Color - - - + + + Columns - + Position - + Tiles - + Fixed tile diff --git a/src/lang/fr_FR/changelog.htm b/src/lang/fr_FR/changelog.htm index cbac899..8231e2c 100644 --- a/src/lang/fr_FR/changelog.htm +++ b/src/lang/fr_FR/changelog.htm @@ -1,5 +1,5 @@
    -
    Version 2.1.0
    +
    Version 2.1.0 17 Janvier 2016
    • Nouveau style de fond d'écran "Personnalisé" : affiche plusieurs images sur un grille configurable
    • diff --git a/src/lang/fr_FR/main.ts b/src/lang/fr_FR/main.ts index 0db6c85..856eeaf 100644 --- a/src/lang/fr_FR/main.ts +++ b/src/lang/fr_FR/main.ts @@ -201,46 +201,51 @@ Configuration du style personnalisé - + Grid Grille - - - + + + Rows Lignes - + + Screen border + Bordure de l'écran + + + Width Largeur - + Color Couleur - - - + + + Columns Colonnes - + Tiles Tuiles - + Fixed tile Tuile principale - + Position Position diff --git a/src/lang/ru_RU/changelog.htm b/src/lang/ru_RU/changelog.htm index 206332c..86a4865 100644 --- a/src/lang/ru_RU/changelog.htm +++ b/src/lang/ru_RU/changelog.htm @@ -1,5 +1,5 @@
      -
      Версия 2.1.0
      +
      Версия 2.1.0 17 января 2016
      • Новый стиль обоев "Изменённый": отображает несколько изображений в настраиваемой сетке.
      • diff --git a/src/lang/ru_RU/main.ts b/src/lang/ru_RU/main.ts index a93469e..cceed8f 100644 --- a/src/lang/ru_RU/main.ts +++ b/src/lang/ru_RU/main.ts @@ -1,4 +1,6 @@ - + + + ChangelogDialog @@ -199,46 +201,51 @@ Настройки изменённой раскладки - + Grid Сетка - - - + + + Rows Строки - + + Screen border + Монитор границу + + + Width Ширина - + Color Цвет - - - + + + Columns Колонки - + Position Положение - + Tiles Плитка - + Fixed tile Фиксированная плитка @@ -771,4 +778,4 @@ Старт - \ No newline at end of file + diff --git a/src/set.cpp b/src/set.cpp index 60a90e9..cc86d2e 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -88,6 +88,7 @@ Set::Set(const QDomElement* _dom) m_custLayout.mainCols = element.attribute("mainCols").toShort(); m_custLayout.mainPos = static_cast(element.attribute("mainPos").toInt()); m_custLayout.borderEnabled = (bool) element.attribute("borderEnabled").toInt(); + m_custLayout.borderScreenEnabled = (bool) element.attribute("borderScreenEnabled").toInt(); m_custLayout.borderWidth = element.attribute("borderWidth").toShort(); m_custLayout.borderColor = element.attribute("borderColor").toUInt(); } @@ -142,6 +143,7 @@ void Set::writeXml(QXmlStreamWriter* _writer) const _writer->writeAttribute("mainCols", QString::number(m_custLayout.mainCols)); _writer->writeAttribute("mainPos", QString::number(m_custLayout.mainPos)); _writer->writeAttribute("borderEnabled", QString::number(m_custLayout.borderEnabled)); + _writer->writeAttribute("borderScreenEnabled", QString::number(m_custLayout.borderScreenEnabled)); _writer->writeAttribute("borderWidth", QString::number(m_custLayout.borderWidth)); _writer->writeAttribute("borderColor", QString::number(m_custLayout.borderColor)); diff --git a/src/umutils.cpp b/src/umutils.cpp index 4a75fd3..670b813 100644 --- a/src/umutils.cpp +++ b/src/umutils.cpp @@ -31,10 +31,10 @@ bool UM::moveFileToTrash(const QString &_filename) QRect UM::scaledRect(const QRect &_rect, float _xRatio, float _yRatio) { return QRect( - _rect.left() * _xRatio, - _rect.top() * _yRatio, - _rect.width() * _xRatio, - _rect.height() * _yRatio + qRound(_rect.left() * _xRatio), + qRound(_rect.top() * _yRatio), + qRound(_rect.width() * _xRatio), + qRound(_rect.height() * _yRatio) ); } diff --git a/src/wallpapergenerator.cpp b/src/wallpapergenerator.cpp index f44a3bb..73afc85 100644 --- a/src/wallpapergenerator.cpp +++ b/src/wallpapergenerator.cpp @@ -375,14 +375,14 @@ QString WallpaperGenerator::generateCustomFile(int _idx, Set* _set, QVector