summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qstylesheetstyle.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Line spacing fixesJoerg Bornemann2009-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QTextEdit (via QTextLayout) and QPlainTextEdit in Qt used to ignore any font leading but added one extra pixel in QFontMetrics. With many freetype fonts, this resulted in a "spacy" text layout. The necessary fixes on X11 and Windows were to take (positive) leading into account, to make the font database convert point sizes to pixel sizes without rounding to plain integer values, and to subtract the extra pixel from QFontMetrics from the font engines' descent value. The change also fixes several places in styles and widgets, where QFontMetrics::lineSpacing() was wrongly used instead of QFontMetrics::height(). Ideally we should also handle negative leading, which would require additional and bigger code changes in QTextLayout and QPlainTextEdit. In addition, all other editors we have tested seem to ignore leading on X11. If we choose to believe the values provided by freetype, our text layout would be one pixel smaller than everybody else's. On the Mac, this change does nothing. There our layout is still too spacy, and for smaller fonts quite ugly compared to native Mac applications. Done with mae. Reviewed-by: mae
* Renamed the values in the Qt::TileRule enum.Trond Kjernåsen2009-10-021-1/+1
| | | | | | | Stretch, Repeat and Round are too generic. Renamed to StretchTile, RepeatTile and RoundTile. Reviewed-by: Gunnar
* Added QSlider to tst_QStyleSheetStyle::complexWidgetFocus.Gabriel de Dietrich2009-09-231-7/+13
| | | | | | | When using style sheets, QSlider::handle couldn't be customized if QSlider::groove wasn't. QComboBox::down-arrow:focus wasn't properly drawn. Reviewed-by: Olivier
* When using style sheets, the focus flag was not propagated to the children ofGabriel de Dietrich2009-09-231-1/+1
| | | | | | complex widgets. Reviewed-by: Olivier
* When using Plastique style, changing the background style sheet property of aGabriel de Dietrich2009-09-211-0/+2
| | | | | | | | spinbox wouldn't set the correct background for the embedded line edit. Reviewed-by: Olivier Task-number: 232085 Task-number: QTBUG-3013
* Fixes regression in QStyleSheet regarding QFrame:no-frameOlivier Goffart2009-09-101-1/+5
| | | | | | | | | | | | In Qt know the frame is drawn in PE_Widget with stylesheet. But the QStyleOption passed by QWidgetPrivate::drawBackground is really simple and doesn't contains frame information. We need to rely on the widget itself to know if we should look for the :no-frame pseudo element. Reviewed-by: jbache Task-number: 261110
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Fixed usage of QMargins in QStyleSheetStyleThorbjørn Lindeijer2009-09-081-4/+4
| | | | | | | The order of the parameters to the QMargins constructor changed in commit 758f4735bcae034ac25730e53bb371df3b7d6e8a. Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
* Stylesheet: Do not crop the text in tabsOlivier Goffart2009-09-041-1/+10
| | | | | | | | | | | | Because we did not reiimplement SE_TabBarTabText to force the parentstyle to call the virtual function back, we got the normal style margins in addition to the one by the stylesheet. Also added test for !hasNativeBorder to suport cases where we just specify a border Reviewed-by: jbache Task-number: 196326
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | QTabBar: Add ability to change the position of the close button in the ↵Olivier Goffart2009-08-281-0/+12
| | | | | | | | | | | | | | stylesheet Task-number: 241383 Reviewed-by: jbache
* | QTabBar: Being able to change the close button appearence in the stylesheetOlivier Goffart2009-08-281-3/+11
| | | | | | | | | | Reviewed-by: jbache Task-number: 241383
* | Make sure we use layoutDirection from the widget and not always the appThierry Bastian2009-08-251-4/+4
| | | | | | | | Task-number: 259331
* | Ugly round corners when no border is drawnGabriel de Dietrich2009-08-121-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When specifying round corners with QStyleSheetStyle and no border-width specified, the round corners were not rendered with antialiasing. Furthermore, if border-width was set to 0, part of the border was rendered in discordance with CSS3. The background in now rendered directly instead of drawing a clipped rectangle. The actual border width is checked before rendering. A test has been added at tests/auto/uiloader/baseline/css_borderradius_allwidgets.ui Task-number: 230362 Reviewed-by: olivier
* | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | QMenuBar does not respect the border-image stylesheet propertyGabriel de Dietrich2009-08-111-1/+16
| | | | | | | | | | | | | | | | | | | | | | Added WA_StyledBackground to QMenuBar when using style sheets. This also implies that CE_PanelMenuBar (drawing only the menubar border) no longer needs to be drawn. Tested in uiloader/baselne/css_borderimage_allwidgets.ui. Task-number: 230363 Reviewed-by: olivier
* | Fixed setting a style shet on a QSpinBox to change the arrow possitionOlivier Goffart2009-08-051-4/+4
| | | | | | | | | | | | | | If you only set the position, of the button without setting a geometry, it did not work. Task-number: 259226
* | Fix painting of the background of QAbstractItemView, QTextEdit and coOlivier Goffart2009-07-151-1/+1
| | | | | | | | when only setting a border with the stylesheet
* | Merge license header changes from 4.5Volker Hilsheimer2009-06-161-2/+2
|\ \ | |/
| * Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | | | | | Reviewed-by: Trust Me
* | Removed qApp and replaced with QApplication:: for static member callsThierry Bastian2009-06-111-4/+4
| |
* | Make sure custom arrow images works if we only specify it.Olivier Goffart2009-06-111-4/+14
| | | | | | | | | | | | | | | | Include change for spinbox, combobox, and menu. Task-number: 255849 Tested-by: Pierre Reviewed-by: jbache
* | Use Qt::UniqueConnection instead of disconnect/connectOlivier Goffart2009-05-281-6/+2
| | | | | | | | | | | | | | Also fix an issue in QTreeView where a signal could be connected several times Reviewed-by: Thierry
* | Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qtSimon Hausmann2009-05-271-3/+6
|\ \ | |/ | | | | | | Conflicts: tests/auto/qtreeview/tst_qtreeview.cpp
| * Fixed: Setting a border using stylesheet for QComboBox adds an unwated frame.Olivier Goffart2009-05-271-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was already fix. But there was still a frame if there was a stylesheet on the applicaiton. The reason is that the frame's constructor call the style for some hints. And later the combobox will query the style again for the frame hint, before the view get polished. The problem is that the StyleSheetStyle will fill the css cache with wrong information on the first call. This is not visible if there is no stylesheet as in the constructor, the widget style is still the default application stylesheet if there is no global applicaiton stylesheet. Task-number: 254589 Reviewed-by: jbache BT:
| * Fix crash in QWebView when application has a style sheetMarkus Goetz2009-05-061-1/+1
| | | | | | | | | | Task: 252796 Rev-By: Tor Arne
* | Fixed 'crazy' warnings about using a string instead of a characterThierry Bastian2009-05-251-1/+1
| | | | | | | | | | | | | | Wherever I found that we were using a string instead of a single char I fixed the code. Reviewed-by: olivier
* | Fixed: No margin between the text and the shortcut in menu with stylesheetOlivier Goffart2009-05-181-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If padding, margin border are set on an menu item with stylesheet, no space appeared between the text and the shortcut. Fix that by adding the 12px space, same as in QCommonStyle equivalent function Note that this patch also remove unused code, since the variable with and height were not used. example to reproduce the bug: the following stylesheet on a mainwindow that contains a menu with one action with a shortcut QMenu::item { border: 1px solid red; } Task-number: 252610 Reveiwed-by: jbache
* | Fix Toolbutton font with pseudo-statesOlivier Goffart2009-05-141-0/+1
| | | | | | | | | | | | | | | | | | So now QToolButton:pressed {text-decoration: underline} will works The change in QCommonStyle is to make it consistant with the setFont few lines later. Reveiwed-by: jbache
* | Fix crash in QWebView when application has a style sheetMarkus Goetz2009-05-061-1/+1
| | | | | | | | | | Task: 252796 Rev-By: Tor Arne
* | Merge commit 'origin/4.5'Olivier Goffart2009-05-041-1/+1
|\ \ | |/ | | | | | | Conflicts: src/gui/itemviews/qabstractitemview.cpp
| * Fixed busy indicator for a QProgressBar with a style sheet applied to it.jasplin2009-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a progress bar with a style sheet applied to it, this fix ensures that the timer event is passed to the event handler that updates the busy indicator animation state. Essentially, the bug was that the decision that the event was processed by the proxy style object (baseStyle()) was based only on the return value from the event() function. In this case it is necessary to check that the event was accepted as well. Reviewed-by: ogoffart Reviewed-by: brad Task-number: 252283
* | Port QStyleSheetStyle to the new qDrawBorderPixmap implementationOlivier Goffart2009-04-291-168/+15
| | | | | | | | | | | | Also add another constructor to QTileRules. Reviewed-by: Jens Bache-Wiig
* | Fixes QLabel:hover{color:...} for simple textOlivier Goffart2009-04-271-6/+4
| | | | | | | | | | | | | | | | (This was only working if the QLabel had a QTextControl) Also rename the QStyleSheetStyle::focusPalette to ...::styleSheetPalette Reviewed-by: Jens Bache-Wiig
* | Be able to set a border-image on plain QWidgetOlivier Goffart2009-04-271-28/+13
|/ | | | | | | | | | | | | | | | | we were not able to set border-image on plain QWidget, QDialog, QMainWindow, QFrame, QMenu, and more. And for some, not even border was working. PE_Widget used to only draw the background, now it draws both the whole rule (background + border) Since menu now have a PanelMenu, let's use that insead of PE_Widget + PE_FrameMenu. As for QFrame, we do not need to draw the border in CE_ShapedFrame, as PE_Widget does it. This patch mostly move code arounds. Reviewed-by: Jens Bache-Wiig
* Improved stylesheet support for setting background and foreground rolesJens Bache-Wiig2009-04-021-19/+7
| | | | | | | | | | This makes sure that style sheets set both ButtonText and WindowText roles for all widgets. This fixes among other things the fact that you could not configure text colors for combo box popups on Mac, Gtk and CleanLooks or set the background for the whole scrollbar. Task-number: 160713 Reviewed-by: ogoffart
* Fix background of QAbstractScrollArea when styled only with pseudo-classOlivier Goffart2009-03-271-1/+13
| | | | | | | | | | | | | | This may happen if you only have something like QAbstractScrollArea:focus { background: foo; } and you do not have a background set for the general case and the viewport has a different background role (such as QTextEdit, QAbstractItemView, ....) This is a regression from 4.4 since in 4.4 the :focus has no effect if you didn't have a background for the general case. Reviewed-by: bnilsen Task-number: 188195
* Fix crash while styling the title bar of a QMdiArea with stylesheetOlivier Goffart2009-03-251-1/+2
| | | | | | This stylesheet used to crash: *::title { border 1px solid black } Reviewed-by: bnilsen
* Long live Qt 4.5!Lars Knoll2009-03-231-0/+5946