Commit 428565cb authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk

Core: Remove unneeded qualifications

Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I5c6690f51488bf8ca3610ba9fb11e6e5fd814aaa
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent f7835eb5
......@@ -101,9 +101,9 @@ using namespace Core::Internal;
put the following in your plugin's IPlugin::initialize function:
\code
QAction *myAction = new QAction(tr("My Action"), this);
Core::Command *cmd = Core::ActionManager::registerAction(myAction,
Command *cmd = ActionManager::registerAction(myAction,
"myplugin.myaction",
Core::Context(C_GLOBAL));
Context(C_GLOBAL));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+u")));
connect(myAction, SIGNAL(triggered()), this, SLOT(performMyAction()));
\endcode
......@@ -125,7 +125,7 @@ using namespace Core::Internal;
Following the example adding "My Action" to the "Tools" menu would be done by
\code
Core::ActionManager::actionContainer(Core::M_TOOLS)->addAction(cmd);
ActionManager::actionContainer(M_TOOLS)->addAction(cmd);
\endcode
\section1 Important Guidelines:
......
......@@ -66,7 +66,7 @@ CorePlugin::CorePlugin()
, m_findPlugin(0)
, m_locator(0)
{
qRegisterMetaType<Core::Id>();
qRegisterMetaType<Id>();
}
CorePlugin::~CorePlugin()
......@@ -181,12 +181,12 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
}
// Make sure we respect the process's umask when creating new files
Utils::SaveFile::initializeUmask();
SaveFile::initializeUmask();
m_findPlugin->initialize(arguments, errorMessage);
m_locator->initialize(this, arguments, errorMessage);
Utils::MacroExpander *expander = Utils::globalMacroExpander();
MacroExpander *expander = Utils::globalMacroExpander();
expander->registerVariable("CurrentDate:ISO", tr("The current date (ISO)."),
[]() { return QDate::currentDate().toString(Qt::ISODate); });
expander->registerVariable("CurrentTime:ISO", tr("The current time (ISO)."),
......
......@@ -193,7 +193,7 @@ QString NewDialog::m_lastCategory = QString();
NewDialog::NewDialog(QWidget *parent) :
QDialog(parent),
m_ui(new Core::Internal::Ui::NewDialog),
m_ui(new Ui::NewDialog),
m_okButton(0)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
......
......@@ -168,7 +168,7 @@ struct DocumentManagerPrivate
};
static DocumentManager *m_instance;
static Internal::DocumentManagerPrivate *d;
static DocumentManagerPrivate *d;
QFileSystemWatcher *DocumentManagerPrivate::fileWatcher()
{
......@@ -1425,11 +1425,11 @@ void DocumentManager::executeOpenWithMenuAction(QAction *action)
if (entry.editorFactory) {
// close any open editors that have this file open
// remember the views to open new editors in there
QList<Internal::EditorView *> views;
QList<EditorView *> views;
QList<IEditor *> editorsOpenForFile
= DocumentModel::editorsForFilePath(entry.fileName);
foreach (IEditor *openEditor, editorsOpenForFile) {
Internal::EditorView *view = EditorManagerPrivate::viewForEditor(openEditor);
EditorView *view = EditorManagerPrivate::viewForEditor(openEditor);
if (view && view->currentEditor() == openEditor) // visible
views.append(view);
}
......@@ -1439,12 +1439,12 @@ void DocumentManager::executeOpenWithMenuAction(QAction *action)
if (views.isEmpty()) {
EditorManager::openEditor(entry.fileName, entry.editorFactory->id());
} else {
if (Internal::EditorView *currentView = EditorManagerPrivate::currentEditorView()) {
if (EditorView *currentView = EditorManagerPrivate::currentEditorView()) {
if (views.removeOne(currentView))
views.prepend(currentView); // open editor in current view first
}
EditorManager::OpenEditorFlags flags;
foreach (Internal::EditorView *view, views) {
foreach (EditorView *view, views) {
IEditor *editor =
EditorManagerPrivate::openEditor(view, entry.fileName,
entry.editorFactory->id(), flags);
......
......@@ -329,7 +329,7 @@ void EditorManagerPrivate::init()
connect(m_closeCurrentEditorAction, SIGNAL(triggered()),
m_instance, SLOT(slotCloseCurrentEditorOrDocument()));
if (Utils::HostOsInfo::isWindowsHost()) {
if (HostOsInfo::isWindowsHost()) {
// workaround for QTCREATORBUG-72
QAction *action = new QAction(tr("Alternative Close"), this);
cmd = ActionManager::registerAction(action, Constants::CLOSE_ALTERNATIVE, editManagerContext);
......@@ -1593,7 +1593,7 @@ void EditorManagerPrivate::copyFilePathFromContextMenu()
{
if (!d->m_contextMenuEntry)
return;
QApplication::clipboard()->setText(Utils::FileName::fromString(
QApplication::clipboard()->setText(FileName::fromString(
d->m_contextMenuEntry->fileName()).toUserOutput());
}
......@@ -1603,7 +1603,7 @@ void EditorManagerPrivate::copyLocationFromContextMenu()
if (!d->m_contextMenuEntry || !action)
return;
const QString text =
Utils::FileName::fromString(d->m_contextMenuEntry->fileName()).toUserOutput()
FileName::fromString(d->m_contextMenuEntry->fileName()).toUserOutput()
+ QLatin1Char(':') + action->data().toString();
QApplication::clipboard()->setText(text);
}
......
......@@ -133,10 +133,10 @@ EditorView::EditorView(SplitterOrView *parentSplitterOrView, QWidget *parent) :
m_container->addWidget(empty);
m_widgetEditorMap.insert(empty, 0);
auto dropSupport = new Utils::FileDropSupport(this, [this](QDropEvent *event) {
auto dropSupport = new FileDropSupport(this, [this](QDropEvent *event) {
return event->source() != m_toolBar; // do not accept drops on ourselves
});
connect(dropSupport, &Utils::FileDropSupport::filesDropped,
connect(dropSupport, &FileDropSupport::filesDropped,
this, &EditorView::openDroppedFiles);
updateNavigatorActions();
......@@ -367,11 +367,11 @@ void EditorView::closeSplit()
EditorManagerPrivate::updateActions();
}
void EditorView::openDroppedFiles(const QList<Utils::FileDropSupport::FileSpec> &files)
void EditorView::openDroppedFiles(const QList<FileDropSupport::FileSpec> &files)
{
const int count = files.size();
for (int i = 0; i < count; ++i) {
const Utils::FileDropSupport::FileSpec spec = files.at(i);
const FileDropSupport::FileSpec spec = files.at(i);
EditorManagerPrivate::openEditorAt(this, spec.filePath, spec.line, spec.column, Id(),
i < count - 1 ? EditorManager::DoNotChangeCurrentEditor
| EditorManager::DoNotMakeVisible
......
......@@ -180,7 +180,7 @@ QString ExternalTool::workingDirectory() const
return m_workingDirectory;
}
QList<Utils::EnvironmentItem> ExternalTool::environment() const
QList<EnvironmentItem> ExternalTool::environment() const
{
return m_environment;
}
......@@ -282,7 +282,7 @@ void ExternalTool::setWorkingDirectory(const QString &workingDirectory)
m_workingDirectory = workingDirectory;
}
void ExternalTool::setEnvironment(const QList<Utils::EnvironmentItem> &items)
void ExternalTool::setEnvironment(const QList<EnvironmentItem> &items)
{
m_environment = items;
}
......@@ -429,7 +429,7 @@ ExternalTool * ExternalTool::createFromXml(const QByteArray &xml, QString *error
QStringList lines = reader.readElementText().split(QLatin1Char(';'));
for (auto iter = lines.begin(); iter != lines.end(); ++iter)
*iter = QString::fromUtf8(QByteArray::fromPercentEncoding(iter->toUtf8()));
tool->m_environment = Utils::EnvironmentItem::fromStringList(lines);
tool->m_environment = EnvironmentItem::fromStringList(lines);
} else {
reader.raiseError(QString::fromLatin1("Unknown element <%1> as subelement of <%2>").arg(
reader.qualifiedName().toString(), QLatin1String(kExecutable)));
......@@ -507,7 +507,7 @@ bool ExternalTool::save(QString *errorMessage) const
if (!m_workingDirectory.isEmpty())
out.writeTextElement(QLatin1String(kWorkingDirectory), m_workingDirectory);
if (!m_environment.isEmpty()) {
QStringList envLines = Utils::EnvironmentItem::toStringList(m_environment);
QStringList envLines = EnvironmentItem::toStringList(m_environment);
for (auto iter = envLines.begin(); iter != envLines.end(); ++iter)
*iter = QString::fromUtf8(iter->toUtf8().toPercentEncoding());
out.writeTextElement(QLatin1String(kEnvironment), envLines.join(QLatin1Char(';')));
......@@ -573,7 +573,7 @@ bool ExternalToolRunner::resolve()
m_resolvedExecutable.clear();
m_resolvedArguments.clear();
m_resolvedWorkingDirectory.clear();
m_resolvedEnvironment = Utils::Environment::systemEnvironment();
m_resolvedEnvironment = Environment::systemEnvironment();
MacroExpander *expander = globalMacroExpander();
......
......@@ -142,7 +142,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
bool isTitledAction = defaultAction()->property("titledAction").toBool();
if (!Utils::HostOsInfo::isMacHost() // Mac UIs usually don't hover
if (!HostOsInfo::isMacHost() // Mac UIs usually don't hover
&& m_fader > 0 && isEnabled() && !isDown() && !isChecked()) {
painter.save();
const QColor hoverColor = creatorTheme()->color(Theme::FancyToolButtonHoverColor);
......@@ -189,7 +189,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
QFont normalFont(painter.font());
QRect centerRect = rect();
normalFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
normalFont.setPointSizeF(StyleHelper::sidebarFontSize());
QFont boldFont(normalFont);
boldFont.setBold(true);
QFontMetrics fm(normalFont);
......@@ -204,7 +204,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
centerRect.adjust(0, 0, 0, -lineHeight*2 - 4);
iconRect.moveCenter(centerRect.center());
Utils::StyleHelper::drawIconWithShadow(icon(), iconRect, &painter, isEnabled() ? QIcon::Normal : QIcon::Disabled);
StyleHelper::drawIconWithShadow(icon(), iconRect, &painter, isEnabled() ? QIcon::Normal : QIcon::Disabled);
painter.setFont(normalFont);
QPoint textOffset = centerRect.center() - QPoint(iconRect.width()/2, iconRect.height()/2);
......@@ -261,11 +261,11 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
QStyleOption opt;
opt.initFrom(this);
opt.rect = rect().adjusted(rect().width() - 16, 0, -8, 0);
Utils::StyleHelper::drawArrow(QStyle::PE_IndicatorArrowRight, &painter, &opt);
StyleHelper::drawArrow(QStyle::PE_IndicatorArrowRight, &painter, &opt);
}
} else {
iconRect.moveCenter(rect().center());
Utils::StyleHelper::drawIconWithShadow(icon(), iconRect, &painter, isEnabled() ? QIcon::Normal : QIcon::Disabled);
StyleHelper::drawIconWithShadow(icon(), iconRect, &painter, isEnabled() ? QIcon::Normal : QIcon::Disabled);
}
}
......@@ -279,8 +279,8 @@ void FancyActionBar::paintEvent(QPaintEvent *event)
painter.fillRect(event->rect(), creatorTheme()->color(Theme::FancyTabBarBackgroundColor));
}
QColor light = Utils::StyleHelper::sidebarHighlight();
QColor dark = Utils::StyleHelper::sidebarShadow();
QColor light = StyleHelper::sidebarHighlight();
QColor dark = StyleHelper::sidebarShadow();
painter.setPen(dark);
painter.drawLine(rect().topLeft(), rect().topRight());
painter.setPen(light);
......@@ -292,7 +292,7 @@ QSize FancyToolButton::sizeHint() const
QSizeF buttonSize = iconSize().expandedTo(QSize(64, 38));
if (defaultAction()->property("titledAction").toBool()) {
QFont boldFont(font());
boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
boldFont.setBold(true);
QFontMetrics fm(boldFont);
qreal lineHeight = fm.height();
......
......@@ -100,7 +100,7 @@ FancyTabBar::~FancyTabBar()
QSize FancyTabBar::tabSizeHint(bool minimum) const
{
QFont boldFont(font());
boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
boldFont.setBold(true);
QFontMetrics fm(boldFont);
int spacing = 8;
......@@ -288,13 +288,13 @@ void FancyTabBar::paintTab(QPainter *painter, int tabIndex) const
QRect tabIconRect(tabTextRect);
tabTextRect.translate(0, drawIcon ? -2 : 1);
QFont boldFont(painter->font());
boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
boldFont.setBold(true);
painter->setFont(boldFont);
painter->setPen(selected ? QColor(255, 255, 255, 160) : QColor(0, 0, 0, 110));
const int textFlags = Qt::AlignCenter | (drawIcon ? Qt::AlignBottom : Qt::AlignVCenter) | Qt::TextWordWrap;
if (!Utils::HostOsInfo::isMacHost() && !selected && enabled) {
if (!HostOsInfo::isMacHost() && !selected && enabled) {
painter->save();
int fader = int(m_tabs[tabIndex]->fader());
if (creatorTheme()->widgetStyle() == Theme::StyleFlat) {
......@@ -320,7 +320,7 @@ void FancyTabBar::paintTab(QPainter *painter, int tabIndex) const
if (drawIcon) {
int textHeight = painter->fontMetrics().boundingRect(QRect(0, 0, width(), height()), Qt::TextWordWrap, tabText).height();
tabIconRect.adjust(0, 4, 0, -textHeight);
Utils::StyleHelper::drawIconWithShadow(tabIcon(tabIndex), tabIconRect, painter, enabled ? QIcon::Normal : QIcon::Disabled);
StyleHelper::drawIconWithShadow(tabIcon(tabIndex), tabIconRect, painter, enabled ? QIcon::Normal : QIcon::Disabled);
}
painter->setOpacity(1.0); //FIXME: was 0.7 before?
......@@ -386,9 +386,9 @@ public:
void mousePressEvent(QMouseEvent *ev)
{
if (ev->modifiers() & Qt::ShiftModifier) {
QColor color = QColorDialog::getColor(Utils::StyleHelper::requestedBaseColor(), m_parent);
QColor color = QColorDialog::getColor(StyleHelper::requestedBaseColor(), m_parent);
if (color.isValid())
Utils::StyleHelper::setBaseColor(color);
StyleHelper::setBaseColor(color);
}
}
private:
......@@ -409,7 +409,7 @@ FancyTabWidget::FancyTabWidget(QWidget *parent)
selectionLayout->setSpacing(0);
selectionLayout->setMargin(0);
Utils::StyledBar *bar = new Utils::StyledBar;
StyledBar *bar = new StyledBar;
QHBoxLayout *layout = new QHBoxLayout(bar);
layout->setMargin(0);
layout->setSpacing(0);
......@@ -490,11 +490,11 @@ void FancyTabWidget::paintEvent(QPaintEvent *event)
QRect rect = m_selectionWidget->rect().adjusted(0, 0, 1, 0);
rect = style()->visualRect(layoutDirection(), geometry(), rect);
Utils::StyleHelper::verticalGradient(&painter, rect, rect);
painter.setPen(Utils::StyleHelper::borderColor());
StyleHelper::verticalGradient(&painter, rect, rect);
painter.setPen(StyleHelper::borderColor());
painter.drawLine(rect.topRight(), rect.bottomRight());
QColor light = Utils::StyleHelper::sidebarHighlight();
QColor light = StyleHelper::sidebarHighlight();
painter.setPen(light);
painter.drawLine(rect.bottomLeft(), rect.bottomRight());
}
......
......@@ -323,7 +323,7 @@ ICore::ICore(MainWindow *mainwindow)
m_instance = this;
m_mainwindow = mainwindow;
// Save settings once after all plugins are initialized:
connect(ExtensionSystem::PluginManager::instance(), SIGNAL(initializationDone()),
connect(PluginManager::instance(), SIGNAL(initializationDone()),
this, SLOT(saveSettings()));
connect(m_mainwindow, SIGNAL(newItemDialogRunningChanged()),
this, SIGNAL(newItemDialogRunningChanged()));
......
......@@ -51,7 +51,7 @@ QList<LocatorFilterEntry> BasicLocatorFilterTest::matchesFor(const QString &sear
doBeforeLocatorRun();
const QList<ILocatorFilter *> filters = QList<ILocatorFilter *>() << m_filter;
m_filter->prepareSearch(searchText);
QFuture<LocatorFilterEntry> locatorSearch = QtConcurrent::run(Core::Internal::runSearch,
QFuture<LocatorFilterEntry> locatorSearch = QtConcurrent::run(Internal::runSearch,
filters, searchText);
locatorSearch.waitForFinished();
doAfterLocatorRun();
......
......@@ -250,11 +250,11 @@ MainWindow::~MainWindow()
delete m_windowSupport;
m_windowSupport = 0;
ExtensionSystem::PluginManager::removeObject(m_shortcutSettings);
ExtensionSystem::PluginManager::removeObject(m_generalSettings);
ExtensionSystem::PluginManager::removeObject(m_toolSettings);
ExtensionSystem::PluginManager::removeObject(m_mimeTypeSettings);
ExtensionSystem::PluginManager::removeObject(m_systemEditor);
PluginManager::removeObject(m_shortcutSettings);
PluginManager::removeObject(m_generalSettings);
PluginManager::removeObject(m_toolSettings);
PluginManager::removeObject(m_mimeTypeSettings);
PluginManager::removeObject(m_systemEditor);
delete m_externalToolManager;
m_externalToolManager = 0;
delete m_messageManager;
......@@ -280,7 +280,7 @@ MainWindow::~MainWindow()
OutputPaneManager::destroy();
// Now that the OutputPaneManager is gone, is a good time to delete the view
ExtensionSystem::PluginManager::removeObject(m_outputView);
PluginManager::removeObject(m_outputView);
delete m_outputView;
delete m_editorManager;
......@@ -289,7 +289,7 @@ MainWindow::~MainWindow()
m_progressManager = 0;
delete m_statusBarManager;
m_statusBarManager = 0;
ExtensionSystem::PluginManager::removeObject(m_coreImpl);
PluginManager::removeObject(m_coreImpl);
delete m_coreImpl;
m_coreImpl = 0;
......@@ -314,23 +314,23 @@ bool MainWindow::init(QString *errorMessage)
if (!MimeDatabase::addMimeTypes(QLatin1String(":/core/editormanager/BinFiles.mimetypes.xml"), errorMessage))
return false;
ExtensionSystem::PluginManager::addObject(m_coreImpl);
PluginManager::addObject(m_coreImpl);
m_statusBarManager->init();
m_modeManager->init();
m_progressManager->init(); // needs the status bar manager
ExtensionSystem::PluginManager::addObject(m_generalSettings);
ExtensionSystem::PluginManager::addObject(m_shortcutSettings);
ExtensionSystem::PluginManager::addObject(m_toolSettings);
ExtensionSystem::PluginManager::addObject(m_mimeTypeSettings);
ExtensionSystem::PluginManager::addObject(m_systemEditor);
PluginManager::addObject(m_generalSettings);
PluginManager::addObject(m_shortcutSettings);
PluginManager::addObject(m_toolSettings);
PluginManager::addObject(m_mimeTypeSettings);
PluginManager::addObject(m_systemEditor);
// Add widget to the bottom, we create the view here instead of inside the
// OutputPaneManager, since the StatusBarManager needs to be initialized before
m_outputView = new StatusBarWidget;
m_outputView->setWidget(OutputPaneManager::instance()->buttonsWidget());
m_outputView->setPosition(StatusBarWidget::Second);
ExtensionSystem::PluginManager::addObject(m_outputView);
PluginManager::addObject(m_outputView);
MessageManager::init();
return true;
}
......@@ -342,7 +342,7 @@ void MainWindow::extensionsInitialized()
m_statusBarManager->extensionsInitalized();
OutputPaneManager::instance()->init();
m_vcsManager->extensionsInitialized();
m_navigationWidget->setFactories(ExtensionSystem::PluginManager::getObjects<INavigationWidgetFactory>());
m_navigationWidget->setFactories(PluginManager::getObjects<INavigationWidgetFactory>());
readSettings();
updateContext();
......@@ -364,7 +364,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
}
const QList<ICoreListener *> listeners =
ExtensionSystem::PluginManager::getObjects<ICoreListener>();
PluginManager::getObjects<ICoreListener>();
foreach (ICoreListener *listener, listeners) {
if (!listener->coreAboutToClose()) {
event->ignore();
......@@ -773,7 +773,7 @@ static IDocumentFactory *findDocumentFactory(const QList<IDocumentFactory*> &fil
*/
IDocument *MainWindow::openFiles(const QStringList &fileNames, ICore::OpenFilesFlags flags)
{
QList<IDocumentFactory*> documentFactories = ExtensionSystem::PluginManager::getObjects<IDocumentFactory>();
QList<IDocumentFactory*> documentFactories = PluginManager::getObjects<IDocumentFactory>();
IDocument *res = 0;
foreach (const QString &fileName, fileNames) {
......
......@@ -82,7 +82,7 @@ bool panelWidget(const QWidget *widget)
if ((widget->window()->windowFlags() & Qt::WindowType_Mask) == Qt::Dialog)
return false;
if (qobject_cast<const Utils::FancyMainWindow *>(widget))
if (qobject_cast<const FancyMainWindow *>(widget))
return true;
if (qobject_cast<const QTabBar *>(widget))
......@@ -134,8 +134,8 @@ public:
};
ManhattanStylePrivate::ManhattanStylePrivate() :
lineeditImage(Utils::StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/inputfield.png"))),
lineeditImage_disabled(Utils::StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/inputfield_disabled.png"))),
lineeditImage(StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/inputfield.png"))),
lineeditImage_disabled(StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/inputfield_disabled.png"))),
extButtonPixmap(QLatin1String(":/core/images/extension.png")),
closeButtonPixmap(QLatin1String(Core::Constants::ICON_CLOSE_BUTTON))
{
......@@ -278,18 +278,18 @@ void ManhattanStyle::polish(QWidget *widget)
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
if (qobject_cast<QToolButton*>(widget)) {
widget->setAttribute(Qt::WA_Hover);
widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
} else if (qobject_cast<QLineEdit*>(widget)) {
widget->setAttribute(Qt::WA_Hover);
widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
} else if (qobject_cast<QLabel*>(widget)) {
widget->setPalette(panelPalette(widget->palette(), lightColored(widget)));
} else if (widget->property("panelwidget_singlerow").toBool()) {
widget->setFixedHeight(Utils::StyleHelper::navigationWidgetHeight());
widget->setFixedHeight(StyleHelper::navigationWidgetHeight());
} else if (qobject_cast<QStatusBar*>(widget)) {
widget->setFixedHeight(Utils::StyleHelper::navigationWidgetHeight() + 2);
widget->setFixedHeight(StyleHelper::navigationWidgetHeight() + 2);
} else if (qobject_cast<QComboBox*>(widget)) {
widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
widget->setAttribute(Qt::WA_Hover);
}
}
......@@ -456,12 +456,12 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
painter->fillRect(filledRect, option->palette.base());
if (option->state & State_Enabled)
Utils::StyleHelper::drawCornerImage(d->lineeditImage, painter, option->rect, 5, 5, 5, 5);
StyleHelper::drawCornerImage(d->lineeditImage, painter, option->rect, 5, 5, 5, 5);
else
Utils::StyleHelper::drawCornerImage(d->lineeditImage_disabled, painter, option->rect, 5, 5, 5, 5);
StyleHelper::drawCornerImage(d->lineeditImage_disabled, painter, option->rect, 5, 5, 5, 5);
if (option->state & State_HasFocus || option->state & State_MouseOver) {
QColor hover = Utils::StyleHelper::baseColor();
QColor hover = StyleHelper::baseColor();
if (state & State_HasFocus)
hover.setAlpha(100);
else
......@@ -518,12 +518,12 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
{
if (creatorTheme()->widgetStyle() == Theme::StyleDefault) {
painter->save();
QLinearGradient grad = Utils::StyleHelper::statusBarGradient(rect);
QLinearGradient grad = StyleHelper::statusBarGradient(rect);
painter->fillRect(rect, grad);
painter->setPen(QColor(255, 255, 255, 60));
painter->drawLine(rect.topLeft() + QPoint(0,1),
rect.topRight()+ QPoint(0,1));
painter->setPen(Utils::StyleHelper::borderColor().darker(110)); //TODO: make themable
painter->setPen(StyleHelper::borderColor().darker(110)); //TODO: make themable
painter->drawLine(rect.topLeft(), rect.topRight());
painter->restore();
} else {
......@@ -534,7 +534,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
case PE_IndicatorToolBarSeparator:
{
QColor separatorColor = Utils::StyleHelper::borderColor();
QColor separatorColor = StyleHelper::borderColor();
separatorColor.setAlpha(100);
painter->setPen(separatorColor);
const int margin = 6;
......@@ -578,10 +578,10 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
}
painter->setPen(Qt::NoPen);
QColor dark = Utils::StyleHelper::borderColor();
QColor dark = StyleHelper::borderColor();
dark.setAlphaF(0.4);
QColor light = Utils::StyleHelper::baseColor();
QColor light = StyleHelper::baseColor();
light.setAlphaF(0.4);
painter->fillPath(path, light);
......@@ -601,7 +601,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
case PE_IndicatorArrowRight:
case PE_IndicatorArrowLeft:
{
Utils::StyleHelper::drawArrow(element, painter, option);
StyleHelper::drawArrow(element, painter, option);
}
break;
......@@ -622,7 +622,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
if (creatorTheme()->widgetStyle() == Theme::StyleFlat)
painter->fillRect(option->rect, creatorTheme()->color(Theme::BackgroundColorSelected));
else
painter->fillRect(option->rect, Utils::StyleHelper::borderColor());
painter->fillRect(option->rect, StyleHelper::borderColor());
break;
case CE_TabBarTabShape:
......@@ -648,14 +648,14 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
case CE_MenuBarItem:
painter->save();
if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
QColor highlightOutline = Utils::StyleHelper::borderColor().lighter(120);
QColor highlightOutline = StyleHelper::borderColor().lighter(120);
const bool act = mbi->state & (State_Sunken | State_Selected);
const bool dis = !(mbi->state & State_Enabled);
if (creatorTheme()->widgetStyle() == Theme::StyleFlat)
painter->fillRect(option->rect, creatorTheme()->color(Theme::MenuBarItemBackgroundColor));
else
Utils::StyleHelper::menuGradient(painter, option->rect, option->rect);
StyleHelper::menuGradient(painter, option->rect, option->rect);
QStyleOptionMenuItem item = *mbi;
item.rect = mbi->rect;
......@@ -668,7 +668,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
if (act) {
// Fill|
QColor baseColor = Utils::StyleHelper::baseColor();
QColor baseColor = StyleHelper::baseColor();
QLinearGradient grad(option->rect.topLeft(), option->rect.bottomLeft());
grad.setColorAt(0, baseColor.lighter(120));
grad.setColorAt(1, baseColor.lighter(130));
......@@ -795,9 +795,9 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
case CE_MenuBarEmptyArea: {
if (creatorTheme()->widgetStyle() == Theme::StyleDefault) {
Utils::StyleHelper::menuGradient(painter, option->rect, option->rect);
StyleHelper::menuGradient(painter, option->rect, option->rect);
painter->save();
painter->setPen(Utils::StyleHelper::borderColor());
painter->setPen(StyleHelper::borderColor());
painter->drawLine(option->rect.bottomLeft() + QPointF(0.5, 0.5),
option->rect.bottomRight() + QPointF(0.5, 0.5));
painter->restore();
......@@ -827,16 +827,16 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
if (creatorTheme()->widgetStyle() == Theme::StyleFlat)