forked from qt-creator/qt-creator
Merge branch '1.0.0' into master
Conflicts: src/plugins/coreplugin/manhattanstyle.cpp
This commit is contained in:
@@ -205,7 +205,7 @@ QSize ManhattanStyle::sizeFromContents(ContentsType type, const QStyleOption *op
|
|||||||
if (type == CT_Splitter && widget && widget->property("minisplitter").toBool())
|
if (type == CT_Splitter && widget && widget->property("minisplitter").toBool())
|
||||||
return QSize(1, 1);
|
return QSize(1, 1);
|
||||||
else if (type == CT_ComboBox && panelWidget(widget))
|
else if (type == CT_ComboBox && panelWidget(widget))
|
||||||
newSize += QSize(10, 0);
|
newSize += QSize(14, 0);
|
||||||
return newSize;
|
return newSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -503,31 +503,21 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
|||||||
QColor shadow(0, 0, 0, 30);
|
QColor shadow(0, 0, 0, 30);
|
||||||
painter->setPen(shadow);
|
painter->setPen(shadow);
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
QColor shade(0, 0, 0, 50);
|
QColor shade(0, 0, 0, 40);
|
||||||
if (option->state & State_Sunken)
|
painter->fillRect(rect, shade);
|
||||||
shade = QColor(0, 0, 0, 50);
|
painter->drawLine(rect.topLeft() + QPoint(1, 0), rect.topRight() - QPoint(1, 0));
|
||||||
#ifndef Q_WS_MAC
|
|
||||||
else if (option->state & State_MouseOver)
|
|
||||||
shade = QColor(255, 255, 255, 10);
|
|
||||||
#endif
|
|
||||||
else if (option->state & State_On)
|
|
||||||
shade = QColor(0, 0, 0, 50);
|
|
||||||
else
|
|
||||||
shade = QColor(0, 0, 0, 0);
|
|
||||||
painter->fillRect(rect.adjusted(1, 1, -1, -1), shade);
|
|
||||||
painter->drawLine(rect.topLeft(), rect.topRight());
|
|
||||||
painter->drawLine(rect.topLeft(), rect.bottomLeft());
|
painter->drawLine(rect.topLeft(), rect.bottomLeft());
|
||||||
|
painter->drawLine(rect.topRight(), rect.bottomRight());
|
||||||
|
// painter->drawLine(rect.bottomLeft() + QPoint(1, 0), rect.bottomRight() - QPoint(1, 0));
|
||||||
QColor highlight(255, 255, 255, 30);
|
QColor highlight(255, 255, 255, 30);
|
||||||
painter->setPen(highlight);
|
painter->setPen(highlight);
|
||||||
painter->drawLine(rect.topRight(), rect.bottomRight());
|
|
||||||
painter->drawLine(rect.bottomLeft(), rect.bottomRight());
|
|
||||||
}
|
}
|
||||||
else if (option->state & State_Enabled &&
|
else if (option->state & State_Enabled &&
|
||||||
option->state & State_MouseOver) {
|
option->state & State_MouseOver) {
|
||||||
QColor lighter(255, 255, 255, 35);
|
QColor lighter(255, 255, 255, 37);
|
||||||
painter->fillRect(rect, lighter);
|
painter->fillRect(rect, lighter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -670,11 +660,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
|
|||||||
imagePainter.translate(sx + bsx, sy + bsy);
|
imagePainter.translate(sx + bsx, sy + bsy);
|
||||||
|
|
||||||
if (!(option->state & State_Enabled)) {
|
if (!(option->state & State_Enabled)) {
|
||||||
imagePainter.translate(1, 1);
|
QColor foreGround(150, 150, 150, 150);
|
||||||
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.setBrush(option->palette.mid().color());
|
||||||
imagePainter.setPen(option->palette.mid().color());
|
imagePainter.setPen(option->palette.mid().color());
|
||||||
} else {
|
} else {
|
||||||
@@ -781,18 +767,19 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
|||||||
editRect.translate(-4 - cb->iconSize.width(), 0);
|
editRect.translate(-4 - cb->iconSize.width(), 0);
|
||||||
else
|
else
|
||||||
editRect.translate(cb->iconSize.width() + 4, 0);
|
editRect.translate(cb->iconSize.width() + 4, 0);
|
||||||
|
|
||||||
|
// Reserve some space for the down-arrow
|
||||||
|
editRect.adjust(0, 0, -13, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
customPal.setBrush(QPalette::All, QPalette::ButtonText, QColor(0, 0, 0, 70));
|
customPal.setBrush(QPalette::All, QPalette::ButtonText, QColor(0, 0, 0, 70));
|
||||||
|
|
||||||
// Reserve some space for the down-arrow
|
QString text = option->fontMetrics.elidedText(cb->currentText, Qt::ElideRight, editRect.width());
|
||||||
QRect rect = editRect.adjusted(0, 0, -8, 0);
|
drawItemText(painter, editRect.translated(0, 1),
|
||||||
QString text = option->fontMetrics.elidedText(cb->currentText, Qt::ElideRight, rect.width());
|
|
||||||
drawItemText(painter, rect.translated(0, 1),
|
|
||||||
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
|
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
|
||||||
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
|
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
|
||||||
customPal.setBrush(QPalette::All, QPalette::ButtonText, StyleHelper::panelTextColor());
|
customPal.setBrush(QPalette::All, QPalette::ButtonText, StyleHelper::panelTextColor());
|
||||||
drawItemText(painter, rect,
|
drawItemText(painter, editRect,
|
||||||
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
|
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
|
||||||
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
|
customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
|
||||||
} else {
|
} else {
|
||||||
@@ -1015,8 +1002,10 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CC_ComboBox:
|
case CC_ComboBox:
|
||||||
{
|
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
|
||||||
painter->save();
|
painter->save();
|
||||||
|
bool isEmpty = cb->currentText.isEmpty() && cb->currentIcon.isNull();
|
||||||
|
bool reverse = option->direction == Qt::RightToLeft;
|
||||||
|
|
||||||
// Draw tool button
|
// Draw tool button
|
||||||
QLinearGradient grad(option->rect.topRight(), option->rect.bottomRight());
|
QLinearGradient grad(option->rect.topRight(), option->rect.bottomRight());
|
||||||
@@ -1026,28 +1015,36 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
|||||||
grad.setColorAt(1, QColor(255, 255, 255, 40));
|
grad.setColorAt(1, QColor(255, 255, 255, 40));
|
||||||
painter->setPen(QPen(grad, 0));
|
painter->setPen(QPen(grad, 0));
|
||||||
painter->drawLine(rect.topRight(), rect.bottomRight());
|
painter->drawLine(rect.topRight(), rect.bottomRight());
|
||||||
grad.setColorAt(0, QColor(0, 0, 0, 20));
|
grad.setColorAt(0, QColor(0, 0, 0, 30));
|
||||||
grad.setColorAt(0.4, QColor(0, 0, 0, 70));
|
grad.setColorAt(0.4, QColor(0, 0, 0, 70));
|
||||||
grad.setColorAt(0.7, QColor(0, 0, 0, 70));
|
grad.setColorAt(0.7, QColor(0, 0, 0, 70));
|
||||||
grad.setColorAt(1, QColor(0, 0, 0, 40));
|
grad.setColorAt(1, QColor(0, 0, 0, 40));
|
||||||
painter->setPen(QPen(grad, 0));
|
painter->setPen(QPen(grad, 0));
|
||||||
painter->drawLine(rect.topRight() - QPoint(1,0), rect.bottomRight() - QPoint(1,0));
|
if (!reverse)
|
||||||
|
painter->drawLine(rect.topRight() - QPoint(1,0), rect.bottomRight() - QPoint(1,0));
|
||||||
|
else
|
||||||
|
painter->drawLine(rect.topLeft(), rect.bottomLeft());
|
||||||
QStyleOption toolbutton = *option;
|
QStyleOption toolbutton = *option;
|
||||||
toolbutton.rect.adjust(0, 0, -2, 0);
|
if (isEmpty)
|
||||||
|
toolbutton.state &= ~(State_Enabled | State_Sunken);
|
||||||
|
painter->save();
|
||||||
|
painter->setClipRect(toolbutton.rect.adjusted(0, 0, -2, 0));
|
||||||
drawPrimitive(PE_PanelButtonTool, &toolbutton, painter, widget);
|
drawPrimitive(PE_PanelButtonTool, &toolbutton, painter, widget);
|
||||||
|
painter->restore();
|
||||||
// Draw arrow
|
// Draw arrow
|
||||||
int menuButtonWidth = 12;
|
int menuButtonWidth = 12;
|
||||||
bool reverse = option->direction == Qt::RightToLeft;
|
|
||||||
int left = !reverse ? rect.right() - menuButtonWidth : rect.left();
|
int left = !reverse ? rect.right() - menuButtonWidth : rect.left();
|
||||||
int right = !reverse ? rect.right() : rect.left() + menuButtonWidth;
|
int right = !reverse ? rect.right() : rect.left() + menuButtonWidth;
|
||||||
QRect arrowRect((left + right) / 2 - 5, rect.center().y() - 3, 9, 9);
|
QRect arrowRect((left + right) / 2 + (reverse ? 6 : -6), rect.center().y() - 3, 9, 9);
|
||||||
if (option->state & State_On)
|
if (option->state & State_On)
|
||||||
arrowRect.translate(d->style->pixelMetric(PM_ButtonShiftHorizontal, option, widget),
|
arrowRect.translate(d->style->pixelMetric(PM_ButtonShiftHorizontal, option, widget),
|
||||||
d->style->pixelMetric(PM_ButtonShiftVertical, option, widget));
|
d->style->pixelMetric(PM_ButtonShiftVertical, option, widget));
|
||||||
|
|
||||||
QStyleOption arrowOpt = *option;
|
QStyleOption arrowOpt = *option;
|
||||||
arrowOpt.rect = arrowRect;
|
arrowOpt.rect = arrowRect;
|
||||||
QPalette pal = option->palette;
|
if (isEmpty)
|
||||||
|
arrowOpt.state &= ~(State_Enabled | State_Sunken);
|
||||||
|
|
||||||
if (styleHint(SH_ComboBox_Popup, option, widget)) {
|
if (styleHint(SH_ComboBox_Popup, option, widget)) {
|
||||||
arrowOpt.rect.translate(0, -3);
|
arrowOpt.rect.translate(0, -3);
|
||||||
drawPrimitive(PE_IndicatorArrowUp, &arrowOpt, painter, widget);
|
drawPrimitive(PE_IndicatorArrowUp, &arrowOpt, painter, widget);
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
LD_LIBRARY_PATH=`cd .. && pwd`/lib ./qtlibspatcher
|
LD_LIBRARY_PATH=`cd .. && pwd`/lib ./qtlibspatcher "$@"
|
||||||
|
@@ -47,8 +47,8 @@
|
|||||||
const char * const oldInstallBase = QT_INSTALL_DIR;
|
const char * const oldInstallBase = QT_INSTALL_DIR;
|
||||||
const char * const oldSourceBase = QT_INSTALL_DIR;
|
const char * const oldSourceBase = QT_INSTALL_DIR;
|
||||||
#else
|
#else
|
||||||
const char * const oldSourceBase = "/home/berlin/dev/qt-4.4.3-temp/qt-x11-opensource-src-4.4.3";
|
const char * const oldSourceBase = "/home/berlin/dev/qt-4.5.0-temp/qt-x11-opensource-src-4.5.0";
|
||||||
const char * const oldInstallBase = "/home/berlin/dev/qt-4.4.3-shipping/qt";
|
const char * const oldInstallBase = "/home/berlin/dev/qt-4.5.0-shipping/qt";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -437,24 +437,24 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath)
|
|||||||
{"/examples/script/defaultprototypes/defaultprototypes.debug", "/examples/script/defaultprototypes"},
|
{"/examples/script/defaultprototypes/defaultprototypes.debug", "/examples/script/defaultprototypes"},
|
||||||
{"/examples/script/qscript/qscript.debug", "/examples/script/qscript"},
|
{"/examples/script/qscript/qscript.debug", "/examples/script/qscript"},
|
||||||
{"/examples/script/tetrix/tetrix.debug", "/examples/script/tetrix"},
|
{"/examples/script/tetrix/tetrix.debug", "/examples/script/tetrix"},
|
||||||
{"/lib/libQtTest.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtTest.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtDesignerComponents.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtDesignerComponents.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtScript.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtScript.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtDesigner.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtDesigner.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtGui.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtGui.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtSvg.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtSvg.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtXml.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtXml.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtCLucene.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtCLucene.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtCore.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtCore.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtDBus.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtDBus.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtXmlPatterns.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtXmlPatterns.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtHelp.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtHelp.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtSql.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtSql.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtNetwork.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtNetwork.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtOpenGL.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtOpenGL.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQt3Support.so.4.4.3.debug", "/lib"},
|
{"/lib/libQt3Support.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtAssistantClient.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtAssistantClient.so.4.5.0.debug", "/lib"},
|
||||||
{"/lib/libQtWebKit.so.4.4.3.debug", "/lib"},
|
{"/lib/libQtWebKit.so.4.5.0.debug", "/lib"},
|
||||||
{"/demos/spreadsheet/spreadsheet.debug", "/demos/spreadsheet"},
|
{"/demos/spreadsheet/spreadsheet.debug", "/demos/spreadsheet"},
|
||||||
{"/demos/composition/composition.debug", "/demos/composition"},
|
{"/demos/composition/composition.debug", "/demos/composition"},
|
||||||
{"/demos/gradients/gradients.debug", "/demos/gradients"},
|
{"/demos/gradients/gradients.debug", "/demos/gradients"},
|
||||||
@@ -533,24 +533,24 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath)
|
|||||||
{"/examples/script/calculator/calculator.debug", "/tools/designer/src/uitools"},
|
{"/examples/script/calculator/calculator.debug", "/tools/designer/src/uitools"},
|
||||||
{"/examples/script/tetrix/tetrix.debug", "/tools/designer/src/uitools"},
|
{"/examples/script/tetrix/tetrix.debug", "/tools/designer/src/uitools"},
|
||||||
|
|
||||||
{"/lib/libQtTest.so.4.4.3.debug", "/src/testlib"},
|
{"/lib/libQtTest.so.4.5.0.debug", "/src/testlib"},
|
||||||
{"/lib/libQtDesignerComponents.so.4.4.3.debug", "/tools/designer/src/components"},
|
{"/lib/libQtDesignerComponents.so.4.5.0.debug", "/tools/designer/src/components"},
|
||||||
{"/lib/libQtScript.so.4.4.3.debug", "/src/script"},
|
{"/lib/libQtScript.so.4.5.0.debug", "/src/script"},
|
||||||
{"/lib/libQtDesigner.so.4.4.3.debug", "/tools/designer/src/lib"},
|
{"/lib/libQtDesigner.so.4.5.0.debug", "/tools/designer/src/lib"},
|
||||||
{"/lib/libQtGui.so.4.4.3.debug", "/src/gui"},
|
{"/lib/libQtGui.so.4.5.0.debug", "/src/gui"},
|
||||||
{"/lib/libQtSvg.so.4.4.3.debug", "/src/svg"},
|
{"/lib/libQtSvg.so.4.5.0.debug", "/src/svg"},
|
||||||
{"/lib/libQtXml.so.4.4.3.debug", "/src/xml"},
|
{"/lib/libQtXml.so.4.5.0.debug", "/src/xml"},
|
||||||
{"/lib/libQtCLucene.so.4.4.3.debug", "/tools/assistant/lib/fulltextsearch"},
|
{"/lib/libQtCLucene.so.4.5.0.debug", "/tools/assistant/lib/fulltextsearch"},
|
||||||
{"/lib/libQtCore.so.4.4.3.debug", "/src/corelib"},
|
{"/lib/libQtCore.so.4.5.0.debug", "/src/corelib"},
|
||||||
{"/lib/libQtDBus.so.4.4.3.debug", "/src/dbus"},
|
{"/lib/libQtDBus.so.4.5.0.debug", "/src/dbus"},
|
||||||
{"/lib/libQtXmlPatterns.so.4.4.3.debug", "/src/xmlpatterns"},
|
{"/lib/libQtXmlPatterns.so.4.5.0.debug", "/src/xmlpatterns"},
|
||||||
{"/lib/libQtHelp.so.4.4.3.debug", "/tools/assistant/lib"},
|
{"/lib/libQtHelp.so.4.5.0.debug", "/tools/assistant/lib"},
|
||||||
{"/lib/libQtSql.so.4.4.3.debug", "/src/sql"},
|
{"/lib/libQtSql.so.4.5.0.debug", "/src/sql"},
|
||||||
{"/lib/libQtNetwork.so.4.4.3.debug", "/src/network"},
|
{"/lib/libQtNetwork.so.4.5.0.debug", "/src/network"},
|
||||||
{"/lib/libQtOpenGL.so.4.4.3.debug", "/src/opengl"},
|
{"/lib/libQtOpenGL.so.4.5.0.debug", "/src/opengl"},
|
||||||
{"/lib/libQt3Support.so.4.4.3.debug", "/src/qt3support"},
|
{"/lib/libQt3Support.so.4.5.0.debug", "/src/qt3support"},
|
||||||
{"/lib/libQtAssistantClient.so.4.4.3.debug", "/tools/assistant/compat/lib"},
|
{"/lib/libQtAssistantClient.so.4.5.0.debug", "/tools/assistant/compat/lib"},
|
||||||
{"/lib/libQtWebKit.so.4.4.3.debug", "/src/3rdparty/webkit/WebCore"},
|
{"/lib/libQtWebKit.so.4.5.0.debug", "/src/3rdparty/webkit/WebCore"},
|
||||||
|
|
||||||
{"/demos/composition/composition.debug", "/demos/shared"},
|
{"/demos/composition/composition.debug", "/demos/shared"},
|
||||||
{"/demos/gradients/gradients.debug", "/demos/shared"},
|
{"/demos/gradients/gradients.debug", "/demos/shared"},
|
||||||
|
@@ -215,14 +215,17 @@ void testIO()
|
|||||||
qDebug() << "qDebug() 1";
|
qDebug() << "qDebug() 1";
|
||||||
qDebug() << "qDebug() 2";
|
qDebug() << "qDebug() 2";
|
||||||
qDebug() << "qDebug() 3";
|
qDebug() << "qDebug() 3";
|
||||||
|
qDebug() << "qDebug <foo & bar>";
|
||||||
|
|
||||||
std::cout << "std::cout @@ 1" << std::endl;
|
std::cout << "std::cout @@ 1" << std::endl;
|
||||||
std::cout << "std::cout @@ 2\n";
|
std::cout << "std::cout @@ 2\n";
|
||||||
std::cout << "std::cout @@ 3" << std::endl;
|
std::cout << "std::cout @@ 3" << std::endl;
|
||||||
|
std::cout << "std::cout <foo & bar>\n";
|
||||||
|
|
||||||
std::cerr << "std::cerr 1\n";
|
std::cerr << "std::cerr 1\n";
|
||||||
std::cerr << "std::cerr 2\n";
|
std::cerr << "std::cerr 2\n";
|
||||||
std::cerr << "std::cerr 3\n";
|
std::cerr << "std::cerr 3\n";
|
||||||
|
std::cerr << "std::cerr <foo & bar>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void testQLinkedList()
|
void testQLinkedList()
|
||||||
@@ -961,7 +964,7 @@ void testHidden()
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
//testIO();
|
testIO();
|
||||||
testHidden();
|
testHidden();
|
||||||
testArray();
|
testArray();
|
||||||
|
|
||||||
|
@@ -7,3 +7,5 @@ DESTDIR = ..
|
|||||||
# Input
|
# Input
|
||||||
SOURCES += ../app.cpp
|
SOURCES += ../app.cpp
|
||||||
QT += network
|
QT += network
|
||||||
|
|
||||||
|
message("this says <foo & bar>")
|
||||||
|
Reference in New Issue
Block a user