SCXMLEditor: Apply theming for rest of the elements

Fixes: QTCREATORBUG-29701
Change-Id: Icefc9f2b5145751c422e7519d8e60c438c4965f1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Artem Sokolovskii
2024-09-18 13:55:40 +02:00
parent 13a7d00be7
commit 2eb54a0778
4 changed files with 15 additions and 6 deletions

View File

@@ -138,6 +138,8 @@ ColorThemeItem *ColorThemeView::createItem(int index, const QColor &color)
const QVector<QColor> &ColorThemeView::defaultColors()
{
// Left with hardcoded values for now
// Can be deleted in the future
static const QVector<QColor> colors = {
QColor(0xe0, 0xe0, 0xe0),
QColor(0xd3, 0xe4, 0xc3),

View File

@@ -6,6 +6,7 @@
#include "graphicsview.h"
#include <QMouseEvent>
#include <QPalette>
#include <QVBoxLayout>
using namespace ScxmlEditor::Common;
@@ -36,8 +37,12 @@ void Magnifier::resizeEvent(QResizeEvent *e)
m_gradientBrush.setCenter(radius, radius);
m_gradientBrush.setFocalPoint(radius, radius);
m_gradientBrush.setRadius(radius);
m_gradientBrush.setColorAt(1.0, QColor(255, 255, 255, 0));
m_gradientBrush.setColorAt(0.0, QColor(0, 0, 0, 255));
QColor first = parentWidget()->palette().color(QPalette::Window);
first.setAlpha(0);
QColor last = parentWidget()->palette().color(QPalette::WindowText);
last.setAlpha(255);
m_gradientBrush.setColorAt(1.0, first);
m_gradientBrush.setColorAt(0.0, last);
int cap = radius * 0.1;
m_graphicsView->setMask(QRegion(rect().adjusted(cap, cap, -cap, -cap), QRegion::Ellipse));

View File

@@ -45,6 +45,7 @@
#include <QMessageBox>
#include <QMimeData>
#include <QPainter>
#include <QPalette>
#include <QProgressBar>
#include <QProgressDialog>
#include <QStackedWidget>
@@ -427,7 +428,7 @@ void MainWidget::exportToImage()
if (!filePath.isEmpty()) {
const QRectF r = view->scene()->itemsBoundingRect();
QImage image(r.size().toSize(), QImage::Format_ARGB32);
image.fill(QColor(0xef, 0xef, 0xef));
image.fill(palette().color(QPalette::Window));
QPainter painter(&image);
view->scene()->render(&painter, QRectF(), r);

View File

@@ -19,6 +19,7 @@
#include <coreplugin/icore.h>
#include <utils/fileutils.h>
#include <utils/theme/theme.h>
#include <utils/utilsicons.h>
using namespace ScxmlEditor::OutputPane;
@@ -160,11 +161,11 @@ void ErrorWidget::updateWarnings()
QColor ErrorWidget::alertColor() const
{
if (m_warningModel->count(Warning::ErrorType) > 0)
return QColor(0xff, 0x77, 0x77);
return Utils::creatorColor(Utils::Theme::Token_Notification_Danger);
else if (m_warningModel->count(Warning::WarningType))
return QColor(0xfd, 0x88, 0x21);
return Utils::creatorColor(Utils::Theme::Token_Notification_Alert);
else
return QColor(0x29, 0xb6, 0xff);
return Utils::creatorColor(Utils::Theme::Token_Notification_Neutral);
}
void ErrorWidget::warningCountChanged(int c)