Skip to content

Commit

Permalink
Update Theme
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Aug 10, 2024
1 parent b69afc3 commit 7a1308c
Show file tree
Hide file tree
Showing 17 changed files with 172 additions and 118 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Friction](https://friction.graphics) is a powerful and versatile motion graphics application that allows you to create vector and raster animations for web and video platforms with ease.

![Screenshot of Friction 1.0.0 Beta 1](https://friction.graphics/assets/screenshots/100/friction-100b1-screenshot.jpg)
![Screenshot of Friction 1.0.0 Beta 1](https://friction.graphics/assets/screenshots/100/friction-100b1-screenshot.png)

## Contribute

Expand Down
8 changes: 4 additions & 4 deletions src/app/GUI/RenderWidgets/closablecontainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
ClosableContainer::ClosableContainer(QWidget *parent) : QWidget(parent) {
mMainLayout->setAlignment(Qt::AlignTop);
setLayout(mMainLayout);
mContentArrow = new QPushButton("", this);
mContentArrow = new QPushButton(this);
mContentArrow->setFocusPolicy(Qt::NoFocus);
mContentArrow->setObjectName("FlatButton");
//mContentArrow->setObjectName("FlatButton");
mContentArrow->setCheckable(true);
mContentArrow->setFixedSize(eSizesUI::widget, eSizesUI::widget);
if (eSettings::instance().fCurrentInterfaceDPI != 1.) {
Expand All @@ -48,10 +48,11 @@ ClosableContainer::ClosableContainer(QWidget *parent) : QWidget(parent) {
mVLayout->addWidget(mContWidget);
mContWidget->setContentsMargins(0, 0, 0, 0);
mContWidget->setLayout(mContLayout);
mContLayout->setMargin(0);
//mContLayout->setMargin(0);
mContLayout->setAlignment(Qt::AlignTop);
mVLayout->setSpacing(0);
mVLayout->setMargin(0);
mVLayout->setContentsMargins(0, 0, 0, 0);
setContentVisible(false);
}

Expand All @@ -73,7 +74,6 @@ void ClosableContainer::setCheckable(const bool check) {
mCheckBox->setFocusPolicy(Qt::NoFocus);
eSizesUI::widget.add(mCheckBox, [this](const int size) {
mCheckBox->setFixedSize(QSize(size, size));
mCheckBox->setStyleSheet(QString("QCheckBox::indicator { width: %1px; height: %1px;}").arg(size/1.5));
});
mMainLayout->insertWidget(0, mCheckBox, 0, Qt::AlignTop);
mCheckBox->setChecked(true);
Expand Down
2 changes: 2 additions & 0 deletions src/app/GUI/RenderWidgets/outputsettingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ OutputSettingsDialog::OutputSettingsDialog(const OutputSettings &settings,
mOutputFormatsLayout->addWidget(mOutputFormatsComboBox);

mVideoGroupBox = new QGroupBox(tr("Video"), this);
mVideoGroupBox->setObjectName("BlueBoxLeft");
mVideoGroupBox->setCheckable(true);
mVideoGroupBox->setChecked(true);
mVideoSettingsLayout = new TwoColumnLayout();
Expand All @@ -106,6 +107,7 @@ OutputSettingsDialog::OutputSettingsDialog(const OutputSettings &settings,
mBitrateSpinBox);

mAudioGroupBox = new QGroupBox(tr("Audio"), this);
mAudioGroupBox->setObjectName("BlueBoxLeft");
mAudioGroupBox->setCheckable(true);
mAudioSettingsLayout = new TwoColumnLayout();
mAudioCodecsLabel = new QLabel(tr("Codec"), this);
Expand Down
9 changes: 5 additions & 4 deletions src/app/GUI/RenderWidgets/renderinstancewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,24 @@ void RenderInstanceWidget::iniGUI() {
mNameLabel = new QLineEdit(this);
mNameLabel->setFocusPolicy(Qt::NoFocus);
mNameLabel->setFixedHeight(eSizesUI::widget);
mNameLabel->setObjectName("darkWidget");
mNameLabel->setObjectName("RenderTitleWidget");
mNameLabel->setReadOnly(true);
mNameLabel->setFrame(false);
//mNameLabel->setFrame(false);

setLabelWidget(mNameLabel);

QWidget *contWid = new QWidget(this);
contWid->setContentsMargins(0, 0, 0, 0);
contWid->setLayout(mContentLayout);
contWid->setObjectName("darkWidget");
contWid->setObjectName("RenderContentWidget");

addContentWidget(contWid);

mRenderSettingsDisplayWidget = new RenderSettingsDisplayWidget(this);

QWidget *renderSettingsLabelWidget = new QWidget(this);
renderSettingsLabelWidget->setContentsMargins(0, 0, 0, 0);
renderSettingsLabelWidget->setObjectName("darkWidget");
//renderSettingsLabelWidget->setObjectName("darkWidget");
QVBoxLayout *renderSettingsLayout = new QVBoxLayout(renderSettingsLabelWidget);

mRenderSettingsButton = new QPushButton(tr("Scene ..."));
Expand Down Expand Up @@ -204,6 +204,7 @@ void RenderInstanceWidget::iniGUI() {

mContentLayout->setMargin(0);
mContentLayout->setSpacing(0);
mContentLayout->setContentsMargins(0, 0, 0, 0);
}

void RenderInstanceWidget::updateFromSettings() {
Expand Down
10 changes: 6 additions & 4 deletions src/app/GUI/RenderWidgets/renderwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ RenderWidget::RenderWidget(QWidget *parent)
bottomWidget->setContentsMargins(0, 0, 0, 0);
const auto bottomLayout = new QHBoxLayout(bottomWidget);

const auto darkPal = ThemeSupport::getDarkPalette();
bottomWidget->setAutoFillBackground(true);
bottomWidget->setPalette(darkPal);
setPalette(ThemeSupport::getDarkPalette());
setAutoFillBackground(true);

bottomWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);

mRenderProgressBar = new QProgressBar(this);
Expand Down Expand Up @@ -121,6 +121,8 @@ RenderWidget::RenderWidget(QWidget *parent)
});

mContWidget = new QWidget(this);
mContWidget->setPalette(ThemeSupport::getDarkPalette());
mContWidget->setAutoFillBackground(true);
mContWidget->setContentsMargins(0, 0, 0, 0);
mContLayout = new QVBoxLayout(mContWidget);
mContLayout->setAlignment(Qt::AlignTop);
Expand All @@ -138,8 +140,8 @@ RenderWidget::RenderWidget(QWidget *parent)
bottomLayout->addWidget(mAddRenderButton);
bottomLayout->addWidget(mClearQueueButton);

mMainLayout->addWidget(mScrollArea);
mMainLayout->addWidget(bottomWidget);
mMainLayout->addWidget(mScrollArea);

const auto vidEmitter = VideoEncoder::sInstance->getEmitter();
connect(vidEmitter, &VideoEncoderEmitter::encodingStarted,
Expand Down
66 changes: 29 additions & 37 deletions src/app/GUI/Settings/generalsettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,48 +55,43 @@ GeneralSettingsWidget::GeneralSettingsWidget(QWidget *parent)
const auto mGeneralLayout = new QVBoxLayout(mGeneralWidget);
mGeneralLayout->setContentsMargins(0, 0, 0, 0);

const auto mAutoBackupWidget = new QGroupBox(this);
mAutoBackupWidget->setTitle(tr("Backup"));
mAutoBackupWidget->setContentsMargins(0, 0, 0, 0);
const auto mAutoBackupLayout = new QHBoxLayout(mAutoBackupWidget);
const auto mProjectWidget = new QGroupBox(this);
mProjectWidget->setObjectName("BlueBox");
mProjectWidget->setTitle(tr("Project I/O"));
mProjectWidget->setContentsMargins(0, 0, 0, 0);
const auto mProjectLayout = new QVBoxLayout(mProjectWidget);

const auto mAutoBackupLabel = new QLabel(tr("Enable Backup on Save"), this);
mAutoBackupLabel->setToolTip(tr("Creates a backup file after each successful save.\n\n"
"Backup files are stored in a folder called PROJECT.friction_backup."));

mAutoBackup = new QCheckBox(this);
mAutoBackup = new QCheckBox(tr("Enable Backup on Save"), this);
mAutoBackup->setCheckable(true);
mAutoBackup->setToolTip(tr("Creates a backup file after each successful save.\n\n"
"Backup files are stored in a folder called PROJECT.friction_backup."));
mProjectLayout->addWidget(mAutoBackup);

mAutoBackupLayout->addWidget(mAutoBackupLabel);
mAutoBackupLayout->addStretch();
mAutoBackupLayout->addWidget(mAutoBackup);

mGeneralLayout->addWidget(mAutoBackupWidget);
mGeneralLayout->addWidget(mProjectWidget);

const auto mAutoSaveWidget = new QGroupBox(this);
mAutoSaveWidget->setTitle(tr("Auto Save"));
const auto mAutoSaveWidget = new QWidget(this);
mAutoSaveWidget->setContentsMargins(0, 0, 0, 0);
const auto mAutoSaveLayout = new QHBoxLayout(mAutoSaveWidget);
mAutoSaveLayout->setContentsMargins(0, 0, 0, 0);
mAutoSaveLayout->setMargin(0);

const auto mAutoSaveLabel = new QLabel(tr("Enable Auto Save"), this);
mAutoSaveLabel->setToolTip(tr("Will auto save each X min if project is unsaved.\n\n"
"Enable Backup on Save for incremental saves (and as a failsafe)."));

mAutoSave = new QCheckBox(this);
mAutoSave = new QCheckBox(tr("Enable Auto Save"), this);
mAutoSave->setCheckable(true);
mAutoSave->setToolTip(tr("Will auto save each X min if project is unsaved.\n\n"
"Enable Backup on Save for incremental saves (and as a failsafe)."));

mAutoSaveTimer = new QSpinBox(this);
mAutoSaveTimer->setRange(1, 60);
mAutoSaveTimer->setSuffix(tr(" min"));

mAutoSaveLayout->addWidget(mAutoSaveLabel);
mAutoSaveLayout->addStretch();
mAutoSaveLayout->addWidget(mAutoSave);
mAutoSaveLayout->addStretch();
mAutoSaveLayout->addWidget(mAutoSaveTimer);

mGeneralLayout->addWidget(mAutoSaveWidget);
mProjectLayout->addWidget(mAutoSaveWidget);

const auto mScaleWidget = new QGroupBox(this);
mScaleWidget->setObjectName("BlueBox");
mScaleWidget->setTitle(tr("Interface Scaling"));
mScaleWidget->setContentsMargins(0, 0, 0, 0);
const auto mScaleLayout = new QVBoxLayout(mScaleWidget);
Expand Down Expand Up @@ -130,14 +125,11 @@ GeneralSettingsWidget::GeneralSettingsWidget(QWidget *parent)

mGeneralLayout->addWidget(mScaleWidget);

const auto mImportWidget = new QGroupBox(this);
mImportWidget->setTitle(tr("Import"));
mImportWidget->setContentsMargins(0, 0, 0, 0);
const auto mImportLayout = new QVBoxLayout(mImportWidget);

const auto mImportFileWidget = new QWidget(this);
mImportFileWidget->setContentsMargins(0, 0, 0, 0);
const auto mImportFileLayout = new QHBoxLayout(mImportFileWidget);
mImportFileLayout->setContentsMargins(0, 0, 0, 0);
mImportFileLayout->setMargin(0);

const auto mImportFileLabel = new QLabel(tr("Default import directory"), this);
mImportFileDir = new QComboBox(this);
Expand All @@ -146,21 +138,19 @@ GeneralSettingsWidget::GeneralSettingsWidget(QWidget *parent)

mImportFileLayout->addWidget(mImportFileLabel);
mImportFileLayout->addWidget(mImportFileDir);
mImportLayout->addWidget(mImportFileWidget);
mGeneralLayout->addWidget(mImportWidget);

mProjectLayout->addSpacing(10);
mProjectLayout->addWidget(mImportFileWidget);

setupToolBarWidgets(mGeneralLayout);

mGeneralLayout->addStretch();
addWidget(mGeneralWidget);

eSizesUI::widget.add(mAutoBackup, [this](const int size) {
mAutoBackup->setFixedSize(QSize(size, size));
mAutoBackup->setStyleSheet(QString("QCheckBox::indicator { width: %1px; height: %1px;}").arg(size/1.5));
mAutoSave->setFixedSize(QSize(size, size));
mAutoSave->setStyleSheet(QString("QCheckBox::indicator { width: %1px; height: %1px;}").arg(size/1.5));
mAutoBackup->setFixedHeight(size);
mAutoSave->setFixedHeight(size);
mDefaultInterfaceScaling->setFixedHeight(size);
mDefaultInterfaceScaling->setStyleSheet(QString("QCheckBox::indicator { width: %1px; height: %1px;}").arg(size/1.5));
});
}

Expand Down Expand Up @@ -232,20 +222,22 @@ void GeneralSettingsWidget::setupToolBarWidgets(QVBoxLayout *lay)

const auto area = new QScrollArea(this);
const auto container = new QGroupBox(this);
container->setObjectName("BlueBox");
const auto containerLayout = new QVBoxLayout(container);
const auto containerInner = new QWidget(this);
const auto containerInnerLayout = new QVBoxLayout(containerInner);

area->setWidget(containerInner);
area->setWidgetResizable(true);
area->setContentsMargins(0, 0, 0, 0);
area->setFrameShape(QFrame::NoFrame);

container->setTitle(tr("Toolbar Actions"));

container->setContentsMargins(0, 0, 0, 0);

containerInnerLayout->setMargin(5);
containerLayout->setMargin(0);
//containerLayout->setMargin(0);

containerLayout->addWidget(area);

Expand Down
1 change: 1 addition & 0 deletions src/app/GUI/fillstrokesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ FillStrokeSettingsWidget::FillStrokeSettingsWidget(Document &document,
mMainLayout->addStretch();

const auto mFillStrokeArea = new ScrollArea(this);
mFillAndStrokeWidget->setObjectName("DarkWidget");
mFillStrokeArea->setWidget(mFillAndStrokeWidget);

const auto mLayout = new QVBoxLayout(this);
Expand Down
2 changes: 2 additions & 0 deletions src/app/GUI/fontswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ FontsWidget::FontsWidget(QWidget *parent)
});

mTextInput = new QPlainTextEdit(this);
mTextInput->setPalette(ThemeSupport::getDarkerPalette());
mTextInput->setAutoFillBackground(true);
mTextInput->setFocusPolicy(Qt::ClickFocus);
mTextInput->setPlaceholderText(tr("Enter text ..."));
connect(mTextInput, &QPlainTextEdit::textChanged,
Expand Down
4 changes: 3 additions & 1 deletion src/app/GUI/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,16 @@ MainWindow::MainWindow(Document& document,

const auto fontWidget = new QWidget(this);
fontWidget->setAutoFillBackground(true);
fontWidget->setPalette(ThemeSupport::getNotSoDarkPalette());
fontWidget->setPalette(ThemeSupport::getDarkPalette());

const auto fontLayout = new QVBoxLayout(fontWidget);
fontLayout->addWidget(mFontWidget);

QMargins frictionMargins(0, 0, 0, 0);
int frictionSpacing = 0;

fontWidget->setContentsMargins(frictionMargins);

const auto darkPal = ThemeSupport::getDarkPalette();
mObjectSettingsScrollArea->setAutoFillBackground(true);
mObjectSettingsScrollArea->setPalette(darkPal);
Expand Down
Loading

0 comments on commit 7a1308c

Please sign in to comment.