diff --git a/src/app/GUI/ColorWidgets/colorlabel.cpp b/src/app/GUI/ColorWidgets/colorlabel.cpp index 19765631f..50db1960f 100755 --- a/src/app/GUI/ColorWidgets/colorlabel.cpp +++ b/src/app/GUI/ColorWidgets/colorlabel.cpp @@ -57,6 +57,15 @@ void ColorLabel::setAlpha(const qreal alpha_t) { update(); } +void ColorLabel::addBookmark() +{ + const QColor col = QColor::fromHsvF(qreal(mHue), + qreal(mSaturation), + qreal(mValue), + mAlpha); + Document::sInstance->addBookmarkColor(col); +} + void ColorLabel::paintGL() { qreal pixelRatio = devicePixelRatioF(); glClear(GL_COLOR_BUFFER_BIT); diff --git a/src/app/GUI/ColorWidgets/colorlabel.h b/src/app/GUI/ColorWidgets/colorlabel.h index 00ec3840f..59c484f6f 100755 --- a/src/app/GUI/ColorWidgets/colorlabel.h +++ b/src/app/GUI/ColorWidgets/colorlabel.h @@ -37,6 +37,8 @@ class ColorLabel : public ColorWidget { void setLastColorHSV(GLfloat h, GLfloat s, GLfloat v); void mousePressEvent(QMouseEvent *e); void setAlpha(const qreal alpha_t); + void addBookmark(); + private: void paintGL(); qreal mAlpha = 1; diff --git a/src/app/GUI/ColorWidgets/colorsettingswidget.cpp b/src/app/GUI/ColorWidgets/colorsettingswidget.cpp index 844f7356f..a8b2818b9 100755 --- a/src/app/GUI/ColorWidgets/colorsettingswidget.cpp +++ b/src/app/GUI/ColorWidgets/colorsettingswidget.cpp @@ -34,6 +34,9 @@ #include "GUI/global.h" #include "GUI/actionbutton.h" #include "GUI/ColorWidgets/savedcolorswidget.h" +#include "appsupport.h" + +#include void ColorSettingsWidget::updateWidgetTargets() { @@ -275,6 +278,13 @@ ColorSettingsWidget::ColorSettingsWidget(QWidget *parent) : QWidget(parent) { mColorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + const auto book = new QShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "colorBookmark", + "B").toString()), + this); + connect(book, &QShortcut::activated, + mColorLabel, &ColorLabel::addBookmark); + // mWheelWidget->setLayout(mWheelLayout); // mWheelLayout->setAlignment(Qt::AlignTop); // wheel_triangle_widget = new H_Wheel_SV_Triangle(this); diff --git a/src/app/GUI/RenderWidgets/renderinstancewidget.cpp b/src/app/GUI/RenderWidgets/renderinstancewidget.cpp index 546f7c207..458216b0a 100755 --- a/src/app/GUI/RenderWidgets/renderinstancewidget.cpp +++ b/src/app/GUI/RenderWidgets/renderinstancewidget.cpp @@ -26,6 +26,7 @@ #include "renderinstancewidget.h" #include "GUI/global.h" #include +#include "canvas.h" #include "outputsettingsdialog.h" #include "outputsettingsprofilesdialog.h" #include "outputsettingsdisplaywidget.h" @@ -389,6 +390,15 @@ void RenderInstanceWidget::read(eReadStream &src) { setChecked(checked); } +void RenderInstanceWidget::updateRenderSettings() +{ + const RenderSettings &renderSettings = mSettings.getRenderSettings(); + mRenderSettingsDisplayWidget->setRenderSettings(mSettings.getTargetCanvas(), + renderSettings); + const auto label = mSettings.getTargetCanvas()->prp_getName(); + if (!label.isEmpty()) { mNameLabel->setText(label); } +} + #include "Private/esettings.h" OutputProfilesListButton::OutputProfilesListButton(RenderInstanceWidget *parent) : QPushButton(parent) { diff --git a/src/app/GUI/RenderWidgets/renderinstancewidget.h b/src/app/GUI/RenderWidgets/renderinstancewidget.h index 3aa451d83..c6de37401 100755 --- a/src/app/GUI/RenderWidgets/renderinstancewidget.h +++ b/src/app/GUI/RenderWidgets/renderinstancewidget.h @@ -60,6 +60,8 @@ class RenderInstanceWidget : public ClosableContainer { void write(eWriteStream &dst) const; void read(eReadStream &src); + void updateRenderSettings(); + protected: void mousePressEvent(QMouseEvent* e); private: diff --git a/src/app/GUI/RenderWidgets/renderwidget.cpp b/src/app/GUI/RenderWidgets/renderwidget.cpp index 46aca8044..bf1808def 100755 --- a/src/app/GUI/RenderWidgets/renderwidget.cpp +++ b/src/app/GUI/RenderWidgets/renderwidget.cpp @@ -289,6 +289,13 @@ void RenderWidget::read(eReadStream &src) } } +void RenderWidget::updateRenderSettings() +{ + for (const auto &wid: mRenderInstanceWidgets) { + wid->updateRenderSettings(); + } +} + void RenderWidget::render(RenderInstanceSettings &settings) { const RenderSettings &renderSettings = settings.getRenderSettings(); diff --git a/src/app/GUI/RenderWidgets/renderwidget.h b/src/app/GUI/RenderWidgets/renderwidget.h index 2e4afc24c..36708fbf6 100755 --- a/src/app/GUI/RenderWidgets/renderwidget.h +++ b/src/app/GUI/RenderWidgets/renderwidget.h @@ -51,6 +51,7 @@ class RenderWidget : public QWidget void clearRenderQueue(); void write(eWriteStream& dst) const; void read(eReadStream& src); + void updateRenderSettings(); signals: void progress(int frame, int total); diff --git a/src/app/evfileio.cpp b/src/app/evfileio.cpp index 015963d45..ff1eb172b 100755 --- a/src/app/evfileio.cpp +++ b/src/app/evfileio.cpp @@ -111,6 +111,7 @@ void MainWindow::loadEVFile(const QString &path) { } file.close(); addRecentFile(path); + mRenderWidget->updateRenderSettings(); } void MainWindow::saveToFile(const QString &path,