forked from qt-creator/qt-creator
QmlDesigner: Fix appearance main toolbar
Using _q_custom_style_disabled had slight unwanted impact on appearance. Introducing _q_custom_style_skipolish instead in studio style. Using studio style whenever we are Qt Design Studio for all themes. Change-Id: Iee460cfc0a62122b1aeb6d97746808658c4f3ebf Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -65,7 +65,8 @@ Utils::UniqueObjectPtr<QToolBar> ToolBar::create()
|
|||||||
|
|
||||||
toolBar->setFloatable(false);
|
toolBar->setFloatable(false);
|
||||||
toolBar->setMovable(false);
|
toolBar->setMovable(false);
|
||||||
toolBar->setProperty("_q_custom_style_disabled", true);
|
toolBar->setProperty("_q_custom_style_skipolish", true);
|
||||||
|
toolBar->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
auto quickWidget = std::make_unique<StudioQuickWidget>();
|
auto quickWidget = std::make_unique<StudioQuickWidget>();
|
||||||
|
|
||||||
|
@@ -34,6 +34,8 @@
|
|||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
#include <coreplugin/inavigationwidgetfactory.h>
|
#include <coreplugin/inavigationwidgetfactory.h>
|
||||||
|
|
||||||
|
#include <qmlprojectmanager/qmlproject.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -95,7 +97,7 @@ DesignModeWidget::DesignModeWidget()
|
|||||||
, m_crumbleBar(new CrumbleBar(this))
|
, m_crumbleBar(new CrumbleBar(this))
|
||||||
{
|
{
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
if (Utils::StyleHelper::isQDSTheme())
|
if (Utils::StyleHelper::isQDSTheme() || QmlProjectManager::QmlProject::isQtDesignStudio())
|
||||||
qApp->setStyle(QmlDesignerBasePlugin::style());
|
qApp->setStyle(QmlDesignerBasePlugin::style());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1136,6 +1136,13 @@ QPalette StudioStyle::standardPalette() const
|
|||||||
return d->stdPalette;
|
return d->stdPalette;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StudioStyle::polish(QWidget *widget)
|
||||||
|
{
|
||||||
|
if (widget && widget->property("_q_custom_style_skipolish").toBool())
|
||||||
|
return;
|
||||||
|
Super::polish(widget);
|
||||||
|
}
|
||||||
|
|
||||||
void StudioStyle::drawQmlEditorIcon(
|
void StudioStyle::drawQmlEditorIcon(
|
||||||
PrimitiveElement element,
|
PrimitiveElement element,
|
||||||
const QStyleOption *option,
|
const QStyleOption *option,
|
||||||
|
@@ -58,6 +58,8 @@ public:
|
|||||||
|
|
||||||
QPalette standardPalette() const override;
|
QPalette standardPalette() const override;
|
||||||
|
|
||||||
|
void polish(QWidget *widget) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void drawQmlEditorIcon(PrimitiveElement element,
|
void drawQmlEditorIcon(PrimitiveElement element,
|
||||||
const QStyleOption *option,
|
const QStyleOption *option,
|
||||||
|
Reference in New Issue
Block a user