Commit 0f18d7aa authored by hjk's avatar hjk
Browse files

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents fe0533de 8c591607
......@@ -67,5 +67,6 @@
<file>images/undo.png</file>
<file>images/unknownfile.png</file>
<file>images/unlocked.png</file>
<file>images/extension.png</file>
</qresource>
</RCC>
src/plugins/coreplugin/images/linkicon.png

230 Bytes | W: | H:

src/plugins/coreplugin/images/linkicon.png

592 Bytes | W: | H:

src/plugins/coreplugin/images/linkicon.png
src/plugins/coreplugin/images/linkicon.png
src/plugins/coreplugin/images/linkicon.png
src/plugins/coreplugin/images/linkicon.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -152,6 +152,24 @@ MainWindow::MainWindow() :
setWindowTitle(tr("Qt Creator"));
qApp->setWindowIcon(QIcon(":/core/images/qtcreator_logo_128.png"));
QCoreApplication::setApplicationName(QLatin1String("QtCreator"));
QCoreApplication::setApplicationVersion(QLatin1String(Core::Constants::IDE_VERSION_LONG));
QCoreApplication::setOrganizationName(QLatin1String("Nokia"));
QSettings::setDefaultFormat(QSettings::IniFormat);
QString baseName = qApp->style()->objectName();
#ifdef Q_WS_X11
if (baseName == "windows") {
// Sometimes we get the standard windows 95 style as a fallback
// e.g. if we are running on a KDE4 desktop
QByteArray desktopEnvironment = qgetenv("DESKTOP_SESSION");
if (desktopEnvironment == "kde")
baseName = "plastique";
else
baseName = "cleanlooks";
}
#endif
qApp->setStyle(new ManhattanStyle(baseName));
setDockNestingEnabled(true);
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
......@@ -183,23 +201,6 @@ MainWindow::MainWindow() :
//signal(SIGINT, handleSigInt);
#endif
QCoreApplication::setApplicationName(QLatin1String("QtCreator"));
QCoreApplication::setApplicationVersion(QLatin1String(Core::Constants::IDE_VERSION_LONG));
QCoreApplication::setOrganizationName(QLatin1String("Nokia"));
QSettings::setDefaultFormat(QSettings::IniFormat);
QString baseName = qApp->style()->objectName();
#ifdef Q_WS_X11
if (baseName == "windows") {
// Sometimes we get the standard windows 95 style as a fallback
// e.g. if we are running on a KDE4 desktop
QByteArray desktopEnvironment = qgetenv("DESKTOP_SESSION");
if (desktopEnvironment == "kde")
baseName = "plastique";
else
baseName = "cleanlooks";
}
#endif
qApp->setStyle(new ManhattanStyle(baseName));
statusBar()->setProperty("p_styled", true);
}
......
......@@ -345,12 +345,11 @@ void ManhattanStyle::polish(QPalette &pal)
QIcon ManhattanStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option,
const QWidget *widget) const
{
static const QIcon closeButton(":/core/images/closebutton.png");
QIcon icon;
switch (standardIcon) {
case QStyle::SP_TitleBarCloseButton:
icon = closeButton;
break;
case QStyle::SP_ToolBarHorizontalExtensionButton:
return QIcon(standardPixmap(standardIcon, option, widget));
default:
icon = d->style->standardIcon(standardIcon, option, widget);
}
......@@ -360,11 +359,20 @@ QIcon ManhattanStyle::standardIconImplementation(StandardPixmap standardIcon, co
QPixmap ManhattanStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
const QWidget *widget) const
{
static const QPixmap closeButton(":/core/images/closebutton.png");
if (widget && !panelWidget(widget))
return d->style->standardPixmap(standardPixmap, opt, widget);
QPixmap pixmap;
switch (standardPixmap) {
case QStyle::SP_TitleBarCloseButton:
pixmap = closeButton;
case QStyle::SP_ToolBarHorizontalExtensionButton: {
static const QPixmap extButton(":/core/images/extension.png");
pixmap = extButton;
}
break;
case QStyle::SP_TitleBarCloseButton: {
static const QPixmap closeButton(":/core/images/closebutton.png");
pixmap = closeButton;
}
break;
default:
pixmap = d->style->standardPixmap(standardPixmap, opt, widget);
......@@ -593,6 +601,84 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
painter->restore();
}
break;
case PE_IndicatorArrowUp:
case PE_IndicatorArrowDown:
case PE_IndicatorArrowRight:
case PE_IndicatorArrowLeft:
{
// From windowsstyle but modified to enable AA
if (option->rect.width() <= 1 || option->rect.height() <= 1)
break;
QRect r = option->rect;
int size = qMin(r.height(), r.width());
QPixmap pixmap;
QString pixmapName;
pixmapName.sprintf("%s-%s-%d-%d-%d-%lld",
"$qt_ia", metaObject()->className(),
uint(option->state), element,
size, option->palette.cacheKey());
if (!QPixmapCache::find(pixmapName, pixmap)) {
int border = size/5;
int sqsize = 2*(size/2);
QImage image(sqsize, sqsize, QImage::Format_ARGB32);
image.fill(Qt::transparent);
QPainter imagePainter(&image);
imagePainter.setRenderHint(QPainter::Antialiasing, true);
imagePainter.translate(0.5, 0.5);
QPolygon a;
switch (element) {
case PE_IndicatorArrowUp:
a.setPoints(3, border, sqsize/2, sqsize/2, border, sqsize - border, sqsize/2);
break;
case PE_IndicatorArrowDown:
a.setPoints(3, border, sqsize/2, sqsize/2, sqsize - border, sqsize - border, sqsize/2);
break;
case PE_IndicatorArrowRight:
a.setPoints(3, sqsize - border, sqsize/2, sqsize/2, border, sqsize/2, sqsize - border);
break;
case PE_IndicatorArrowLeft:
a.setPoints(3, border, sqsize/2, sqsize/2, border, sqsize/2, sqsize - border);
break;
default:
break;
}
int bsx = 0;
int bsy = 0;
if (option->state & State_Sunken) {
bsx = pixelMetric(PM_ButtonShiftHorizontal);
bsy = pixelMetric(PM_ButtonShiftVertical);
}
QRect bounds = a.boundingRect();
int sx = sqsize / 2 - bounds.center().x() - 1;
int sy = sqsize / 2 - bounds.center().y() - 1;
imagePainter.translate(sx + bsx, sy + bsy);
imagePainter.setPen(option->palette.buttonText().color());
imagePainter.setBrush(option->palette.buttonText());
if (!(option->state & State_Enabled)) {
imagePainter.translate(1, 1);
imagePainter.setBrush(option->palette.light().color());
imagePainter.setPen(option->palette.light().color());
imagePainter.drawPolygon(a);
imagePainter.translate(-1, -1);
imagePainter.setBrush(option->palette.mid().color());
imagePainter.setPen(option->palette.mid().color());
}
imagePainter.drawPolygon(a);
imagePainter.end();
pixmap = QPixmap::fromImage(image);
QPixmapCache::insert(pixmapName, pixmap);
}
int xOffset = r.x() + (r.width() - size)/2;
int yOffset = r.y() + (r.height() - size)/2;
painter->drawPixmap(xOffset, yOffset, pixmap);
}
break;
default:
d->style->drawPrimitive(element, option, painter, widget);
......@@ -902,7 +988,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
newBtn.palette = panelPalette(option->palette);
newBtn.rect = QRect(ir.right() - arrowSize - 1,
ir.height() - arrowSize - 2, arrowSize, arrowSize);
QWindowsStyle::drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget);
drawPrimitive(PE_IndicatorArrowDown, &newBtn, painter, widget);
}
}
break;
......@@ -929,7 +1015,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
pal.setBrush(QPalette::All, QPalette::ButtonText, StyleHelper::panelTextColor());
arrowOpt.palette = pal;
QWindowsStyle::drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget);
drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget);
painter->restore();
}
......
......@@ -435,15 +435,15 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
m_startPosition = findStartOfName(editor);
m_completionOperator = T_EOF_SYMBOL;
int endOfExpression = m_startPosition;
int endOfOperator = m_startPosition;
// Skip whitespace preceding this position
while (editor->characterAt(endOfExpression - 1).isSpace())
--endOfExpression;
while (editor->characterAt(endOfOperator - 1).isSpace())
--endOfOperator;
endOfExpression = startOfOperator(editor, endOfExpression,
&m_completionOperator,
/*want function call =*/ editor->position() == endOfExpression);
int endOfExpression = startOfOperator(editor, endOfOperator,
&m_completionOperator,
/*want function call =*/ true);
Core::IFile *file = editor->file();
QString fileName = file->fileName();
......@@ -464,6 +464,11 @@ int CppCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
m_completionOperator = T_SIGNAL;
else if (expression.endsWith(QLatin1String("SLOT")))
m_completionOperator = T_SLOT;
else if (editor->position() != endOfOperator) {
// We don't want a function completion when the cursor isn't at the opening brace
expression.clear();
m_completionOperator = T_EOF_SYMBOL;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment