From df32b881c206b17bac9543b7080b2915e0210f00 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 14 Jul 2019 11:28:19 -0400 Subject: [PATCH] reworked css --- .../icons/{genicons.sh => generate-icons.sh} | 2 + app/ui/icons/svg/bold.svg | 3 - app/ui/icons/svg/convert-dark.sh | 8 +++ app/ui/style/css/olive-dark.css | 59 +++++-------------- app/ui/style/css/olive-light.css | 57 ++++-------------- app/ui/style/css/olive-mid.css | 57 ++++-------------- app/ui/style/style.cpp | 2 +- app/widget/nodeview/nodeview.h | 1 + app/widget/panel/panel.cpp | 17 +++++- app/widget/panel/panel.h | 7 +++ 10 files changed, 75 insertions(+), 138 deletions(-) rename app/ui/icons/{genicons.sh => generate-icons.sh} (99%) delete mode 100644 app/ui/icons/svg/bold.svg create mode 100644 app/ui/icons/svg/convert-dark.sh diff --git a/app/ui/icons/genicons.sh b/app/ui/icons/generate-icons.sh similarity index 99% rename from app/ui/icons/genicons.sh rename to app/ui/icons/generate-icons.sh index 66b6008e9..ca4272695 100755 --- a/app/ui/icons/genicons.sh +++ b/app/ui/icons/generate-icons.sh @@ -1,3 +1,5 @@ +#!/bin/sh + # Olive - Non-Linear Video Editor # Copyright (C) 2019 Olive Team # diff --git a/app/ui/icons/svg/bold.svg b/app/ui/icons/svg/bold.svg deleted file mode 100644 index a8643a00c..000000000 --- a/app/ui/icons/svg/bold.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/app/ui/icons/svg/convert-dark.sh b/app/ui/icons/svg/convert-dark.sh new file mode 100644 index 000000000..f298944a1 --- /dev/null +++ b/app/ui/icons/svg/convert-dark.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +for f in *.svg +do + FNBASE=$(basename -s .svg $f) + + sed -e "s/#ffffff/#000000/" $f > $FNBASE-dark.svg +done \ No newline at end of file diff --git a/app/ui/style/css/olive-dark.css b/app/ui/style/css/olive-dark.css index 77c95c4d1..c8b27d35c 100644 --- a/app/ui/style/css/olive-dark.css +++ b/app/ui/style/css/olive-dark.css @@ -36,64 +36,33 @@ **/ /* Default widget colors */ -QWidget { +QWidget, QMenu::separator { background: #353535; color: #ffffff; } -/* Default highlight colors */ -QWidget::selected { - background: #2a82da; - color: #ffffff; -} - /* Default disabled colors */ QWidget::disabled { color: #808080; } +/* Default highlight colors */ +QWidget::selected { + background: #2a82da; + color: #ffffff; +} + /* Default link color */ a { color: #2a82da; } -/* Item views use a darker background color */ -QAbstractItemView { +/* PanelWidget focus border color */ +PanelWidget { + qproperty-border: #2a82da; +} + +/* All of these widgets' backgrounds are dark */ +QTreeView, QListView, QLineEdit, QMenu, QProgressBar, QPushButton::checked, NodeView { background: #191919; } - -/* Other children of QAbstractItemView (e.g. headers) should use the original background however */ -QAbstractItemView * { - background: #353535; -} - -/* QLineEdit background is dark */ -QLineEdit { - background: #191919; -} - -/* QMenu background is dark */ -QMenu { - background: #191919; -} - -/* QProgressBar background is dark */ -QProgressBar { - background: #191919; -} - -/* Ensure QPushButtons look dark when checked */ -QPushButton::checked { - background: #191919; -} - -/* Ensure QMenu separators stand out */ -QMenu::separator { - background: #353535; -} - -/* ToolTips use dark */ -QToolTip { - background: #191919;; - color: #ffffff; -} diff --git a/app/ui/style/css/olive-light.css b/app/ui/style/css/olive-light.css index 711f075e2..30762cedc 100644 --- a/app/ui/style/css/olive-light.css +++ b/app/ui/style/css/olive-light.css @@ -36,64 +36,33 @@ **/ /* Default widget colors */ -QWidget { +QWidget, QMenu::separator { background: #d0d0d0; color: #000000; } +/* Default disabled colors */ +QWidget::disabled { + color: #808080; +} + /* Default highlight colors */ QWidget::selected { background: #2a82da; color: #ffffff; } -/* Default disabled colors */ -QWidget::disabled { - color: #808080; -} - /* Default link color */ a { color: #2a82da; } -/* Item views use a darker background color */ -QAbstractItemView { +/* PanelWidget focus border color */ +PanelWidget { + qproperty-border: #2a82da; +} + +/* All of these widgets' backgrounds are dark */ +QTreeView, QListView, QLineEdit, QMenu, QProgressBar, QPushButton::checked, NodeView { background: #f0f0f0; } - -/* Other children of QAbstractItemView (e.g. headers) should use the original background however */ -QAbstractItemView * { - background: #d0d0d0; -} - -/* QLineEdit background is dark */ -QLineEdit { - background: #f0f0f0; -} - -/* QMenu background is dark */ -QMenu { - background: #f0f0f0; -} - -/* QProgressBar background is dark */ -QProgressBar { - background: #f0f0f0; -} - -/* Ensure QPushButtons look dark when checked */ -QPushButton::checked { - background: #f0f0f0; -} - -/* Ensure QMenu separators stand out */ -QMenu::separator { - background: #d0d0d0; -} - -/* ToolTips use dark */ -QToolTip { - background: #f0f0f0;; - color: #000000; -} diff --git a/app/ui/style/css/olive-mid.css b/app/ui/style/css/olive-mid.css index 7829ec9e0..91e149c0c 100644 --- a/app/ui/style/css/olive-mid.css +++ b/app/ui/style/css/olive-mid.css @@ -36,64 +36,33 @@ **/ /* Default widget colors */ -QWidget { +QWidget, QMenu::separator { background: #808080; color: #000000; } +/* Default disabled colors */ +QWidget::disabled { + color: #808080; +} + /* Default highlight colors */ QWidget::selected { background: #2a82da; color: #ffffff; } -/* Default disabled colors */ -QWidget::disabled { - color: #808080; -} - /* Default link color */ a { color: #2a82da; } -/* Item views use a darker background color */ -QAbstractItemView { +/* PanelWidget focus border color */ +PanelWidget { + qproperty-border: #2a82da; +} + +/* All of these widgets' backgrounds are dark */ +QTreeView, QListView, QLineEdit, QMenu, QProgressBar, QPushButton::checked, NodeView { background: #c0c0c0; } - -/* Other children of QAbstractItemView (e.g. headers) should use the original background however */ -QAbstractItemView * { - background: #808080; -} - -/* QLineEdit background is dark */ -QLineEdit { - background: #c0c0c0; -} - -/* QMenu background is dark */ -QMenu { - background: #c0c0c0; -} - -/* QProgressBar background is dark */ -QProgressBar { - background: #c0c0c0; -} - -/* Ensure QPushButtons look dark when checked */ -QPushButton::checked { - background: #c0c0c0; -} - -/* Ensure QMenu separators stand out */ -QMenu::separator { - background: #808080; -} - -/* ToolTips use dark */ -QToolTip { - background: #c0c0c0;; - color: #000000; -} diff --git a/app/ui/style/style.cpp b/app/ui/style/style.cpp index 555e874aa..46fa5460c 100644 --- a/app/ui/style/style.cpp +++ b/app/ui/style/style.cpp @@ -33,7 +33,7 @@ void olive::style::AppSetDefault() qApp->setStyle(QStyleFactory::create("Fusion")); // Set CSS style for this - QFile css_file(":/css/olive-dark.css"); + QFile css_file(":/css/olive-light.css"); if (css_file.open(QFile::ReadOnly | QFile::Text)) { // Read in entire CSS from file and set as the application stylesheet diff --git a/app/widget/nodeview/nodeview.h b/app/widget/nodeview/nodeview.h index 1dfaf0367..aa5f19098 100644 --- a/app/widget/nodeview/nodeview.h +++ b/app/widget/nodeview/nodeview.h @@ -27,6 +27,7 @@ class NodeView : public QGraphicsView { + Q_OBJECT public: NodeView(QWidget* parent); diff --git a/app/widget/panel/panel.cpp b/app/widget/panel/panel.cpp index 7fd84de82..61972ad68 100644 --- a/app/widget/panel/panel.cpp +++ b/app/widget/panel/panel.cpp @@ -21,6 +21,9 @@ #include "panel.h" #include +#include +#include +#include PanelWidget::PanelWidget(QWidget *parent) : QDockWidget(parent), @@ -32,6 +35,7 @@ PanelWidget::PanelWidget(QWidget *parent) : void PanelWidget::SetBorderVisible(bool enabled) { border_visible_ = enabled; + update(); } @@ -63,7 +67,8 @@ void PanelWidget::paintEvent(QPaintEvent *event) highlight_border.adjust(0, 0, -1, -1); // Set the color to the palette's highlight color - p.setPen(QPen(palette().highlight().color())); + + p.setPen(QPen(border_color_)); // Draw the highlight border p.drawRect(highlight_border); @@ -80,3 +85,13 @@ void PanelWidget::UpdateTitle() setWindowTitle(tr("%1: %2").arg(title_, subtitle_)); } } + +QColor PanelWidget::GetBorderColor() +{ + return border_color_; +} + +void PanelWidget::SetBorderColor(QColor c) +{ + border_color_ = c; +} diff --git a/app/widget/panel/panel.h b/app/widget/panel/panel.h index 912559f54..30130a04b 100644 --- a/app/widget/panel/panel.h +++ b/app/widget/panel/panel.h @@ -29,6 +29,7 @@ */ class PanelWidget : public QDockWidget { Q_OBJECT + Q_PROPERTY(QColor border READ GetBorderColor WRITE SetBorderColor DESIGNABLE true) public: /** * @brief PanelWidget Constructor @@ -88,6 +89,12 @@ private: */ void UpdateTitle(); + QColor GetBorderColor(); + + void SetBorderColor(QColor c); + + QColor border_color_; + /** * @brief Internal title string */