Skip to content

Commit

Permalink
Merge branch 'main' into nui
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Mar 6, 2024
2 parents 4bfd3a0 + c907446 commit efc5ec2
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/GUI/ColorWidgets/colorlabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/app/GUI/ColorWidgets/colorlabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions src/app/GUI/ColorWidgets/colorsettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
#include "GUI/global.h"
#include "GUI/actionbutton.h"
#include "GUI/ColorWidgets/savedcolorswidget.h"
#include "appsupport.h"

#include <QShortcut>

void ColorSettingsWidget::updateWidgetTargets()
{
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 10 additions & 0 deletions src/app/GUI/RenderWidgets/renderinstancewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "renderinstancewidget.h"
#include "GUI/global.h"
#include <QMenu>
#include "canvas.h"
#include "outputsettingsdialog.h"
#include "outputsettingsprofilesdialog.h"
#include "outputsettingsdisplaywidget.h"
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/app/GUI/RenderWidgets/renderinstancewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions src/app/GUI/RenderWidgets/renderwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/app/GUI/RenderWidgets/renderwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/app/evfileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ void MainWindow::loadEVFile(const QString &path) {
}
file.close();
addRecentFile(path);
mRenderWidget->updateRenderSettings();
}

void MainWindow::saveToFile(const QString &path,
Expand Down

0 comments on commit efc5ec2

Please sign in to comment.