forked from qt-creator/qt-creator
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: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -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)
|
||||
painter->fillRect (rect, creatorTheme()->color(Theme::ToolBarBackgroundColor));
|
||||
else
|
||||
Utils::StyleHelper::horizontalGradient(painter, gradientSpan, rect, drawLightColored);
|
||||
StyleHelper::horizontalGradient(painter, gradientSpan, rect, drawLightColored);
|
||||
} else {
|
||||
if (creatorTheme()->widgetStyle() == Theme::StyleFlat)
|
||||
painter->fillRect (rect, creatorTheme()->color(Theme::ToolBarBackgroundColor));
|
||||
else
|
||||
Utils::StyleHelper::verticalGradient(painter, gradientSpan, rect, drawLightColored);
|
||||
StyleHelper::verticalGradient(painter, gradientSpan, rect, drawLightColored);
|
||||
}
|
||||
|
||||
if (!drawLightColored) {
|
||||
painter->setPen(Utils::StyleHelper::borderColor());
|
||||
painter->setPen(StyleHelper::borderColor());
|
||||
}
|
||||
else
|
||||
painter->setPen(QColor(0x888888));
|
||||
@@ -845,7 +845,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
// Note: This is a hack to determine if the
|
||||
// toolbar should draw the top or bottom outline
|
||||
// (needed for the find toolbar for instance)
|
||||
QColor lighter(Utils::StyleHelper::sidebarHighlight());
|
||||
QColor lighter(StyleHelper::sidebarHighlight());
|
||||
if (drawLightColored)
|
||||
lighter = QColor(255, 255, 255, 180);
|
||||
if (widget && widget->property("topBorder").toBool()) {
|
||||
@@ -931,7 +931,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
||||
if (mflags & (State_Sunken)) {
|
||||
QColor shade(0, 0, 0, 50);
|
||||
painter->fillRect(tool.rect.adjusted(0, -1, 1, 1), shade);
|
||||
} else if (!Utils::HostOsInfo::isMacHost() && (mflags & State_MouseOver)) {
|
||||
} else if (!HostOsInfo::isMacHost() && (mflags & State_MouseOver)) {
|
||||
QColor shade(255, 255, 255, 50);
|
||||
painter->fillRect(tool.rect.adjusted(0, -1, 1, 1), shade);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ MessageManager::MessageManager()
|
||||
{
|
||||
m_instance = this;
|
||||
m_messageOutputWindow = 0;
|
||||
qRegisterMetaType<Core::MessageManager::PrintToOutputPaneFlags>();
|
||||
qRegisterMetaType<MessageManager::PrintToOutputPaneFlags>();
|
||||
}
|
||||
|
||||
MessageManager::~MessageManager()
|
||||
|
||||
@@ -158,12 +158,12 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
|
||||
QVBoxLayout *mainlayout = new QVBoxLayout;
|
||||
mainlayout->setSpacing(0);
|
||||
mainlayout->setMargin(0);
|
||||
m_toolBar = new Utils::StyledBar;
|
||||
m_toolBar = new StyledBar;
|
||||
QHBoxLayout *toolLayout = new QHBoxLayout(m_toolBar);
|
||||
toolLayout->setMargin(0);
|
||||
toolLayout->setSpacing(0);
|
||||
toolLayout->addWidget(m_titleLabel);
|
||||
toolLayout->addWidget(new Utils::StyledSeparator);
|
||||
toolLayout->addWidget(new StyledSeparator);
|
||||
m_clearButton = new QToolButton;
|
||||
toolLayout->addWidget(m_clearButton);
|
||||
m_prevToolButton = new QToolButton;
|
||||
@@ -196,7 +196,7 @@ QWidget *OutputPaneManager::buttonsWidget()
|
||||
// Return shortcut as Ctrl+<number>
|
||||
static inline int paneShortCut(int number)
|
||||
{
|
||||
const int modifier = Utils::HostOsInfo::isMacHost() ? Qt::CTRL : Qt::ALT;
|
||||
const int modifier = HostOsInfo::isMacHost() ? Qt::CTRL : Qt::ALT;
|
||||
return modifier | (Qt::Key_0 + number);
|
||||
}
|
||||
|
||||
@@ -662,11 +662,11 @@ QSize OutputPaneToggleButton::sizeHint() const
|
||||
|
||||
void OutputPaneToggleButton::paintEvent(QPaintEvent*)
|
||||
{
|
||||
static const QImage panelButton(Utils::StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_button.png")));
|
||||
static const QImage panelButtonHover(Utils::StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_button_hover.png")));
|
||||
static const QImage panelButtonPressed(Utils::StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_button_pressed.png")));
|
||||
static const QImage panelButtonChecked(Utils::StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_button_checked.png")));
|
||||
static const QImage panelButtonCheckedHover(Utils::StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_button_checked_hover.png")));
|
||||
static const QImage panelButton(StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_button.png")));
|
||||
static const QImage panelButtonHover(StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_button_hover.png")));
|
||||
static const QImage panelButtonPressed(StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_button_pressed.png")));
|
||||
static const QImage panelButtonChecked(StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_button_checked.png")));
|
||||
static const QImage panelButtonCheckedHover(StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_button_checked_hover.png")));
|
||||
|
||||
const QFontMetrics fm = fontMetrics();
|
||||
const int baseLine = (height() - fm.height() + 1) / 2 + fm.ascent();
|
||||
@@ -676,7 +676,7 @@ void OutputPaneToggleButton::paintEvent(QPaintEvent*)
|
||||
|
||||
QStyleOption styleOption;
|
||||
styleOption.initFrom(this);
|
||||
const bool hovered = !Utils::HostOsInfo::isMacHost() && (styleOption.state & QStyle::State_MouseOver);
|
||||
const bool hovered = !HostOsInfo::isMacHost() && (styleOption.state & QStyle::State_MouseOver);
|
||||
|
||||
const QImage *image = 0;
|
||||
if (creatorTheme()->widgetStyle() == Theme::StyleDefault) {
|
||||
@@ -687,7 +687,7 @@ void OutputPaneToggleButton::paintEvent(QPaintEvent*)
|
||||
else
|
||||
image = hovered ? &panelButtonHover : &panelButton;
|
||||
if (image)
|
||||
Utils::StyleHelper::drawCornerImage(*image, &p, rect(), numberAreaWidth, buttonBorderWidth, buttonBorderWidth, buttonBorderWidth);
|
||||
StyleHelper::drawCornerImage(*image, &p, rect(), numberAreaWidth, buttonBorderWidth, buttonBorderWidth, buttonBorderWidth);
|
||||
} else {
|
||||
QColor c;
|
||||
if (isChecked()) {
|
||||
@@ -775,8 +775,8 @@ void OutputPaneManageButton::paintEvent(QPaintEvent*)
|
||||
{
|
||||
QPainter p(this);
|
||||
if (creatorTheme()->widgetStyle() == Theme::StyleDefault) {
|
||||
static const QImage button(Utils::StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_manage_button.png")));
|
||||
Utils::StyleHelper::drawCornerImage(button, &p, rect(), buttonBorderWidth, buttonBorderWidth, buttonBorderWidth, buttonBorderWidth);
|
||||
static const QImage button(StyleHelper::dpiSpecificImageFile(QStringLiteral(":/core/images/panel_manage_button.png")));
|
||||
StyleHelper::drawCornerImage(button, &p, rect(), buttonBorderWidth, buttonBorderWidth, buttonBorderWidth, buttonBorderWidth);
|
||||
}
|
||||
QStyle *s = style();
|
||||
QStyleOption arrowOpt;
|
||||
|
||||
@@ -203,7 +203,7 @@ void OutputWindow::setMaxLineCount(int count)
|
||||
|
||||
void OutputWindow::appendMessage(const QString &output, OutputFormat format)
|
||||
{
|
||||
const QString out = Utils::SynchronousProcess::normalizeNewlines(output);
|
||||
const QString out = SynchronousProcess::normalizeNewlines(output);
|
||||
setMaximumBlockCount(m_maxLineCount);
|
||||
const bool atBottom = isScrollbarAtBottom();
|
||||
|
||||
@@ -253,7 +253,7 @@ void OutputWindow::appendMessage(const QString &output, OutputFormat format)
|
||||
// TODO rename
|
||||
void OutputWindow::appendText(const QString &textIn, const QTextCharFormat &format)
|
||||
{
|
||||
const QString text = Utils::SynchronousProcess::normalizeNewlines(textIn);
|
||||
const QString text = SynchronousProcess::normalizeNewlines(textIn);
|
||||
if (m_maxLineCount > 0 && document()->blockCount() >= m_maxLineCount)
|
||||
return;
|
||||
const bool atBottom = isScrollbarAtBottom();
|
||||
|
||||
@@ -301,7 +301,7 @@ void FutureProgress::paintEvent(QPaintEvent *)
|
||||
if (creatorTheme()->widgetStyle() == Theme::StyleFlat) {
|
||||
p.fillRect(rect(), creatorTheme()->color(Theme::FutureProgressBackgroundColor));
|
||||
} else {
|
||||
QLinearGradient grad = Utils::StyleHelper::statusBarGradient(rect());
|
||||
QLinearGradient grad = StyleHelper::statusBarGradient(rect());
|
||||
p.fillRect(rect(), grad);
|
||||
}
|
||||
}
|
||||
@@ -379,7 +379,7 @@ void FutureProgressPrivate::fadeAway()
|
||||
|
||||
QSequentialAnimationGroup *group = new QSequentialAnimationGroup(this);
|
||||
QPropertyAnimation *animation = new QPropertyAnimation(opacityEffect, "opacity");
|
||||
animation->setDuration(Utils::StyleHelper::progressFadeAnimationDuration);
|
||||
animation->setDuration(StyleHelper::progressFadeAnimationDuration);
|
||||
animation->setEndValue(0.);
|
||||
group->addAnimation(animation);
|
||||
animation = new QPropertyAnimation(m_q, "maximumHeight");
|
||||
|
||||
@@ -216,7 +216,7 @@ void ProgressBar::mousePressEvent(QMouseEvent *event)
|
||||
QFont ProgressBar::titleFont() const
|
||||
{
|
||||
QFont boldFont(font());
|
||||
boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
|
||||
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
|
||||
boldFont.setBold(true);
|
||||
return boldFont;
|
||||
}
|
||||
@@ -232,7 +232,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
||||
// TODO use Utils::StyleHelper white
|
||||
|
||||
if (bar.isNull())
|
||||
bar.load(Utils::StyleHelper::dpiSpecificImageFile(QLatin1String(":/core/images/progressbar.png")));
|
||||
bar.load(StyleHelper::dpiSpecificImageFile(QLatin1String(":/core/images/progressbar.png")));
|
||||
|
||||
double range = maximum() - minimum();
|
||||
double percent = 0.;
|
||||
@@ -256,10 +256,10 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
||||
// Draw separator
|
||||
int separatorHeight = m_separatorVisible ? SEPARATOR_HEIGHT : 0;
|
||||
if (m_separatorVisible) {
|
||||
p.setPen(Utils::StyleHelper::sidebarShadow());
|
||||
p.setPen(StyleHelper::sidebarShadow());
|
||||
p.drawLine(0,0, size().width(), 0);
|
||||
|
||||
p.setPen(Utils::StyleHelper::sidebarHighlight());
|
||||
p.setPen(StyleHelper::sidebarHighlight());
|
||||
p.drawLine(1, 1, size().width(), 1);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
||||
size().width() - 2 * INDENT + 1, m_progressHeight);
|
||||
|
||||
if (creatorTheme()->flag(Theme::DrawProgressBarSunken))
|
||||
Utils::StyleHelper::drawCornerImage(bar, &p, rect, 3, 3, 3, 3);
|
||||
StyleHelper::drawCornerImage(bar, &p, rect, 3, 3, 3, 3);
|
||||
|
||||
// draw inner rect
|
||||
QColor c = creatorTheme()->color(Theme::ProgressBarColorNormal);
|
||||
@@ -357,7 +357,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
||||
p.drawLine(cancelVisualRect.topLeft() + QPointF(0.5, 0.5), cancelVisualRect.bottomLeft() + QPointF(0.5, -0.5));
|
||||
p.setPen(QPen(QColor(255, 255, 255, 30)));
|
||||
p.drawLine(cancelVisualRect.topLeft() + QPointF(1.5, 0.5), cancelVisualRect.bottomLeft() + QPointF(1.5, -0.5));
|
||||
p.setPen(QPen(hover ? Utils::StyleHelper::panelTextColor() : QColor(180, 180, 180), 1.2, Qt::SolidLine, Qt::FlatCap));
|
||||
p.setPen(QPen(hover ? StyleHelper::panelTextColor() : QColor(180, 180, 180), 1.2, Qt::SolidLine, Qt::FlatCap));
|
||||
p.setRenderHint(QPainter::Antialiasing, true);
|
||||
p.drawLine(cancelVisualRect.topLeft() + QPointF(4.0, 2.0), cancelVisualRect.bottomRight() + QPointF(-3.0, -2.0));
|
||||
p.drawLine(cancelVisualRect.bottomLeft() + QPointF(4.0, -2.0), cancelVisualRect.topRight() + QPointF(-3.0, 2.0));
|
||||
|
||||
@@ -343,7 +343,7 @@ void ProgressManagerPrivate::init()
|
||||
Command *cmd = ActionManager::registerAction(toggleProgressView,
|
||||
"QtCreator.ToggleProgressDetails",
|
||||
Context(Constants::C_GLOBAL));
|
||||
cmd->setDefaultKeySequence(QKeySequence(Utils::HostOsInfo::isMacHost()
|
||||
cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost()
|
||||
? tr("Ctrl+Shift+0")
|
||||
: tr("Alt+Shift+0")));
|
||||
connect(toggleProgressView, SIGNAL(toggled(bool)), this, SLOT(progressDetailsToggled(bool)));
|
||||
@@ -532,7 +532,7 @@ void ProgressManagerPrivate::fadeAwaySummaryProgress()
|
||||
{
|
||||
stopFadeOfSummaryProgress();
|
||||
m_opacityAnimation = new QPropertyAnimation(m_opacityEffect, "opacity");
|
||||
m_opacityAnimation->setDuration(Utils::StyleHelper::progressFadeAnimationDuration);
|
||||
m_opacityAnimation->setDuration(StyleHelper::progressFadeAnimationDuration);
|
||||
m_opacityAnimation->setEndValue(0.);
|
||||
connect(m_opacityAnimation, SIGNAL(finished()), this, SLOT(summaryProgressFinishedFading()));
|
||||
m_opacityAnimation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||
@@ -725,7 +725,7 @@ void ToggleButton::paintEvent(QPaintEvent *event)
|
||||
QStyleOption arrowOpt;
|
||||
arrowOpt.initFrom(this);
|
||||
arrowOpt.rect.adjust(2, 0, -1, -2);
|
||||
Utils::StyleHelper::drawArrow(QStyle::PE_IndicatorArrowUp, &p, &arrowOpt);
|
||||
StyleHelper::drawArrow(QStyle::PE_IndicatorArrowUp, &p, &arrowOpt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
setIndentation(indentation() * 7/10);
|
||||
header()->hide();
|
||||
new Utils::HeaderViewStretcher(header(), 0);
|
||||
new HeaderViewStretcher(header(), 0);
|
||||
}
|
||||
|
||||
void contextMenuEvent(QContextMenuEvent *ev);
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
|
||||
void createIconButton()
|
||||
{
|
||||
m_iconButton = new Utils::IconButton;
|
||||
m_iconButton = new IconButton;
|
||||
m_iconButton->setPixmap(QPixmap(QLatin1String(":/core/images/replace.png")));
|
||||
m_iconButton->setToolTip(tr("Insert variable"));
|
||||
m_iconButton->hide();
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
QPointer<QLineEdit> m_lineEdit;
|
||||
QPointer<QTextEdit> m_textEdit;
|
||||
QPointer<QPlainTextEdit> m_plainTextEdit;
|
||||
QPointer<Utils::IconButton> m_iconButton;
|
||||
QPointer<IconButton> m_iconButton;
|
||||
|
||||
VariableTreeView *m_variableTree;
|
||||
QLabel *m_variableDescription;
|
||||
|
||||
Reference in New Issue
Block a user