Merge remote-tracking branch 'origin/4.15'

Change-Id: If0dbebdf37b0ffea2528bf6ce6d34d88554f8dfb
This commit is contained in:
Eike Ziller
2021-03-16 10:55:54 +01:00
155 changed files with 5552 additions and 3288 deletions

View File

@@ -600,7 +600,7 @@ void AndroidSettingsWidget::onSdkPathChanged()
FilePath currentOpenSslPath = m_androidConfig.openSslLocation();
if (currentOpenSslPath.isEmpty() || !currentOpenSslPath.exists())
currentOpenSslPath = sdkPath.pathAppended("android_openssl");
m_ui.openSslPathChooser->setFileName(currentOpenSslPath);
m_ui.openSslPathChooser->setFilePath(currentOpenSslPath);
// Package reload will trigger validateSdk.
m_sdkManager.reloadPackages();
}

View File

@@ -1730,9 +1730,8 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
if (editor == viewCurrentEditor && view == views.last()) {
// Avoid removing the globally current editor from its view,
// set a new current editor before.
const EditorManager::OpenEditorFlags flags = view != currentView
? EditorManager::DoNotChangeCurrentEditor
: EditorManager::NoFlags;
EditorManager::OpenEditorFlags flags = view != currentView
? EditorManager::DoNotChangeCurrentEditor : EditorManager::NoFlags;
const QList<IEditor *> viewEditors = view->editors();
IEditor *newCurrent = viewEditors.size() > 1 ? viewEditors.at(viewEditors.size() - 2)
: nullptr;
@@ -1748,6 +1747,10 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
const QList<DocumentModel::Entry *> documents = DocumentModel::entries();
if (!documents.isEmpty()) {
if (IDocument *document = documents.last()->document) {
// Do not auto-switch to design mode if the new editor will be for
// the same document as the one that was closed.
if (view == currentView && document == editor->document())
flags = EditorManager::DoNotSwitchToDesignMode;
activateEditorForDocument(view, document, flags);
}
}

View File

@@ -128,6 +128,7 @@ void OpenDocumentsTreeView::setModel(QAbstractItemModel *model)
header()->setStretchLastSection(false);
header()->setSectionResizeMode(0, QHeaderView::Stretch);
header()->setSectionResizeMode(1, QHeaderView::Fixed);
header()->setMinimumSectionSize(0);
header()->resizeSection(1, 16);
}

View File

@@ -86,7 +86,6 @@ void CppLocatorData::onAboutToRemoveFiles(const QStringList &files)
void CppLocatorData::flushPendingDocument(bool force) const
{
// TODO: move this off the UI thread and into a future.
QMutexLocker locker(&m_pendingDocumentsMutex);
if (!force && m_pendingDocuments.size() < MaxPendingDocuments)
return;
if (m_pendingDocuments.isEmpty())
@@ -98,12 +97,3 @@ void CppLocatorData::flushPendingDocument(bool force) const
m_pendingDocuments.clear();
m_pendingDocuments.reserve(MaxPendingDocuments);
}
QList<IndexItem::Ptr> CppLocatorData::allIndexItems(
const QHash<QString, QList<IndexItem::Ptr>> &items) const
{
QList<IndexItem::Ptr> result;
for (const QList<IndexItem::Ptr> &subItems : items)
result.append(subItems);
return result;
}

View File

@@ -46,8 +46,8 @@ class CppLocatorData : public QObject
public:
void filterAllFiles(IndexItem::Visitor func) const
{
flushPendingDocument(true);
QMutexLocker locker(&m_pendingDocumentsMutex);
flushPendingDocument(true);
QHash<QString, IndexItem::Ptr> infosByFile = m_infosByFile;
locker.unlock();
for (auto i = infosByFile.constBegin(), ei = infosByFile.constEnd(); i != ei; ++i)
@@ -60,13 +60,13 @@ public slots:
void onAboutToRemoveFiles(const QStringList &files);
private:
// Ensure to protect every call to this method with m_pendingDocumentsMutex
void flushPendingDocument(bool force) const;
QList<IndexItem::Ptr> allIndexItems(const QHash<QString, QList<IndexItem::Ptr>> &items) const;
mutable SearchSymbols m_search;
mutable QHash<QString, IndexItem::Ptr> m_infosByFile;
mutable QRecursiveMutex m_pendingDocumentsMutex;
mutable QMutex m_pendingDocumentsMutex;
mutable QVector<CPlusPlus::Document::Ptr> m_pendingDocuments;
};

View File

@@ -64,7 +64,7 @@ CvsSettingsPageWidget::CvsSettingsPageWidget(const std::function<void()> &onAppl
m_ui.commandPathChooser->setPromptDialogTitle(tr("CVS Command"));
const VcsBaseClientSettings &s = *settings;
m_ui.commandPathChooser->setFileName(s.binaryPath());
m_ui.commandPathChooser->setFilePath(s.binaryPath());
m_ui.rootLineEdit->setText(s.stringValue(CvsSettings::cvsRootKey));
m_ui.diffOptionsLineEdit->setText(s.stringValue(CvsSettings::diffOptionsKey));
m_ui.timeOutSpinBox->setValue(s.intValue(CvsSettings::timeoutKey));

View File

@@ -919,6 +919,11 @@ QString DebuggerEngine::stateName(int s)
# undef SN
}
void DebuggerEngine::notifyExitCode(int code)
{
d->m_runParameters.exitCode = code;
}
void DebuggerEngine::showStatusMessage(const QString &msg, int timeout) const
{
showMessage(msg, StatusBar, timeout);

View File

@@ -197,6 +197,8 @@ public:
Utils::MacroExpander *macroExpander = nullptr;
Utils::optional<int> exitCode = {};
// For Debugger testing.
int testCase = 0;
@@ -381,6 +383,7 @@ public:
static QString stateName(int s);
void notifyExitCode(int code);
void notifyInferiorPid(const Utils::ProcessHandle &pid);
qint64 inferiorPid() const;

View File

@@ -739,7 +739,8 @@ void DebuggerRunTool::start()
}
}
appendMessage(tr("Debugging starts"), NormalMessageFormat);
appendMessage(tr("Debugging %1 ...").arg(m_runParameters.inferior.commandLine().toUserOutput()),
NormalMessageFormat);
QString debuggerName = m_engine->objectName();
if (m_engine2)
debuggerName += ' ' + m_engine2->objectName();
@@ -783,7 +784,12 @@ void DebuggerRunTool::handleEngineFinished(DebuggerEngine *engine)
{
engine->prepareForRestart();
if (--d->engineStopsNeeded == 0) {
appendMessage(tr("Debugging has finished"), NormalMessageFormat);
QString cmd = m_runParameters.inferior.commandLine().toUserOutput();
QString msg = engine->runParameters().exitCode // Main engine.
? tr("Debugging of %1 has finished with exit code %2.")
.arg(cmd).arg(engine->runParameters().exitCode.value())
: tr("Debugging of %1 has finished.").arg(cmd);
appendMessage(msg, NormalMessageFormat);
reportStopped();
}
}

View File

