Merge branch 'master' of https://github.com/olive-editor/olive into furtherocio
This commit is contained in:
@@ -23,7 +23,6 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QIcon>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
@@ -48,7 +47,7 @@ TextEditDialog::TextEditDialog(QWidget *parent, const QString &s, bool rich_text
|
|||||||
// Bold Button
|
// Bold Button
|
||||||
/*
|
/*
|
||||||
bold_button = new QPushButton();
|
bold_button = new QPushButton();
|
||||||
bold_button->setIcon(QIcon(":/icons/bold.svg"));
|
bold_button->setIcon(olive::icon::CreateIconFromSVG(":/icons/bold.svg", false));
|
||||||
bold_button->setCheckable(true);
|
bold_button->setCheckable(true);
|
||||||
connect(bold_button, SIGNAL(clicked(bool)), this, SLOT(SetBold(bool)));
|
connect(bold_button, SIGNAL(clicked(bool)), this, SLOT(SetBold(bool)));
|
||||||
toolbar->addWidget(bold_button);
|
toolbar->addWidget(bold_button);
|
||||||
@@ -56,14 +55,14 @@ TextEditDialog::TextEditDialog(QWidget *parent, const QString &s, bool rich_text
|
|||||||
|
|
||||||
// Italic Button
|
// Italic Button
|
||||||
italic_button = new QPushButton();
|
italic_button = new QPushButton();
|
||||||
italic_button->setIcon(QIcon(":/icons/italic.svg"));
|
italic_button->setIcon(olive::icon::CreateIconFromSVG(":/icons/italic.svg", false));
|
||||||
italic_button->setCheckable(true);
|
italic_button->setCheckable(true);
|
||||||
connect(italic_button, SIGNAL(clicked(bool)), textEdit, SLOT(setFontItalic(bool)));
|
connect(italic_button, SIGNAL(clicked(bool)), textEdit, SLOT(setFontItalic(bool)));
|
||||||
toolbar->addWidget(italic_button);
|
toolbar->addWidget(italic_button);
|
||||||
|
|
||||||
// Underline Button
|
// Underline Button
|
||||||
underline_button = new QPushButton();
|
underline_button = new QPushButton();
|
||||||
underline_button->setIcon(QIcon(":/icons/underline.svg"));
|
underline_button->setIcon(olive::icon::CreateIconFromSVG(":/icons/underline.svg", false));
|
||||||
underline_button->setCheckable(true);
|
underline_button->setCheckable(true);
|
||||||
connect(underline_button, SIGNAL(clicked(bool)), textEdit, SLOT(setFontUnderline(bool)));
|
connect(underline_button, SIGNAL(clicked(bool)), textEdit, SLOT(setFontUnderline(bool)));
|
||||||
toolbar->addWidget(underline_button);
|
toolbar->addWidget(underline_button);
|
||||||
@@ -101,7 +100,7 @@ TextEditDialog::TextEditDialog(QWidget *parent, const QString &s, bool rich_text
|
|||||||
|
|
||||||
// Left Align
|
// Left Align
|
||||||
left_align_button = new QPushButton();
|
left_align_button = new QPushButton();
|
||||||
left_align_button->setIcon(QIcon(":/icons/align-left.svg"));
|
left_align_button->setIcon(olive::icon::CreateIconFromSVG(":/icons/align-left.svg", false));
|
||||||
left_align_button->setCheckable(true);
|
left_align_button->setCheckable(true);
|
||||||
left_align_button->setProperty("a", Qt::AlignLeft);
|
left_align_button->setProperty("a", Qt::AlignLeft);
|
||||||
connect(left_align_button, SIGNAL(clicked(bool)), this, SLOT(SetAlignmentFromProperty()));
|
connect(left_align_button, SIGNAL(clicked(bool)), this, SLOT(SetAlignmentFromProperty()));
|
||||||
@@ -109,7 +108,7 @@ TextEditDialog::TextEditDialog(QWidget *parent, const QString &s, bool rich_text
|
|||||||
|
|
||||||
// Center Align
|
// Center Align
|
||||||
center_align_button = new QPushButton();
|
center_align_button = new QPushButton();
|
||||||
center_align_button->setIcon(QIcon(":/icons/align-center.svg"));
|
center_align_button->setIcon(olive::icon::CreateIconFromSVG(":/icons/align-center.svg", false));
|
||||||
center_align_button->setCheckable(true);
|
center_align_button->setCheckable(true);
|
||||||
center_align_button->setProperty("a", Qt::AlignCenter);
|
center_align_button->setProperty("a", Qt::AlignCenter);
|
||||||
connect(center_align_button, SIGNAL(clicked(bool)), this, SLOT(SetAlignmentFromProperty()));
|
connect(center_align_button, SIGNAL(clicked(bool)), this, SLOT(SetAlignmentFromProperty()));
|
||||||
@@ -117,7 +116,7 @@ TextEditDialog::TextEditDialog(QWidget *parent, const QString &s, bool rich_text
|
|||||||
|
|
||||||
// Right Align
|
// Right Align
|
||||||
right_align_button = new QPushButton();
|
right_align_button = new QPushButton();
|
||||||
right_align_button->setIcon(QIcon(":/icons/align-right.svg"));
|
right_align_button->setIcon(olive::icon::CreateIconFromSVG(":/icons/align-right.svg", false));
|
||||||
right_align_button->setCheckable(true);
|
right_align_button->setCheckable(true);
|
||||||
right_align_button->setProperty("a", Qt::AlignRight);
|
right_align_button->setProperty("a", Qt::AlignRight);
|
||||||
connect(right_align_button, SIGNAL(clicked(bool)), this, SLOT(SetAlignmentFromProperty()));
|
connect(right_align_button, SIGNAL(clicked(bool)), this, SLOT(SetAlignmentFromProperty()));
|
||||||
@@ -125,7 +124,7 @@ TextEditDialog::TextEditDialog(QWidget *parent, const QString &s, bool rich_text
|
|||||||
|
|
||||||
// Justify Align
|
// Justify Align
|
||||||
justify_align_button = new QPushButton();
|
justify_align_button = new QPushButton();
|
||||||
justify_align_button->setIcon(QIcon(":/icons/justify-center.svg"));
|
justify_align_button->setIcon(olive::icon::CreateIconFromSVG(":/icons/justify-center.svg", false));
|
||||||
justify_align_button->setCheckable(true);
|
justify_align_button->setCheckable(true);
|
||||||
justify_align_button->setProperty("a", Qt::AlignJustify);
|
justify_align_button->setProperty("a", Qt::AlignJustify);
|
||||||
connect(justify_align_button, SIGNAL(clicked(bool)), this, SLOT(SetAlignmentFromProperty()));
|
connect(justify_align_button, SIGNAL(clicked(bool)), this, SLOT(SetAlignmentFromProperty()));
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "timeline/clip.h"
|
#include "timeline/clip.h"
|
||||||
#include "rendering/renderfunctions.h"
|
#include "rendering/renderfunctions.h"
|
||||||
#include "panels.h"
|
#include "panels.h"
|
||||||
|
#include "ui/icons.h"
|
||||||
#include "global/debug.h"
|
#include "global/debug.h"
|
||||||
|
|
||||||
GraphEditor::GraphEditor(QWidget* parent) : Panel(parent), row(nullptr) {
|
GraphEditor::GraphEditor(QWidget* parent) : Panel(parent), row(nullptr) {
|
||||||
@@ -184,7 +185,7 @@ void GraphEditor::set_row(EffectRow *r) {
|
|||||||
QPushButton* slider_button = new QPushButton();
|
QPushButton* slider_button = new QPushButton();
|
||||||
slider_button->setCheckable(true);
|
slider_button->setCheckable(true);
|
||||||
slider_button->setChecked(field->IsEnabled());
|
slider_button->setChecked(field->IsEnabled());
|
||||||
slider_button->setIcon(QIcon(":/icons/record.svg"));
|
slider_button->setIcon(olive::icon::CreateIconFromSVG(":/icons/record.svg", false));
|
||||||
slider_button->setProperty("field", i);
|
slider_button->setProperty("field", i);
|
||||||
slider_button->setIconSize(slider_button->iconSize()*0.5);
|
slider_button->setIconSize(slider_button->iconSize()*0.5);
|
||||||
connect(slider_button, SIGNAL(toggled(bool)), this, SLOT(set_field_visibility(bool)));
|
connect(slider_button, SIGNAL(toggled(bool)), this, SLOT(set_field_visibility(bool)));
|
||||||
|
|||||||
+29
-24
@@ -26,7 +26,7 @@ QIcon olive::icon::ViewerPause;
|
|||||||
QIcon olive::icon::ViewerNextFrame;
|
QIcon olive::icon::ViewerNextFrame;
|
||||||
QIcon olive::icon::ViewerGoToEnd;
|
QIcon olive::icon::ViewerGoToEnd;
|
||||||
|
|
||||||
QIcon olive::icon::CreateIconFromSVG(const QString &path)
|
QIcon olive::icon::CreateIconFromSVG(const QString &path, bool create_disabled)
|
||||||
{
|
{
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
|
|
||||||
@@ -35,6 +35,7 @@ QIcon olive::icon::CreateIconFromSVG(const QString &path)
|
|||||||
// Draw the icon as a solid color
|
// Draw the icon as a solid color
|
||||||
QPixmap normal(path);
|
QPixmap normal(path);
|
||||||
|
|
||||||
|
// Color the icon dark if the user is using a dark theme
|
||||||
if (olive::styling::UseDarkIcons()) {
|
if (olive::styling::UseDarkIcons()) {
|
||||||
p.begin(&normal);
|
p.begin(&normal);
|
||||||
p.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
p.setCompositionMode(QPainter::CompositionMode_SourceIn);
|
||||||
@@ -44,18 +45,22 @@ QIcon olive::icon::CreateIconFromSVG(const QString &path)
|
|||||||
|
|
||||||
icon.addPixmap(normal, QIcon::Normal, QIcon::On);
|
icon.addPixmap(normal, QIcon::Normal, QIcon::On);
|
||||||
|
|
||||||
// Create semi-transparent disabled icon
|
if (create_disabled) {
|
||||||
QPixmap disabled(normal.size());
|
|
||||||
disabled.fill(Qt::transparent);
|
|
||||||
|
|
||||||
// draw semi-transparent version of icon for the disabled variant
|
// Create semi-transparent disabled icon
|
||||||
p.begin(&disabled);
|
QPixmap disabled(normal.size());
|
||||||
p.setCompositionMode(QPainter::CompositionMode_SourceOver);
|
disabled.fill(Qt::transparent);
|
||||||
p.setOpacity(0.5);
|
|
||||||
p.drawPixmap(0, 0, normal);
|
|
||||||
p.end();
|
|
||||||
|
|
||||||
icon.addPixmap(disabled, QIcon::Disabled, QIcon::On);
|
// draw semi-transparent version of icon for the disabled variant
|
||||||
|
p.begin(&disabled);
|
||||||
|
p.setCompositionMode(QPainter::CompositionMode_SourceOver);
|
||||||
|
p.setOpacity(0.5);
|
||||||
|
p.drawPixmap(0, 0, normal);
|
||||||
|
p.end();
|
||||||
|
|
||||||
|
icon.addPixmap(disabled, QIcon::Disabled, QIcon::On);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
@@ -64,24 +69,24 @@ void olive::icon::Initialize()
|
|||||||
{
|
{
|
||||||
qInfo() << "Initializing icons";
|
qInfo() << "Initializing icons";
|
||||||
|
|
||||||
LeftArrow = QIcon(":/icons/tri-left.svg");
|
LeftArrow = CreateIconFromSVG(":/icons/tri-left.svg", false);
|
||||||
RightArrow = QIcon(":/icons/tri-right.svg");
|
RightArrow = CreateIconFromSVG(":/icons/tri-right.svg", false);
|
||||||
UpArrow = QIcon(":/icons/tri-up.svg");
|
UpArrow = CreateIconFromSVG(":/icons/tri-up.svg", false);
|
||||||
DownArrow = QIcon(":/icons/tri-down.svg");
|
DownArrow = CreateIconFromSVG(":/icons/tri-down.svg", false);
|
||||||
Diamond = QIcon(":/icons/diamond.svg");
|
Diamond = CreateIconFromSVG(":/icons/diamond.svg", false);
|
||||||
Clock = QIcon(":/icons/clock.svg");
|
Clock = CreateIconFromSVG(":/icons/clock.svg", false);
|
||||||
|
|
||||||
MediaVideo = QIcon(":/icons/videosource.svg");
|
MediaVideo = CreateIconFromSVG(":/icons/videosource.svg", false);
|
||||||
MediaAudio = QIcon(":/icons/audiosource.svg");
|
MediaAudio = CreateIconFromSVG(":/icons/audiosource.svg", false);
|
||||||
MediaImage = QIcon(":/icons/imagesource.svg");
|
MediaImage = CreateIconFromSVG(":/icons/imagesource.svg", false);
|
||||||
MediaError = QIcon(":/icons/error.svg");
|
MediaError = CreateIconFromSVG(":/icons/error.svg", false);
|
||||||
MediaSequence = QIcon(":/icons/sequence.svg");
|
MediaSequence = CreateIconFromSVG(":/icons/sequence.svg", false);
|
||||||
MediaFolder = QIcon(":/icons/folder.svg");
|
MediaFolder = CreateIconFromSVG(":/icons/folder.svg", false);
|
||||||
|
|
||||||
ViewerGoToStart = CreateIconFromSVG(QStringLiteral(":/icons/prev.svg"));
|
ViewerGoToStart = CreateIconFromSVG(QStringLiteral(":/icons/prev.svg"));
|
||||||
ViewerPrevFrame = CreateIconFromSVG(QStringLiteral(":/icons/rew.svg"));
|
ViewerPrevFrame = CreateIconFromSVG(QStringLiteral(":/icons/rew.svg"));
|
||||||
ViewerPlay = CreateIconFromSVG(QStringLiteral(":/icons/play.svg"));
|
ViewerPlay = CreateIconFromSVG(QStringLiteral(":/icons/play.svg"));
|
||||||
ViewerPause = QPixmap(":/icons/pause.svg");
|
ViewerPause = CreateIconFromSVG(":/icons/pause.svg", false);
|
||||||
ViewerNextFrame = CreateIconFromSVG(QStringLiteral(":/icons/ff.svg"));
|
ViewerNextFrame = CreateIconFromSVG(QStringLiteral(":/icons/ff.svg"));
|
||||||
ViewerGoToEnd = CreateIconFromSVG(QStringLiteral(":/icons/next.svg"));
|
ViewerGoToEnd = CreateIconFromSVG(QStringLiteral(":/icons/next.svg"));
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -34,8 +34,12 @@ namespace olive {
|
|||||||
* @param path
|
* @param path
|
||||||
*
|
*
|
||||||
* Path to SVG file
|
* Path to SVG file
|
||||||
|
*
|
||||||
|
* @param create_disabled
|
||||||
|
*
|
||||||
|
* Create a semi-transparent disabled option.
|
||||||
*/
|
*/
|
||||||
QIcon CreateIconFromSVG(const QString &path);
|
QIcon CreateIconFromSVG(const QString &path, bool create_disabled = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user