@@ -1134,8 +1134,9 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
// qDebug() << state());
QString msg;
if (reason == "exited") {
msg = tr("Application exited with exit code %1")
.arg(data["exit-code"].toString());
const int exitCode = data["exit-code"].toInt();
notifyExitCode(exitCode);
msg = tr("Application exited with exit code %1").arg(exitCode);
} else if (reason == "exited-signalled" || reason == "signal-received") {
msg = tr("Application exited after receiving signal %1")
.arg(data["signal-name"].toString());
@@ -1712,6 +1713,8 @@ void GdbEngine::handleThreadGroupExited(const GdbMi &result)
{
QString groupId = result["id"].data();
if (threadsHandler()->notifyGroupExited(groupId)) {
const int exitCode = result["exit-code"].toInt();
notifyExitCode(exitCode);
if (m_rerunPending)
m_rerunPending = false;
else

View File

@@ -1,5 +1,4 @@
add_qtc_plugin(FakeVim
CONDITION Qt5_VERSION VERSION_LESS 6.0.0
PLUGIN_DEPENDS Core TextEditor
PLUGIN_TEST_DEPENDS CppEditor CppTools
SOURCES ${TEST_SOURCES}

View File

@@ -1285,6 +1285,11 @@ public:
<< quoteUnprintable(m_text);
}
friend uint qHash(const Input &i)
{
return ::qHash(i.m_key);
}
private:
int m_key = 0;
int m_xkey = 0;
@@ -1630,7 +1635,7 @@ private:
};
// Mappings for a specific mode (trie structure)
class ModeMapping : public QMap<Input, ModeMapping>
class ModeMapping : public QHash<Input, ModeMapping>
{
public:
const Inputs &value() const { return m_value; }

View File

@@ -687,13 +687,18 @@ void targetsAndPackages(const Utils::FilePath &dir, QVector<McuPackage *> *packa
});
if (!hasDesktopDescription) {
Utils::FilePath desktopLib;
if (Utils::HostOsInfo::isWindowsHost())
desktopLib = dir / "lib/QulQuickUltralite_QT_32bpp_Windows_Release.lib";
else
desktopLib = dir / "lib/libQulQuickUltralite_QT_32bpp_Linux_Debug.a";
QVector<Utils::FilePath> desktopLibs;
if (Utils::HostOsInfo::isWindowsHost()) {
desktopLibs << dir / "lib/QulQuickUltralite_QT_32bpp_Windows_Release.lib"; // older versions of QUL (<1.5?)
desktopLibs << dir / "lib/QulQuickUltralitePlatform_QT_32bpp_Windows_msvc_Release.lib"; // newer versions of QUL
} else {
desktopLibs << dir / "lib/libQulQuickUltralite_QT_32bpp_Linux_Debug.a"; // older versions of QUL (<1.5?)
desktopLibs << dir / "lib/libQulQuickUltralitePlatform_QT_32bpp_Linux_gnu_Debug.a"; // newer versions of QUL
}
if (desktopLib.exists()) {
if (Utils::anyOf(desktopLibs, [](const Utils::FilePath &desktopLib) {
return desktopLib.exists(); })
) {
McuTargetDescription desktopDescription;
desktopDescription.qulVersion = descriptions.empty() ?
McuSupportOptions::minimalQulVersion().toString()
@@ -707,8 +712,10 @@ void targetsAndPackages(const Utils::FilePath &dir, QVector<McuPackage *> *packa
descriptions.prepend(desktopDescription);
} else {
if (dir.exists())
printMessage(McuTarget::tr("Skipped creating fallback desktop kit: Could not find %1.")
.arg(QDir::toNativeSeparators(desktopLib.fileNameWithPathComponents(1))),
printMessage(McuTarget::tr("Skipped creating fallback desktop kit: Could not find any of %1.")
.arg(Utils::transform(desktopLibs, [](const auto &path) {
return QDir::toNativeSeparators(path.fileNameWithPathComponents(1));
}).toList().join(" or ")),
false);
}
}

View File

@@ -57,7 +57,7 @@ void ToolItemSettings::load(ToolTreeItem *item)
ui->mesonNameLineEdit->setDisabled(item->isAutoDetected());
ui->mesonNameLineEdit->setText(item->name());
ui->mesonPathChooser->setDisabled(item->isAutoDetected());
ui->mesonPathChooser->setFileName(item->executable());
ui->mesonPathChooser->setFilePath(item->executable());
m_currentId = item->id();
} else {
m_currentId = Utils::nullopt;

View File

@@ -80,7 +80,7 @@ AssetExportDialog::AssetExportDialog(const Utils::FilePath &exportPath,
{
m_ui->setupUi(this);
m_ui->exportPath->setFileName(exportPath);
m_ui->exportPath->setFilePath(exportPath);
m_ui->exportPath->setPromptDialogTitle(tr("Choose Export Path"));
m_ui->exportPath->lineEdit()->setReadOnly(true);
m_ui->exportPath->addButton(tr("Open"), this, [this]() {
@@ -153,7 +153,7 @@ void AssetExportDialog::onExport()
TaskHub::clearTasks(Constants::TASK_CATEGORY_ASSET_EXPORT);
m_exportLogs->clear();
m_assetExporter.exportQml(m_filePathModel.files(), m_ui->exportPath->fileName(),
m_assetExporter.exportQml(m_filePathModel.files(), m_ui->exportPath->filePath(),
m_exportAssetsCheck->isChecked(),
m_perComponentExportCheck->isChecked());
}

View File

@@ -76,7 +76,7 @@ QColor Theme::evaluateColorAtThemeInstance(const QString &themeColorName)
const QMetaEnum e = m.enumerator(m.indexOfEnumerator("Color"));
for (int i = 0, total = e.keyCount(); i < total; ++i) {
if (QString::fromLatin1(e.key(i)) == themeColorName)
return color(static_cast<Utils::Theme::Color>(i)).name();
return color(static_cast<Utils::Theme::Color>(i));
}
qWarning() << Q_FUNC_INFO << "error while evaluating" << themeColorName;
@@ -101,14 +101,21 @@ QString Theme::replaceCssColors(const QString &input)
while (it.hasNext()) {
const QRegularExpressionMatch match = it.next();
const QString themeColorName = match.captured(1);
const QRegularExpression replaceExp("creatorTheme\\." + themeColorName + "(\\s|;|\\n)");
if (themeColorName == "smallFontPixelSize") {
output.replace("creatorTheme." + themeColorName, QString::number(instance()->smallFontPixelSize()) + "px");
output.replace(replaceExp,
QString::number(instance()->smallFontPixelSize()) + "px" + "\\1");
} else if (themeColorName == "captionFontPixelSize") {
output.replace("creatorTheme." + themeColorName, QString::number(instance()->captionFontPixelSize()) + "px");
output.replace(replaceExp,
QString::number(instance()->captionFontPixelSize()) + "px" + "\\1");
} else {
const QColor color = instance()->evaluateColorAtThemeInstance(themeColorName);
output.replace("creatorTheme." + themeColorName, color.name());
// Create rgba(r, g, b, a)
const QString rgbaStr = QString("rgba(%1, %2, %3, %4)")
.arg(color.red()).arg(color.green()).arg(color.blue())
.arg(color.alpha());
output.replace(replaceExp, rgbaStr + "\\1");
}
pos += match.capturedLength();
}

View File

@@ -18,7 +18,7 @@
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
@@ -43,13 +43,13 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>4</height>
<height>2</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>4</height>
<height>2</height>
</size>
</property>
</widget>
@@ -244,7 +244,7 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QToolBar" name="toolBar" native="true"/>
<widget class="QToolBar" name="toolBar"/>
</item>
</layout>
<zorder>stackedWidget</zorder>

View File

@@ -1,71 +1,64 @@
QFrame
{
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
color: creatorTheme.PanelTextColorLight;
QFrame {
background-color: creatorTheme.DSpanelBackground;
color: creatorTheme.DStextColor;
font-size: creatorTheme.captionFontPixelSize;
border-radius: 0px;
}
QTableView {
color: creatorTheme.PanelTextColorLight;
selection-color: creatorTheme.PanelTextColorLight;
selection-background-color: creatorTheme.QmlDesigner_HighlightColor;
color: creatorTheme.DStextColor;
selection-color: creatorTheme.DStextSelectedTextColor;
selection-background-color: creatorTheme.DStextSelectionColor;
}
QTabBar QToolButton {
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
background-color: creatorTheme.DSpanelBackground;
border: 1px solid creatorTheme.QmlDesigner_BackgroundColorDarker;
border-radius: 0px;
}
QTableView::item
{
QTableView::item {
border: 0px;
padding-left: 4px;
}
QTableView::item:focus
{
QTableView::item:focus {
border: none;
background-color: transparent;
}
QTableView::item:selected
{
QTableView::item:selected {
border: none
}
QHeaderView::section {
background-color: #494949;
background-color: creatorTheme.DSheaderViewBackground;
border: 0px;
color: creatorTheme.DStextColor;
margin-right: 1px
}
QTableView {
alternate-background-color: #414141;
alternate-background-color: creatorTheme.DStableViewAlternateBackground;
}
QWidget#widgetSpacer {
background-color: creatorTheme.QmlDesigner_TabLight;
background-color: creatorTheme.DStabActiveBackground;
}
QStackedWidget {
border: 0px;
background-color: creatorTheme.QmlDesigner_TabLight;
background-color: creatorTheme.DStabActiveBackground;
}
QTabBar::tab:selected {
border: none;
border-image: none;
image: none;
background-color: creatorTheme.QmlDesigner_TabLight;
color: creatorTheme.QmlDesigner_TabDark;
background-color: creatorTheme.DStabActiveBackground;
color: creatorTheme.DStabActiveText;
}
QTabBar::tab {
width: 92px;
height: 22px;
@@ -75,48 +68,62 @@ QTabBar::tab {
margin-right: 0px;
font: bold;
font-size: creatorTheme.captionFontPixelSize;
background-color: creatorTheme.QmlDesigner_TabDark;
color: creatorTheme.QmlDesigner_TabLight;
background-color: creatorTheme.DStabInactiveBackground;
color: creatorTheme.DStabInactiveText;
}
QSpinBox
{
/*
QSpinBox {
font-size: creatorTheme.captionFontPixelSize;
color: white;
color: creatorTheme.DStextColor;
padding-right: 2px;
padding-top: 2px;
padding-bottom: 2px;
padding-left: 12px;
border: 2px solid #0F0F0F;
border-width: 1;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #2c2c2c, stop: 1 #333333);
min-height: 22px;
}
QDoubleSpinBox
{
font-size: creatorTheme.captionFontPixelSize;
color: white;
padding-right: 2px;
padding-top: 2px;
padding-bottom: 2px;
padding-left: 12px;
border: 2px solid #0F0F0F;
border-width: 1;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #2c2c2c, stop: 1 #333333);
border: 1px solid creatorTheme.DScontrolOutline;
background-color: creatorTheme.DScontrolBackground;
min-height: 22px;
}
QLineEdit
{
color: white;
font-size: creatorTheme.captionFontPixelSize;
border: 2px solid #0F0F0F;
border-width: 1;
min-height: 26px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #2c2c2c, stop: 1 #333333);
}
QDoubleSpinBox {
font-size: creatorTheme.captionFontPixelSize;
color: creatorTheme.DStextColor;
padding-right: 2px;
padding-top: 2px;
padding-bottom: 2px;
padding-left: 12px;
border: 1px solid creatorTheme.DScontrolOutline;
background-color: creatorTheme.DScontrolBackground;
min-height: 22px;
}
*/
QLineEdit {
color: creatorTheme.DStextColor;
selection-color: creatorTheme.DStextSelectedTextColor;
selection-background-color: creatorTheme.DStextSelectionColor;
font-size: creatorTheme.captionFontPixelSize;
border: 1px solid creatorTheme.DScontrolOutline;
min-height: 26px;
background-color: creatorTheme.DScontrolBackground;
}
QComboBox {
color: creatorTheme.DStextColor;
selection-color: creatorTheme.DStextSelectedTextColor;
selection-background-color: creatorTheme.DStextSelectionColor;
font-size: creatorTheme.captionFontPixelSize;
border: 1px solid creatorTheme.DScontrolOutline;
min-height: 26px;
background-color: creatorTheme.DScontrolBackground;
}
QComboBox QAbstractItemView {
show-decoration-selected: 1; /* make the selection span the entire width of the view */
background-color: creatorTheme.DSpopupBackground; /* sets background of the menu */
border: 1px solid creatorTheme.DScontrolOutline;
margin: 0px; /* some spacing around the menu */
color: creatorTheme.DStextColor;
selection-color: creatorTheme.DStextSelectedTextColor;
selection-background-color: creatorTheme.DSinteraction;
}

View File

@@ -73,7 +73,7 @@ CurveEditorStyle CurveEditorModel::style() const
out.timeAxisHeight = 60;
out.timeOffsetLeft = 10;
out.timeOffsetRight = 10;
out.rangeBarColor = QmlDesigner::Theme::instance()->qmlDesignerBackgroundColorDarkAlternate();
out.rangeBarColor = QmlDesigner::Theme::getColor(Theme::DScontrolBackground);
out.rangeBarCapsColor = QmlDesigner::Theme::getColor(
QmlDesigner::Theme::QmlDesigner_HighlightColor);
out.valueAxisWidth = 60;

View File

@@ -41,6 +41,9 @@ QString ItemLibraryImport::importName() const
if (m_sectionType == SectionType::User)
return userComponentsTitle();
if (m_sectionType == SectionType::Quick3DAssets)
return quick3DAssetsTitle();
if (m_sectionType == SectionType::Unimported)
return unimportedComponentsTitle();
@@ -55,6 +58,9 @@ QString ItemLibraryImport::importUrl() const
if (m_sectionType == SectionType::User)
return userComponentsTitle();
if (m_sectionType == SectionType::Quick3DAssets)
return quick3DAssetsTitle();
if (m_sectionType == SectionType::Unimported)
return unimportedComponentsTitle();
@@ -71,10 +77,13 @@ QString ItemLibraryImport::sortingName() const
if (m_sectionType == SectionType::User)
return "_"; // user components always come first
if (m_sectionType == SectionType::Unimported)
return "zzzzzz"; // Unimported components always come last
if (m_sectionType == SectionType::Quick3DAssets)
return "__"; // Quick3DAssets come second
if (!hasCategories()) // imports with no categories are at the bottom of the list
if (m_sectionType == SectionType::Unimported)
return "zzzzzz"; // Unimported components come last
if (!hasCategories()) // imports with no categories come before last
return "zzzzz_" + importName();
return importName();
@@ -188,6 +197,13 @@ QString ItemLibraryImport::userComponentsTitle()
return tr("My Components");
}
// static
QString ItemLibraryImport::quick3DAssetsTitle()
{
return tr("My 3D Components");
}
// static
QString ItemLibraryImport::unimportedComponentsTitle()
{
return tr("All Other Components");

View File

@@ -42,12 +42,14 @@ class ItemLibraryImport : public QObject
Q_PROPERTY(bool importUsed READ importUsed NOTIFY importUsedChanged FINAL)
Q_PROPERTY(bool importExpanded READ importExpanded WRITE setImportExpanded NOTIFY importExpandChanged FINAL)
Q_PROPERTY(bool importRemovable READ importRemovable NOTIFY importRemovableChanged FINAL)
Q_PROPERTY(bool importUnimported READ importUnimported FINAL)
Q_PROPERTY(QObject *categoryModel READ categoryModel NOTIFY categoryModelChanged FINAL)
public:
enum class SectionType {
Default,
User,
Quick3DAssets,
Unimported
};
@@ -75,6 +77,7 @@ public:
void expandCategories(bool expand = true);
static QString userComponentsTitle();
static QString quick3DAssetsTitle();
static QString unimportedComponentsTitle();
SectionType sectionType() const;
@@ -88,6 +91,7 @@ signals:
private:
void updateRemovable();
bool importUnimported() const { return m_sectionType == SectionType::Unimported; }
Import m_import;
bool m_importExpanded = true;

View File

@@ -216,24 +216,32 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
for (const Import &import : model->imports()) {
if (import.isLibraryImport() && import.url() != projectName) {
bool addNew = true;
ItemLibraryImport *oldImport = importHash.value(import.url());
if (oldImport && oldImport->importEntry().url() == import.url()) {
bool isQuick3DAsset = import.url().startsWith("Quick3DAssets.");
QString importUrl = isQuick3DAsset ? ItemLibraryImport::quick3DAssetsTitle() : import.url();
ItemLibraryImport *oldImport = importHash.value(importUrl);
if (oldImport && oldImport->sectionType() == ItemLibraryImport::SectionType::Quick3DAssets
&& isQuick3DAsset) {
addNew = false; // add only 1 Quick3DAssets import section
} else if (oldImport && oldImport->importEntry().url() == import.url()) {
// Retain the higher version if multiples exist
if (compareVersions(oldImport->importEntry().version(), import.version()))
addNew = false;
else
delete oldImport;
}
if (addNew) {
ItemLibraryImport *itemLibImport = new ItemLibraryImport(import, this);
importHash.insert(import.url(), itemLibImport);
auto sectionType = isQuick3DAsset ? ItemLibraryImport::SectionType::Quick3DAssets
: ItemLibraryImport::SectionType::Default;
ItemLibraryImport *itemLibImport = new ItemLibraryImport(import, this, sectionType);
importHash.insert(importUrl, itemLibImport);
}
}
}
for (const auto itemLibImport : qAsConst(importHash)) {
m_importList.append(itemLibImport);
itemLibImport->setImportExpanded(loadExpandedState(itemLibImport->importEntry().url()));
itemLibImport->setImportExpanded(loadExpandedState(itemLibImport->importUrl()));
}
const QList<ItemLibraryEntry> itemLibEntries = itemLibraryInfo->entries();
@@ -280,6 +288,8 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
m_importList.append(importSection);
importSection->setImportExpanded(loadExpandedState(catName));
}
} else if (catName == "My Quick3D Components") {
importSection = importByUrl(ItemLibraryImport::quick3DAssetsTitle());
} else {
if (catName.startsWith("Qt Quick - "))
catName = catName.mid(11); // remove "Qt Quick - "
@@ -354,6 +364,8 @@ ItemLibraryImport *ItemLibraryModel::importByUrl(const QString &importUrl) const
|| (importUrl.isEmpty() && itemLibraryImport->importUrl() == "QtQuick")
|| (importUrl == ItemLibraryImport::userComponentsTitle()
&& itemLibraryImport->sectionType() == ItemLibraryImport::SectionType::User)
|| (importUrl == ItemLibraryImport::quick3DAssetsTitle()
&& itemLibraryImport->sectionType() == ItemLibraryImport::SectionType::Quick3DAssets)
|| (importUrl == ItemLibraryImport::unimportedComponentsTitle()
&& itemLibraryImport->sectionType() == ItemLibraryImport::SectionType::Unimported)) {
return itemLibraryImport;

View File

@@ -144,13 +144,14 @@ ItemLibraryWidget::ItemLibraryWidget(AsynchronousImageCache &imageCache,
m_headerWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
Theme::setupTheme(m_headerWidget->engine());
m_headerWidget->engine()->addImportPath(propertyEditorResourcesPath() + "/imports");
m_headerWidget->setClearColor(Theme::getColor(Theme::Color::QmlDesigner_BackgroundColorDarkAlternate));
m_headerWidget->setClearColor(Theme::getColor(Theme::Color::DSpanelBackground));
m_headerWidget->rootContext()->setContextProperty("rootView", QVariant::fromValue(this));
// create add imports widget
m_addImportWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
m_addImportWidget->setClearColor(Theme::getColor(Theme::Color::QmlDesigner_BackgroundColorDarkAlternate));
Theme::setupTheme(m_addImportWidget->engine());
m_addImportWidget->engine()->addImportPath(propertyEditorResourcesPath() + "/imports");
m_addImportWidget->setClearColor(Theme::getColor(Theme::Color::DSpanelBackground));
m_addImportWidget->rootContext()->setContextProperties({
{"addImportModel", QVariant::fromValue(m_itemLibraryAddImportModel.data())},
{"rootView", QVariant::fromValue(this)},
@@ -172,7 +173,7 @@ ItemLibraryWidget::ItemLibraryWidget(AsynchronousImageCache &imageCache,
m_itemViewQuickWidget->rootContext()->setContextProperty("tooltipBackend",
m_previewTooltipBackend.get());
m_itemViewQuickWidget->setClearColor(Theme::getColor(Theme::Color::QmlDesigner_ButtonColor));
m_itemViewQuickWidget->setClearColor(Theme::getColor(Theme::Color::DSpanelBackground));
m_itemViewQuickWidget->engine()->addImageProvider(QStringLiteral("qmldesigner_itemlibrary"),
new Internal::ItemLibraryImageProvider);
Theme::setupTheme(m_itemViewQuickWidget->engine());

View File

@@ -45,12 +45,9 @@
namespace QmlDesigner {
IconCheckboxItemDelegate::IconCheckboxItemDelegate(QObject *parent,
const QIcon &checkedIcon,
const QIcon &uncheckedIcon)
IconCheckboxItemDelegate::IconCheckboxItemDelegate(QObject *parent, const QIcon &icon)
: QStyledItemDelegate(parent),
m_checkedIcon(checkedIcon),
m_uncheckedIcon(uncheckedIcon)
m_icon(icon)
{}
QSize IconCheckboxItemDelegate::sizeHint(const QStyleOptionViewItem & /*option*/,
@@ -83,12 +80,18 @@ void IconCheckboxItemDelegate::paint(QPainter *painter,
const QStyleOptionViewItem &styleOption,
const QModelIndex &modelIndex) const
{
if (styleOption.state & QStyle::State_MouseOver && !isThisOrAncestorLocked(modelIndex))
painter->fillRect(styleOption.rect.adjusted(0, delegateMargin, 0, -delegateMargin),
Theme::getColor(Theme::Color::DSsliderHandle));
QIcon::Mode mode = QIcon::Mode::Normal;
if (styleOption.state & QStyle::State_Selected)
if (styleOption.state & QStyle::State_MouseOver && !isThisOrAncestorLocked(modelIndex)) {
painter->fillRect(styleOption.rect.adjusted(0, delegateMargin, 0, -delegateMargin),
Theme::getColor(Theme::Color::DSnavigatorItemBackgroundHover));
mode = QIcon::Mode::Active; // hover
}
if (styleOption.state & QStyle::State_Selected) {
NavigatorTreeView::drawSelectionBackground(painter, styleOption);
mode = QIcon::Mode::Selected;
}
bool isVisibilityIcon = modelIndex.column() != NavigatorTreeModel::ColumnType::Visibility;
// We need to invert the check status if visibility icon
@@ -106,8 +109,8 @@ void IconCheckboxItemDelegate::paint(QPainter *painter,
const QPoint iconPosition(styleOption.rect.left() + (styleOption.rect.width() - iconSize.width()) / 2,
styleOption.rect.top() + 2 + delegateMargin);
const QIcon &icon = isChecked(modelIndex) ? m_checkedIcon : m_uncheckedIcon;
const QPixmap iconPixmap = icon.pixmap(window, iconSize);
const QIcon::State state = isChecked(modelIndex) ? QIcon::State::On : QIcon::State::Off;
const QPixmap iconPixmap = m_icon.pixmap(window, iconSize, mode, state);
painter->save();

View File

@@ -34,9 +34,7 @@ class NavigatorTreeModel;
class IconCheckboxItemDelegate : public QStyledItemDelegate
{
public:
explicit IconCheckboxItemDelegate(QObject *parent,
const QIcon &checkedIcon,
const QIcon &uncheckedIcon);
explicit IconCheckboxItemDelegate(QObject *parent, const QIcon &icon);
QSize sizeHint(const QStyleOptionViewItem &option,
const QModelIndex &index) const override;
@@ -52,7 +50,6 @@ protected:
const QModelIndex &index) override;
private:
const QIcon m_checkedIcon;
const QIcon m_uncheckedIcon;
const QIcon m_icon;
};
} // namespace QmlDesigner

View File

@@ -217,12 +217,18 @@ void NameItemDelegate::paint(QPainter *painter,
{
painter->save();
if (styleOption.state & QStyle::State_MouseOver && !isThisOrAncestorLocked(modelIndex))
painter->fillRect(styleOption.rect.adjusted(0, delegateMargin, 0, -delegateMargin),
Theme::getColor(Theme::Color::DSsliderHandle));
painter->setPen(Theme::getColor(Theme::Color::DSnavigatorText));
if (styleOption.state & QStyle::State_Selected)
if (styleOption.state & QStyle::State_MouseOver && !isThisOrAncestorLocked(modelIndex)) {
painter->fillRect(styleOption.rect.adjusted(0, delegateMargin, 0, -delegateMargin),
Theme::getColor(Theme::Color::DSnavigatorItemBackgroundHover));
painter->setPen(Theme::getColor(Theme::Color::DSnavigatorTextHover));
}
if (styleOption.state & QStyle::State_Selected) {
NavigatorTreeView::drawSelectionBackground(painter, styleOption);
painter->setPen(Theme::getColor(Theme::Color::DSnavigatorTextSelected));
}
iconOffset = drawIcon(painter, styleOption, modelIndex);

View File

@@ -74,7 +74,7 @@ public:
mouseOverStateSavedFrameRectangle = option->rect;
painter->fillRect(option->rect.adjusted(0, delegateMargin, 0, -delegateMargin),
Theme::getColor(Theme::Color::QmlDesigner_BorderColor));
Theme::getColor(Theme::Color::DSnavigatorItemBackground));
} else if (element == PE_IndicatorItemViewItemDrop) {
// between elements and on elements we have a width
if (option->rect.width() > 0) {
@@ -101,7 +101,8 @@ public:
int bef_v = mid_v;
int aft_h = mid_h;
int aft_v = mid_v;
QBrush brush(Theme::getColor(Theme::Color::DSsliderHandle), Qt::SolidPattern);
QBrush brush(Theme::getColor(Theme::Color::DSnavigatorBranch), Qt::SolidPattern);
if (option->state & State_Item) {
if (option->direction == Qt::RightToLeft)
painter->fillRect(option->rect.left(), mid_v, bef_h - option->rect.left(), 1, brush);
@@ -116,11 +117,11 @@ public:
int delta = decoration_size / 2;
bef_h -= delta;
bef_v -= delta;
aft_h += delta;
aft_v += delta;
//aft_h += delta;
//aft_v += delta;
const QRectF rect(bef_h, bef_v, decoration_size + 1, decoration_size + 1);
painter->fillRect(rect, QBrush(Theme::getColor(Theme::Color::QmlDesigner_BackgroundColorDarkAlternate)));
painter->fillRect(rect, QBrush(Theme::getColor(Theme::Color::DSpanelBackground)));
static const QPointF collapsePoints[3] = {
QPointF(0.0, 0.0),
@@ -134,7 +135,7 @@ public:
QPointF(4.0, 4.0)
};
auto color = Theme::getColor(Theme::Color::IconsBaseColor);
auto color = Theme::getColor(Theme::Color::DSnavigatorBranchIndicator);
painter->setPen(color);
painter->setBrush(color);
@@ -167,23 +168,15 @@ public:
private: // functions
QColor highlightBrushColor() const
{
QColor highlightBrushColor = m_currentTextColor;
highlightBrushColor.setAlphaF(0.7);
return highlightBrushColor;
QColor color = Theme::getColor(Theme::Color::DSnavigatorDropIndicatorBackground);
color.setAlphaF(0.7);
return color;
}
QColor highlightLineColor() const
{
return highlightBrushColor().lighter();
}
QColor backgroundBrushColor() const
{
QColor backgroundBrushColor = highlightBrushColor();
backgroundBrushColor.setAlphaF(0.2);
return backgroundBrushColor;
}
QColor backgroundLineColor() const
{
return backgroundBrushColor().lighter();
QColor color = Theme::getColor(Theme::Color::DSnavigatorDropIndicatorOutline);
color.setAlphaF(0.7);
return color;
}
void drawHighlightFrame(const QRect &frameRectangle, QPainter *painter) const
@@ -192,12 +185,7 @@ private: // functions
painter->setBrush(highlightBrushColor());
painter->drawRect(frameRectangle);
}
void drawBackgroundFrame(const QRect &frameRectangle, QPainter *painter) const
{
painter->setPen(QPen(backgroundLineColor(), 2));
painter->setBrush(backgroundBrushColor());
painter->drawRect(frameRectangle);
}
void drawIndicatorLine(const QPoint &leftPoint, const QPoint &rightPoint, QPainter *painter) const
{
painter->setPen(QPen(highlightLineColor(), 3));
@@ -231,7 +219,7 @@ void NavigatorTreeView::drawSelectionBackground(QPainter *painter, const QStyleO
{
painter->save();
painter->fillRect(option.rect.adjusted(0, delegateMargin, 0, -delegateMargin),
Theme::getColor(Theme::Color::QmlDesigner_HighlightColor));
Theme::getColor(Theme::Color::DSnavigatorItemBackgroundSelected));
painter->restore();
}

View File

@@ -615,44 +615,85 @@ void NavigatorView::setupWidget()
#ifndef QMLDESIGNER_TEST
const QString fontName = "qtds_propertyIconFont.ttf";
const QSize size = QSize(28, 28);
const QIcon visibilityOnIcon =
Utils::StyleHelper::getIconFromIconFont(fontName,
Theme::getIconUnicode(Theme::Icon::visibilityOn),
20, 20, QColor(Qt::white));
const QIcon visibilityOffIcon =
Utils::StyleHelper::getIconFromIconFont(fontName,
Theme::getIconUnicode(Theme::Icon::visibilityOff),
20, 20, QColor(Qt::white));
const QString visibilityOnUnicode = Theme::getIconUnicode(Theme::Icon::visibilityOn);
const QString visibilityOffUnicode = Theme::getIconUnicode(Theme::Icon::visibilityOff);
const QIcon aliasOnIcon =
Utils::StyleHelper::getIconFromIconFont(fontName,
Theme::getIconUnicode(Theme::Icon::idAliasOn),
20, 20, QColor(Qt::red));
const QIcon aliasOffIcon =
Utils::StyleHelper::getIconFromIconFont(fontName,
Theme::getIconUnicode(Theme::Icon::idAliasOff),
20, 20, QColor(Qt::white));
const QString aliasOnUnicode = Theme::getIconUnicode(Theme::Icon::idAliasOn);
const QString aliasOffUnicode = Theme::getIconUnicode(Theme::Icon::idAliasOff);
const QIcon lockOnIcon =
Utils::StyleHelper::getIconFromIconFont(fontName,
Theme::getIconUnicode(Theme::Icon::lockOn),
20, 20, QColor(Qt::white));
const QIcon lockOffIcon =
Utils::StyleHelper::getIconFromIconFont(fontName,
Theme::getIconUnicode(Theme::Icon::lockOff),
20, 20, QColor(Qt::white));
const QString lockOnUnicode = Theme::getIconUnicode(Theme::Icon::lockOn);
const QString lockOffUnicode = Theme::getIconUnicode(Theme::Icon::lockOff);
auto visibilityIconOffNormal = Utils::StyleHelper::IconFontHelper(
visibilityOffUnicode, Theme::getColor(Theme::DSnavigatorIcon), size, QIcon::Normal, QIcon::Off);
auto visibilityIconOffHover = Utils::StyleHelper::IconFontHelper(
visibilityOffUnicode, Theme::getColor(Theme::DSnavigatorIconHover), size, QIcon::Active, QIcon::Off);
auto visibilityIconOffSelected = Utils::StyleHelper::IconFontHelper(
visibilityOffUnicode, Theme::getColor(Theme::DSnavigatorIconSelected), size, QIcon::Selected, QIcon::Off);
auto visibilityIconOnNormal = Utils::StyleHelper::IconFontHelper(
visibilityOnUnicode, Theme::getColor(Theme::DSnavigatorIcon), size, QIcon::Normal, QIcon::On);
auto visibilityIconOnHover = Utils::StyleHelper::IconFontHelper(
visibilityOnUnicode, Theme::getColor(Theme::DSnavigatorIconHover), size, QIcon::Active, QIcon::On);
auto visibilityIconOnSelected = Utils::StyleHelper::IconFontHelper(
visibilityOnUnicode, Theme::getColor(Theme::DSnavigatorIconSelected), size, QIcon::Selected, QIcon::On);
const QIcon visibilityIcon = Utils::StyleHelper::getIconFromIconFont(
fontName, {visibilityIconOffNormal,
visibilityIconOffHover,
visibilityIconOffSelected,
visibilityIconOnNormal,
visibilityIconOnHover,
visibilityIconOnSelected});
auto aliasIconOffNormal = Utils::StyleHelper::IconFontHelper(
aliasOffUnicode, Theme::getColor(Theme::DSnavigatorIcon), size, QIcon::Normal, QIcon::Off);
auto aliasIconOffHover = Utils::StyleHelper::IconFontHelper(
aliasOffUnicode, Theme::getColor(Theme::DSnavigatorIconHover), size, QIcon::Active, QIcon::Off);
auto aliasIconOffSelected = Utils::StyleHelper::IconFontHelper(
aliasOffUnicode, Theme::getColor(Theme::DSnavigatorIconSelected), size, QIcon::Selected, QIcon::Off);
auto aliasIconOnNormal = Utils::StyleHelper::IconFontHelper(
aliasOnUnicode, Theme::getColor(Theme::DSnavigatorAliasIconChecked), size, QIcon::Normal, QIcon::On);
auto aliasIconOnHover = Utils::StyleHelper::IconFontHelper(
aliasOnUnicode, Theme::getColor(Theme::DSnavigatorAliasIconChecked), size, QIcon::Active, QIcon::On);
auto aliasIconOnSelected = Utils::StyleHelper::IconFontHelper(
aliasOnUnicode, Theme::getColor(Theme::DSnavigatorAliasIconChecked), size, QIcon::Selected, QIcon::On);
const QIcon aliasIcon = Utils::StyleHelper::getIconFromIconFont(
fontName, {aliasIconOffNormal,
aliasIconOffHover,
aliasIconOffSelected,
aliasIconOnNormal,
aliasIconOnHover,
aliasIconOnSelected});
auto lockIconOffNormal = Utils::StyleHelper::IconFontHelper(
lockOffUnicode, Theme::getColor(Theme::DSnavigatorIcon), size, QIcon::Normal, QIcon::Off);
auto lockIconOffHover = Utils::StyleHelper::IconFontHelper(
lockOffUnicode, Theme::getColor(Theme::DSnavigatorIconHover), size, QIcon::Active, QIcon::Off);
auto lockIconOffSelected = Utils::StyleHelper::IconFontHelper(
lockOffUnicode, Theme::getColor(Theme::DSnavigatorIconSelected), size, QIcon::Selected, QIcon::Off);
auto lockIconOnNormal = Utils::StyleHelper::IconFontHelper(
lockOnUnicode, Theme::getColor(Theme::DSnavigatorIcon), size, QIcon::Normal, QIcon::On);
auto lockIconOnHover = Utils::StyleHelper::IconFontHelper(
lockOnUnicode, Theme::getColor(Theme::DSnavigatorIconHover), size, QIcon::Active, QIcon::On);
auto lockIconOnSelected = Utils::StyleHelper::IconFontHelper(
lockOnUnicode, Theme::getColor(Theme::DSnavigatorIconSelected), size, QIcon::Selected, QIcon::On);
const QIcon lockIcon = Utils::StyleHelper::getIconFromIconFont(
fontName, {lockIconOffNormal,
lockIconOffHover,
lockIconOffSelected,
lockIconOnNormal,
lockIconOnHover,
lockIconOnSelected});
auto idDelegate = new NameItemDelegate(this);
IconCheckboxItemDelegate *visibilityDelegate =
new IconCheckboxItemDelegate(this, visibilityOnIcon, visibilityOffIcon);
IconCheckboxItemDelegate *aliasDelegate =
new IconCheckboxItemDelegate(this, aliasOnIcon, aliasOffIcon);
IconCheckboxItemDelegate *lockDelegate =
new IconCheckboxItemDelegate(this, lockOnIcon, lockOffIcon);
auto visibilityDelegate = new IconCheckboxItemDelegate(this, visibilityIcon);
auto aliasDelegate = new IconCheckboxItemDelegate(this, aliasIcon);
auto lockDelegate = new IconCheckboxItemDelegate(this, lockIcon);
treeWidget()->setItemDelegateForColumn(NavigatorTreeModel::ColumnType::Name, idDelegate);
treeWidget()->setItemDelegateForColumn(NavigatorTreeModel::ColumnType::Alias, aliasDelegate);

View File

@@ -1,112 +1,119 @@
ADS--DockContainerWidget
{
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
ADS--DockContainerWidget {
background: creatorTheme.DSdockContainerBackground;
}
ADS--DockContainerWidget QSplitter::handle
{
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
ADS--DockContainerWidget QSplitter::handle {
background: creatorTheme.DSdockContainerSplitter;
}
ADS--DockAreaWidget
{
background-color: creatorTheme.BackgroundColorNormal;
ADS--DockAreaWidget {
background: creatorTheme.DSdockAreaBackground;
}
ADS--DockAreaWidget #tabsMenuButton::menu-indicator
{
ADS--DockAreaWidget #tabsMenuButton::menu-indicator {
image: none;
}
ADS--DockSplitter::handle:horizontal {
width: 1px;
background-color: creatorTheme.SplitterColor;
background: creatorTheme.DSdockWidgetSplitter;
}
ADS--DockSplitter::handle:vertical {
height: 1px;
background-color: creatorTheme.SplitterColor;
background: creatorTheme.DSdockWidgetSplitter;
}
ADS--DockWidgetTab
{
background-color: creatorTheme.BackgroundColorDark;
border-color: creatorTheme.SplitterColor;
ADS--DockWidgetTab {
background-color: creatorTheme.DStabInactiveBackground;
border-color: creatorTheme.DStabSplitter;
border-style: solid;
border-width: 0 1px 0 0;
}
ADS--DockWidgetTab[activeTab="true"]
{
background-color: creatorTheme.QmlDesigner_TabLight;
ADS--DockWidgetTab QLabel {
color: creatorTheme.DStabInactiveText;
}
ADS--DockWidgetTab QLabel
{
color: creatorTheme.QmlDesigner_TabLight;
ADS--DockWidgetTab[activeTab="true"] {
background: creatorTheme.DStabActiveBackground;
}
ADS--DockWidgetTab[activeTab="true"] QLabel
{
color: creatorTheme.QmlDesigner_TabDark;
ADS--DockWidgetTab[activeTab="true"] QLabel {
color: creatorTheme.DStabActiveText;
}
ADS--DockWidget
{
background-color: palette(light);
border-color: red;
border-style: solid;
border-width: 0;
ADS--DockWidgetTab[activeTab="true"] > #tabCloseButton:hover {
background: creatorTheme.DStabActiveButtonHover;
}
ADS--DockAreaTitleBar
{
background-color: creatorTheme.BackgroundColorDark;
ADS--DockWidgetTab[activeTab="true"] > #tabCloseButton:pressed {
background: creatorTheme.DStabActiveButtonPress;
}
QWidget#tabsContainerWidget
{
background-color: creatorTheme.BackgroundColorDark;
ADS--DockWidget {
background: creatorTheme.DSdockWidgetBackground;
border: none;
}
ADS--TitleBarButton
{
padding: 0px 0px;
QWidget#tabsContainerWidget {
background: creatorTheme.DStabContainerBackground;
}
ADS--TitleBarButton:hover
{
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
ADS--TitleBarButton {
margin: 1px;
background: none;
border: none;
}
QScrollArea#dockWidgetScrollArea
{
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
ADS--TitleBarButton:hover {
background-color: creatorTheme.DStitleBarButtonHover;
}
ADS--TitleBarButton:press {
background-color: creatorTheme.DStitleBarButtonPress;
}
#floatingTitleLabel {
color: creatorTheme.DStitleBarText;
}
#floatingTitleCloseButton {
margin: 1px;
background: none;
border: none;
}
#floatingTitleCloseButton:hover {
background: creatorTheme.DStitleBarButtonHover;
}
#floatingTitleCloseButton:pressed {
background: creatorTheme.DStitleBarButtonPress;
}
QScrollArea#dockWidgetScrollArea {
background-color: creatorTheme.DSpanelBackground;
padding: 0px;
border: none;
}
#tabCloseButton
{
margin-top: 2px;
#tabCloseButton {
margin: 1px;
background: none;
border: none;
padding: 0px -2px;
}
#tabCloseButton:hover
{
border: 1px solid rgba(0, 0, 0, 32);
background: rgba(0, 0, 0, 16);
#tabCloseButton:hover {
background: creatorTheme.DStabInactiveButtonHover;
}
#tabCloseButton:pressed
{
background: rgba(0, 0, 0, 32);
#tabCloseButton:pressed {
background: creatorTheme.DStabInactiveButtonPress;
}
QScrollBar {
background-color: creatorTheme.BackgroundColorDark;
background: creatorTheme.DSscrollBarTrack;
}
QScrollBar:vertical {
@@ -118,7 +125,7 @@ QScrollBar:horizontal {
}
QScrollBar::handle {
background-color: creatorTheme.QmlDesigner_ScrollBarHandleColor;
background: creatorTheme.DSscrollBarHandle;
}
QScrollBar::handle:vertical {
@@ -141,28 +148,27 @@ QScrollBar::sub-page {
/* Focus related styling */
ADS--DockWidgetTab[focused="true"] {
background: creatorTheme.DSinteraction;
border-color: creatorTheme.DSinteraction;
background: creatorTheme.DStabFocusBackground;
}
ADS--DockWidgetTab[focused="true"] > #tabCloseButton:hover {
background: rgba(255, 255, 255, 48);
background: creatorTheme.DStabFocusButtonHover;
}
ADS--DockWidgetTab[focused="true"] > #tabCloseButton:pressed {
background: rgba(255, 255, 255, 92);
background: creatorTheme.DStabFocusButtonPress;
}
ADS--DockWidgetTab[focused="true"] QLabel {
color: palette(creatorTheme.DStextColor);
color: creatorTheme.DStabFocusText;
}
ADS--DockAreaTitleBar {
background: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
border-bottom: 2px solid creatorTheme.QmlDesigner_TabLight;
background: creatorTheme.DSdockWidgetTitleBar;
border-bottom: 2px solid creatorTheme.DStabActiveBackground;
padding-bottom: 0px;
}
ADS--DockAreaWidget[focused="true"] ADS--DockAreaTitleBar {
border-bottom-color: creatorTheme.DSinteraction;
border-bottom-color: creatorTheme.DStabFocusBackground;
}

View File

@@ -1,5 +1,5 @@
QScrollBar {
background-color: creatorTheme.BackgroundColorDark;
background-color: creatorTheme.DSscrollBarTrack;
}
QScrollBar:vertical {
@@ -11,7 +11,7 @@ QScrollBar:horizontal {
}
QScrollBar::handle {
background-color: creatorTheme.QmlDesigner_ScrollBarHandleColor;
background-color: creatorTheme.DSscrollBarHandle;
}
QScrollBar::handle:vertical {

View File

@@ -1,6 +1,11 @@
QFrame {
border: 2px;
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
QFrame,
QScrollArea,
QStackedWidget,
QGraphicsView,
QTabWidget,
QTabWidget::pane { /* The tab widget frame */
border: 0px;
background-color: creatorTheme.DSpanelBackground;
}
QLabel {
@@ -8,54 +13,52 @@ QLabel {
border-image: none;
padding: 0;
background: none;
color: creatorTheme.PanelTextColorLight;
color: creatorTheme.DStextColor;
selection-color: creatorTheme.DStextSelectedTextColor;
selection-background-color: creatorTheme.DSinteraction;
}
QScrollArea {
border: 0px;
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
QFrame {
border: 2px;
}
QStackedWidget {
border: 0px;
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
QTreeView,
QListView {
color: creatorTheme.DStextColor;
selection-color: creatorTheme.DStextSelectedTextColor;
selection-background-color: creatorTheme.DSinteraction;
}
QGraphicsView {
border: 0px;
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
QPushButton {
color: creatorTheme.DStextColor;
border: 1px solid creatorTheme.DScontrolOutline;
background: creatorTheme.DScontrolBackground;
padding: 4px 2px 4px 2px;
min-width: 70px;
}
QTreeView {
color: creatorTheme.PanelTextColorLight;
selection-color: creatorTheme.PanelTextColorLight;
selection-background-color: creatorTheme.QmlDesigner_HighlightColor;
}
QListView {
color: creatorTheme.PanelTextColorLight;
selection-color: creatorTheme.PanelTextColorLight;
selection-background-color: creatorTheme.QmlDesigner_HighlightColor;
}
QComboBox QAbstractItemView {
show-decoration-selected: 1; /* make the selection span the entire width of the view */
background-color: creatorTheme.DSpanelBackground; /* sets background of the menu */
border: 1px solid black;
margin: 0px; /* some spacing around the menu */
color: creatorTheme.DStextColor;
selection-background-color: creatorTheme.DSinteraction;
selection-color: creatorTheme.DStextSelectedTextColor;
}
QTabWidget {
border: 0px;
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
QPushButton:hover {
background: creatorTheme.DScontrolBackgroundHover;
}
QTabWidget::pane { /* The tab widget frame */
border: 0px;
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
QPushButton:pressed {
border-color: creatorTheme.DScontrolOutlineInteraction;
background: creatorTheme.DScontrolBackgroundInteraction;
color: creatorTheme.DSiconColorInteraction;
}
QCheckBox {
color: creatorTheme.DStextColor;
}
QComboBox QAbstractItemView {
show-decoration-selected: 1; /* make the selection span the entire width of the view */
background-color: creatorTheme.DSpopupBackground; /* sets background of the menu */
border: 1px solid creatorTheme.DScontrolOutline;
margin: 0px; /* some spacing around the menu */
color: creatorTheme.DStextColor;
selection-color: creatorTheme.DStextSelectedTextColor;
selection-background-color: creatorTheme.DSinteraction;
}
QTabBar::tab {
@@ -63,8 +66,8 @@ QTabBar::tab {
height: 22px;
border-image: none;
background-color: creatorTheme.QmlDesigner_TabDark;
color: creatorTheme.QmlDesigner_TabLight;
background-color: creatorTheme.DStabInactiveBackground;
color: creatorTheme.DStabInactiveText;
margin: 0px;
font: bold;
font-size: creatorTheme.captionFontPixelSize;
@@ -72,6 +75,13 @@ QTabBar::tab {
QTabBar::tab:selected {
border: none; /* no border for a flat push button */
background-color: creatorTheme.QmlDesigner_TabLight;
color: creatorTheme.QmlDesigner_TabDark;
background-color: creatorTheme.DStabActiveBackground;
color: creatorTheme.DStabActiveText;
}
QLineEdit {
color: creatorTheme.DStextColor;
background-color: creatorTheme.DSdockAreaBackground;
selection-color: creatorTheme.DStextSelectedTextColor;
selection-background-color: creatorTheme.DStextSelectionColor;
}

View File

@@ -27,6 +27,8 @@
#include "timelinecontrols.h"
#include <theme.h>
#include <QColor>
#include <QDialog>
@@ -41,14 +43,14 @@ struct CanvasStyle
qreal thinLineWidth = 0.3;
qreal thickLineWidth = 2.5;
QColor thinLineColor = qRgb(0x99, 0x99, 0x99);
QColor thickLineColor = qRgb(0x5f, 0x5f, 0x5f);
QColor thinLineColor = Theme::getColor(Theme::DSscrollBarHandle);
QColor thickLineColor = Theme::getColor(Theme::DSscrollBarHandle);
qreal handleSize = 7.0;
qreal handleLineWidth = 2.0;
QColor endPointColor = qRgb(0xd6, 0xd3, 0x51);
QColor interPointColor = qRgb(0xce, 0x17, 0x17);
QColor endPointColor = Theme::getColor(Theme::IconsWarningToolBarColor);
QColor interPointColor = Theme::getColor(Theme::DSerrorColor);
qreal curveWidth = 3.0;
};

View File

@@ -91,21 +91,18 @@ void SplineEditor::paintEvent(QPaintEvent *)
{
QPainter painter(this);
QPen pen(Qt::black);
QPen pen(Theme::getColor(Theme::DScontrolOutline));
pen.setWidth(1);
painter.drawRect(0, 0, width() - 1, height() - 1);
painter.setRenderHint(QPainter::Antialiasing);
pen = QPen(Qt::darkGray);
pen.setWidth(1);
painter.setPen(pen);
QColor curveColor = Qt::white;
QColor curveColor = Theme::getColor(Theme::PanelTextColorLight);
if (!m_curve.isLegal())
curveColor = Qt::red;
curveColor = Theme::getColor(Theme::DSerrorColor);
QBrush background(Theme::getColor(Theme::BackgroundColorDark));
QBrush background(Theme::instance()->qmlDesignerBackgroundColorDarker());
m_canvas.paintGrid(&painter, background);
m_canvas.paintCurve(&painter, m_curve, curveColor);
m_canvas.paintControlPoints(&painter, m_curve);

View File

@@ -63,7 +63,7 @@ FloatControl::FloatControl()
setMinimum(std::numeric_limits<float>::lowest());
setMaximum(std::numeric_limits<float>::max());
QColor bg = Theme::instance()->qmlDesignerBackgroundColorDarkAlternate();
QColor bg = Theme::getColor(Theme::DScontrolBackground);
auto p = palette();
p.setColor(QPalette::Text, Theme::instance()->color(Utils::Theme::PanelTextColorLight));

View File

@@ -51,9 +51,8 @@ TimelinePlaceholder *TimelinePlaceholder::create(QGraphicsScene * /*parentScene*
void TimelinePlaceholder::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
painter->save();
static const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
static const QColor backgroundColor = Theme::instance()
->qmlDesignerBackgroundColorDarkAlternate();
static const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
static const QColor backgroundColorSection = Theme::getColor(Theme::BackgroundColorDark);
painter->fillRect(0, 0, size().width(), size().height(), backgroundColor);

View File

@@ -368,10 +368,9 @@ void TimelinePropertyItem::paint(QPainter *painter, const QStyleOptionGraphicsIt
{
painter->save();
static const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
static const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
static const QColor textColor = Theme::getColor(Theme::PanelTextColorLight);
static const QColor backgroundColor = Theme::instance()
->qmlDesignerBackgroundColorDarkAlternate();
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
static const QPixmap keyframe = TimelineIcons::KEYFRAME.pixmap();
static const QPixmap isKeyframe = TimelineIcons::IS_KEYFRAME.pixmap();

View File

@@ -255,7 +255,7 @@ void TimelineSectionItem::paint(QPainter *painter,
painter->save();
const QColor textColor = Theme::getColor(Theme::PanelTextColorLight);
const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
QColor brushColor = Theme::getColor(Theme::BackgroundColorDark);
int fillOffset = 0;
@@ -273,7 +273,7 @@ void TimelineSectionItem::paint(QPainter *painter,
0,
size().width() - TimelineConstants::sectionWidth,
size().height(),
Theme::instance()->qmlDesignerBackgroundColorDarkAlternate());
Theme::getColor(Theme::DScontrolBackground));
painter->setPen(penColor);
drawLine(painter,
@@ -640,8 +640,7 @@ qreal TimelineRulerSectionItem::endFrame() const
void TimelineRulerSectionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
static const QColor backgroundColor = Theme::instance()
->qmlDesignerBackgroundColorDarkAlternate();
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
static const QColor penColor = Theme::getColor(Theme::PanelTextColorLight);
static const QColor highlightColor = Theme::instance()->Theme::qmlDesignerButtonColor();
static const QColor handleColor = Theme::getColor(Theme::QmlDesigner_HighlightColor);

View File

@@ -121,10 +121,9 @@ void TransitionEditorPropertyItem::paint(QPainter *painter,
{
painter->save();
static const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
static const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
static const QColor textColor = Theme::getColor(Theme::PanelTextColorLight);
static const QColor backgroundColor = Theme::instance()
->qmlDesignerBackgroundColorDarkAlternate();
static const QColor backgroundColor = Theme::getColor(Theme::DScontrolBackground);
painter->fillRect(0, 0, TimelineConstants::sectionWidth, size().height(), backgroundColor);
painter->fillRect(TimelineConstants::textIndentationProperties - 4,

View File

@@ -302,8 +302,8 @@ void TransitionEditorSectionItem::paint(QPainter *painter,
painter->save();
const QColor textColor = Theme::getColor(Theme::PanelTextColorLight);
const QColor penColor = Theme::instance()->qmlDesignerBackgroundColorDarker();
QColor brushColor = Theme::getColor(Theme::BackgroundColorDark);
const QColor penColor = Theme::getColor(Theme::BackgroundColorDark);
QColor brushColor = Theme::getColor(Theme::DScontrolBackground);
int fillOffset = 0;
if (isSelected()) {
@@ -320,7 +320,7 @@ void TransitionEditorSectionItem::paint(QPainter *painter,
0,
size().width() - TimelineConstants::sectionWidth,
size().height(),
Theme::instance()->qmlDesignerBackgroundColorDarkAlternate());
Theme::getColor(Theme::DScontrolBackground));
painter->setPen(penColor);
drawLine(painter,

View File

@@ -215,7 +215,7 @@ void DesignModeWidget::disableWidgets()
static void addSpacerToToolBar(QToolBar *toolBar)
{
QWidget* empty = new QWidget();
empty->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
empty->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
toolBar->addWidget(empty);
}
@@ -231,6 +231,7 @@ void DesignModeWidget::setup()
ADS::DockManager::setConfigFlags(ADS::DockManager::DefaultNonOpaqueConfig);
ADS::DockManager::setConfigFlag(ADS::DockManager::FocusHighlighting, true);
ADS::DockManager::setConfigFlag(ADS::DockManager::AllTabsHaveCloseButton, true);
m_dockManager = new ADS::DockManager(this);
m_dockManager->setSettings(settings);
m_dockManager->setWorkspacePresetsPath(Core::ICore::resourcePath() + QLatin1String("/qmldesigner/workspacePresets/"));
@@ -239,32 +240,30 @@ void DesignModeWidget::setup()
m_dockManager->setStyleSheet(Theme::replaceCssColors(sheet));
// Setup icons
const QColor iconColor(Theme::getColor(Theme::IconsBaseColor));
const QColor buttonColor(Theme::getColor(Theme::QmlDesigner_TabLight)); // TODO Use correct color roles
const QColor tabColor(Theme::getColor(Theme::QmlDesigner_TabDark));
const QColor iconColor(Theme::getColor(Theme::DStitleBarIcon));
const QString closeUnicode = Theme::getIconUnicode(Theme::Icon::adsClose);
const QString menuUnicode = Theme::getIconUnicode(Theme::Icon::adsDropDown);
const QString undockUnicode = Theme::getIconUnicode(Theme::Icon::adsDetach);
const QString fontName = "qtds_propertyIconFont.ttf";
const QIcon closeIcon = Utils::StyleHelper::getIconFromIconFont(fontName, closeUnicode, 28, 28, buttonColor);
const QIcon menuIcon = Utils::StyleHelper::getIconFromIconFont(fontName, menuUnicode, 28, 28, buttonColor);
const QIcon undockIcon = Utils::StyleHelper::getIconFromIconFont(fontName, undockUnicode, 28, 28, buttonColor);
const QSize size = QSize(28, 28);
auto closeIconNormal = Utils::StyleHelper::IconFontHelper(closeUnicode,
tabColor,
QSize(28, 28),
QIcon::Normal,
QIcon::Off);
const QIcon closeIcon = Utils::StyleHelper::getIconFromIconFont(fontName, closeUnicode, 28, 28, iconColor);
const QIcon menuIcon = Utils::StyleHelper::getIconFromIconFont(fontName, menuUnicode, 28, 28, iconColor);
const QIcon undockIcon = Utils::StyleHelper::getIconFromIconFont(fontName, undockUnicode, 28, 28, iconColor);
auto closeIconFocused = Utils::StyleHelper::IconFontHelper(closeUnicode,
Theme::getColor(Theme::DStextColor),
QSize(28, 28),
QIcon::Normal,
QIcon::On);
auto tabCloseIconNormal = Utils::StyleHelper::IconFontHelper(
closeUnicode, Theme::getColor(Theme::DStabInactiveIcon), size, QIcon::Normal, QIcon::Off);
auto tabCloseIconActive = Utils::StyleHelper::IconFontHelper(
closeUnicode, Theme::getColor(Theme::DStabActiveIcon), size, QIcon::Active, QIcon::Off);
auto tabCloseIconFocus = Utils::StyleHelper::IconFontHelper(
closeUnicode, Theme::getColor(Theme::DStabFocusIcon), size, QIcon::Selected, QIcon::Off);
const QIcon tabsCloseIcon = Utils::StyleHelper::getIconFromIconFont(fontName, {closeIconNormal, closeIconFocused});
const QIcon tabsCloseIcon = Utils::StyleHelper::getIconFromIconFont(
fontName, {tabCloseIconNormal,
tabCloseIconActive,
tabCloseIconFocus});
ADS::DockManager::iconProvider().registerCustomIcon(ADS::TabCloseIcon, tabsCloseIcon);
ADS::DockManager::iconProvider().registerCustomIcon(ADS::DockAreaMenuIcon, menuIcon);
@@ -470,7 +469,8 @@ void DesignModeWidget::setup()
});
const QIcon gaIcon = Utils::StyleHelper::getIconFromIconFont(
fontName, Theme::getIconUnicode(Theme::Icon::annotationBubble), 36, 36, iconColor);
fontName, Theme::getIconUnicode(Theme::Icon::annotationBubble),
36, 36, Theme::getColor(Theme::IconsBaseColor));
toolBar->addAction(gaIcon, tr("Edit global annotation for current file."), [&](){
ModelNode node = currentDesignDocument()->rewriterView()->rootModelNode();

View File

@@ -175,12 +175,11 @@ bool DocumentWarningWidget::eventFilter(QObject *object, QEvent *event)
void DocumentWarningWidget::showEvent(QShowEvent *event)
{
const QColor backgroundColor = Utils::creatorTheme()->color(Utils::Theme::QmlDesigner_BackgroundColor);
const QColor backgroundColor = Utils::creatorTheme()->color(Utils::Theme::DScontrolBackground);
const QColor outlineColor = Utils::creatorTheme()->color(Utils::Theme::DScontrolOutline);
QPalette pal = palette();
QColor color = pal.color(QPalette::ToolTipBase);
const QColor backgroundNoAlpha = Utils::StyleHelper::alphaBlendedColors(color, backgroundColor);
color.setAlpha(255);
pal.setColor(QPalette::ToolTipBase, backgroundNoAlpha);
pal.setColor(QPalette::ToolTipBase, backgroundColor);
pal.setColor(QPalette::ToolTipText, outlineColor);
setPalette(pal);
m_gotoCodeWasClicked = false;
moveToParentCenter();

View File

@@ -69,7 +69,7 @@ SubversionSettingsPageWidget::SubversionSettingsPageWidget(const std::function<v
m_ui.pathChooser->setPromptDialogTitle(tr("Subversion Command"));
SubversionSettings &s = *m_settings;
m_ui.pathChooser->setFileName(s.binaryPath());
m_ui.pathChooser->setFilePath(s.binaryPath());
m_ui.usernameLineEdit->setText(s.stringValue(SubversionSettings::userKey));
m_ui.passwordLineEdit->setText(s.stringValue(SubversionSettings::passwordKey));
m_ui.userGroupBox->setChecked(s.boolValue(SubversionSettings::useAuthenticationKey));