summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
Commit message (Collapse)AuthorAgeFilesLines
* Fix the look of inactive checkboxes in itemviews on OS X 10.10Andy Shaw2015-02-091-1/+4
| | | | | | Task-number: QTBUG-43875 Change-Id: I4734647e2f3f9e3f68a3ae77fb5c825c7d99f8b4 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* QWindowsXPStylePrivate::buffer(): Improve warnings.Friedemann Kleint2015-02-041-2/+2
| | | | | | Task-number: QTBUG-44282 Change-Id: If617db5c6eae410042394f20855892a2c564e808 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Handle failure of Windows XP theme painting functions for PE_FrameWindow.Friedemann Kleint2015-02-042-20/+31
| | | | | | | | | | | | QWindowsXPStylePrivate::buffer() can fail due to CreateDIBSection() failing for large sizes. Introduce a bool return for the QWindowsXPStylePrivate::drawBackground() helpers and fall back to QWindowsStyle:::drawPrimitive() should that happen for PE_FrameWindow in QWindowsXPStyle::drawPrimitive(). Task-number: QTBUG-44282 Change-Id: I122d84576455bbad8e6639022da5bf64f79aed3a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4.1' into 5.4Frederik Gladhorn2015-01-291-5/+6
|\ | | | | | | Change-Id: Idadb5639da6e55e7ac8cc30eedf76d147d8d5d23
| * Fix possible divide by zero in QMacStyleLiang Qi2015-01-191-5/+6
| | | | | | | | | | | | | | | | [ChangeLog][Widgets][QMacStyle] Fixed a possible divide by zero crash. Task-number: QTBUG-43398 Change-Id: I8b5c6fd87d07eb42ad43e8c2405b7cad19372b86 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | FusionStyle: Don't try to draw null pixmapsUlf Hermann2015-01-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | We have the same check for null already for PE_IndicatorHeaderArrow which actually uses the same pixmap. If the file is not found the pixmap will be null and the code dividing by its width or height will thrown an arithmetic exception. Task-number: QTBUG-43067 Change-Id: I13a5ee9f21f4189b7bbcfd57a6f5b52113de834d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Account for pixmap's device pixel ratio when calculating the label sizeAndy Shaw2015-01-191-5/+7
|/ | | | | | | | | | When determining the size of the QPushButton's label then the device pixel ratio of the pixmap used to represent the icon needs to be taken into consideration so it is rendered correctly. Change-Id: If32760b120d7a749a51e2c30592d621c0e63dace Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Doc: Describe the enum item QStyle::PE_FrameStatusBar as obsoleteAlexander Volkov2014-12-221-1/+1
| | | | | Change-Id: Ibda864d2b037bd8b2484b8642423ae1bca218021 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Fix OS X style MDI area subwindow resizeMarko Kangas2014-12-181-0/+4
| | | | | | | | Fixed regression bug of the commit #fc11798 Change-Id: I3d64fd67dfe2196a726886a19b9510dd12ff255d Task-number: QTBUG-43392 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Support vertical sliders on AndroidPaul Olav Tvete2014-12-091-6/+26
| | | | | | | | | | There is no such thing as a vertical slider in the native Android style. Therefore, we need to rotate the painter in order to draw one. Task-number: QTBUG-41992 Change-Id: Ibe2bf1d7fa27756aad0b8469c8752d6d3e848527 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* QHeaderView: take the sort indicator into account when eliding textGiuseppe D'Angelo2014-12-091-1/+1
| | | | | | | | | | | | By adding PM_HeaderMarkSize to the margins if the section is showing a sort indicator. Turns out that that particular enum was actually unused in QtWidgets (!), so tune the value to match reality. Task-number: QTBUG-629 Change-Id: I8bc70451656d634a064c8b5014e449977c55aa9d Reviewed-by: Cristian Oneț <onet.cristian@gmail.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Styles: improve SH_Header_ArrowAlignment handlingGiuseppe D'Angelo2014-12-093-2/+9
| | | | | | | | | | | The docs were wrong, and the returned values from some styles did not match reality, so fix that. Again, this style hint was not used at all within QWidgets... Task-number: QTBUG-629 Change-Id: Ie6ff80fd09bc3292ba3d787ccca4d6f4c0056e89 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QMacStyle: Fix 32-bit buildGabriel de Dietrich2014-12-051-1/+1
| | | | | | | | Again one of those CGRect vs. NSRect issues. Change-Id: Ia933cd6f002585e21247d2f9f85d2451db6dbaa0 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* fix the build with animation omittedShawn Rutledge2014-11-272-0/+10
| | | | | | | configure -no-feature-STATEMACHINE -no-feature-ANIMATION Change-Id: Idb89c0bae8d699e76916317f83490c6c94c7d8b4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Fix instances of !var & const that should be !(var & const)Marc Mutz2014-11-251-1/+1
| | | | | | | | | GCC recently started warning about these. Change-Id: I7b30c79f7f2b66b99e54354224700d54ace6ebec Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Merge remote-tracking branch 'origin/5.4.0' into 5.4Frederik Gladhorn2014-11-212-328/+62
|\ | | | | | | Change-Id: I95f235a66ce2e9b1fa435c0f911c6f7e811755f0
| * Android: Fix QSlider appearanceBogDan Vatra2014-11-151-6/+5
| | | | | | | | | | | | Task-number: QTBUG-42672 Change-Id: I882c1f625ea659967a8db09246dc28d7aef93fdf Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * Fix crash on Android L and list view items.BogDan Vatra2014-11-152-78/+42
| | | | | | | | | | | | | | | | | | | | | | This crash is visible on Android L. This patch removes the static_cast which caused the crash and it also fixed the list view item problem. I could not create separated patches because they depend too much on each other. Task-number: QTBUG-42673 Task-number: QTBUG-41814 Change-Id: I5d3e9c2b73df8f0e87e815b785b1c64d65a3ffaf Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * Set Android palette and fonts in QPA plugin.BogDan Vatra2014-11-142-244/+15
| | | | | | | | | | | | Task-number: QTBUG-40621 Change-Id: Ibe069d4f93ac317e4f1b9ef5fc6bc3edcfac8685 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | QFusionStyle: properly indent an if statementGiuseppe D'Angelo2014-11-141-1/+3
| | | | | | | | | | | | | | | | Fix the style trap that leads people into thinking that's an else-if, while it's a plain if. Change-Id: I62963f0d6270eadcbd8aede7bac60f83968cb0d4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Fix MinGW compiler warning in qwindowsxpstyle.cpp.Friedemann Kleint2014-11-131-1/+1
| | | | | | | | | | | | | | qwindowsxpstyle.cpp: In static member function 'static QRect QWindowsXPStylePrivate::scrollBarGripperBounds(QStyle::State, const QWidget*, XPThemeData*)':styles\qwindowsxpstyle.cpp:2542:45: warning: suggest parentheses around '&&' within '||' [-Wparentheses] Change-Id: I6a4b62057a612fa9234744e892950c959c513d15 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Prevent a crash when buffer() returns 0Andy Shaw2014-11-131-1/+2
|/ | | | | | | | | | If buffer() returns 0 then there is no bufferPixels available which will cause a crash later on when it tries to set that memory. If this function fails then all we can do is return, a warning will have already been outputted from buffer() itself indicating why. Change-Id: I5890b3c34536f7f3d17def0936970c0a694b005a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Windows: fix unreadable white text for focused combo boxesJ-P Nurmi2014-11-051-1/+5
| | | | | | Task-number: QTBUG-42390 Change-Id: Ia52c7ac3d2e3ca155692c8f020a565054716c86b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix tab icon vertical alignmentMarko Kangas2014-11-041-1/+1
| | | | | | | | | | | | Fixes case if custom icon size is given and height is more than width. Check of minimum valid height was compared wrongly to width and caused invalid vertical alignment. After fix vertical alignment is correct aligned to vertical center with the tab text. Change-Id: I6c4a710b15e91225edeabb629bfea7049ab2f42a Task-number: QTBUG-42143 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com>
* QMacStyle: More tweaks for editable QComboBoxGabriel de Dietrich2014-11-021-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Note that at one point we need to use Cocoa to render the combo box, but only if we're dealing with Qt Quick controls. Also worth noticing, there's currently a bug in Cocoa when rendering inactive combob boxes. We faithfully reproduce it in Qt for now. We'll fix it when Apple does. Finally, we need to start constraininig the combo boxes height. Cocoa has not supported variable height combo boxes for years, and will even spit the following warning if we try to do something smart. This application is trying to draw a very large combo box, 28 points tall. Vertically resizable combo boxes are not supported, but it happens that 10.4 and previous drew something that looked kind of sort of okay. The art in 10.5 does not break up in a way that supports that drawing. This application should be revised to stop using large combo boxes. This warning will appear once per app launch. Task-number: QTBUG-40833 Task-number: QTBUG-42067 Change-Id: I6512a6a581d446a28585db22fe4dbeac09499321 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* QWindowsStyle: fix CE_ComboBoxLabel text colorJ-P Nurmi2014-10-301-0/+14
| | | | | | | | | | | CE_ComboBoxLabel was relying on a font color / painter pen set by CC_ComboBox. This change ensures that CE_ComboBoxLabel has correct color when CC_ComboBox and CE_ComboBoxLabel are drawn independently. Change-Id: Id548d831fdde5885bc7c157d55de6235ef3f0a56 Task-number: QTBUG-41702 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QMacStyle: Several fixes for QtQuick Controls on YosemiteGabriel de Dietrich2014-10-302-15/+12
| | | | | | | | | Some offsets differ between QWidgets and Controls. Therefore, we need drawNSViewInRect() to know about the origin of the call. Change-Id: I3bd165f94731f2b37423d86ed5d3c302a17d5ef5 Task-number: QTBUG-42067 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* QMacStyle: Fix QCombobox offsets in YosemiteGabriel de Dietrich2014-10-301-3/+6
| | | | | | Task-number: QTBUG-40833 Change-Id: Id3c3f4fd4f5c72cba844bf23f2e79ce0ea2b4a95 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Oswald Buddenhagen2014-10-282-2/+3
|\ | | | | | | Change-Id: I224e44a9df314b9a99d33148b6cf400fcbc9de8e
| * Doc: Don't show a description for omitted SH_ComboBox_UseNativePopup enum itemAlexander Volkov2014-10-282-2/+3
| | | | | | | | | | | | | | | | \omitvalue does not allow a description of an enum item, so move the description as a comment to the enum declaration. Change-Id: I4192b16e41b704cbad66c0eeafcb141087d2ba65 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * OS X: Fix broken 2x menu icon when style sheet is appliedMihailNaydenov2014-10-281-2/+2
| | | | | | | | | | | | | | Task-number: QTBUG-41623 Change-Id: I4e0640a7739d0ce4f8758dd5d8d17882a6947467 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | QMacStyle: Remove code depending depending on OS X 10.6 and olderGabriel de Dietrich2014-10-272-121/+36
| | | | | | | | | | | | | | Snow Leopard is unsupported from 5.4.0. Change-Id: I0c49a8353d5dc38169ab9679a986c35ab2df8d2f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | QMacStyle: Refactor painter offset into drawNSViewInRect()Gabriel de Dietrich2014-10-272-39/+40
| | | | | | | | | | Change-Id: I05067ee400f0b776b0f0418ee1c5fbd45126c29e Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | QGtkStyle: fix segfault after re-creating QAppJ-P Nurmi2014-10-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QGtkStylePrivate::setupGtkWidget() cannot use a local static variable for the container, but it must insert it to the GTK widget map together with all other GTK widgets. The container is destructed as a GtkWindow child in the Qt post routine QGtkStylePrivate::destroyWidgetMap(). Task-number: QTBUG-41145 Change-Id: If1fda372ed1227edc779fa4951cbd6fbf6038499 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | QStyleSheetStyle: Don't interfere with QFontDialogPierre Rossi2014-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The sample lineedit in Qt's own font dialog shouldn't have its font affected by stylesheets. Not only does this hampers the ability to preview the font, it actually overrides the font selection as that one is taken directly from the widget. Task-number: QTBUG-41513 Change-Id: I11d0bef8c7bf7bdae4cc08b6b9276d0fc14a75fb Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Fix styled vertical dockwidget title cut off bug and elide text if longMarko Kangas2014-10-231-4/+6
| | | | | | | | | | | | | | | | Change common stylesheet to elide text correctly for both direction. Change-Id: I045f6f74733ca8fa67b3e4fbb9d3845a1bea777d Task-number: QTBUG-41466 Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com>
* | Doc: Fix obsoleteness of some QStyle::PixelMetric enum itemsAlexander Volkov2014-10-221-6/+6
| | | | | | | | | | | | | | | | | | | | The enum items PM_ScrollView_ScrollBarSpacing, PM_ScrollView_ScrollBarOverlap and PM_SubMenuOverlap were mistakenly put together with obsolete enum items. Move them up to fix it. Change-Id: I90bd3a8ab68c99db27134d976fe69df56c9af2b8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Windows XP style: Fix size calculation of QScrollBar's grip.Friedemann Kleint2014-10-223-37/+17
| | | | | | | | | | | | | | | | | | Factor out function to calculate the geometry for the styles >= XP. Task-number: QTBUG-41944 Task-number: QTBUG-40277 Change-Id: Ifad1519b99fd587158c790dd241cb3e4bac3bfc3 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Fix helper function call in QWindowsVistaStyle::pixelMetric().Friedemann Kleint2014-10-221-1/+1
| | | | | | | | | | | | | | | | Task-number: QTBUG-41944 Task-number: QTBUG-40277 Change-Id: I1da9ffddce8edfcaa87d27058ed73ac7ec63d081 Reviewed-by: Adam Light <aclight@gmail.com> Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | OS X: Retina displays and blurry QToolButtonTimur Pocheptsov2014-10-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Checkable QToolButton has a special pixmap in the background, painted with a 'smooth pixmaps' hint. This hint also affects how an icon on a toolbutton itself is painted later. The difference can be quite visible on a Retina display, so this patch makes the toolbutton's image always look the same in checked/unchecked state. Task-number: QTBUG-35162 Change-Id: I2adc8006371fa10d89d4b77da6b3aa168aa5abc8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Gabriel de Dietrich2014-10-182-17/+43
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-10-142-17/+43
| |\| | | | | | | | | | Change-Id: Ic01820f2390e419a5b286643e7351e85ae032473
| | * QMacStyle: Fix QPushButton with menu appearance on 10.10Gabriel de Dietrich2014-10-132-16/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As usual, this includes small and mini control sizes. Flat and oversized buttons will fall back to the HITheme rendering for now. Task-number: QTBUG-40833 Change-Id: I08d67c48b2e72681af4dc4a37ea498f7aac1dca0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * QMacStyle: save context state before changing to avoid crashDyami Caliri2014-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qt_drawFocusRingOnPath was saving the graphics state after setting a new context. This leads to zombie NSBitmapGraphicsContext access with QFileDialog. Task-number: QTBUG-41879 Change-Id: I7fc7d959d2b0f01cb3491d639023083f1b46d175 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | | QMacStyle: Fix QSlider appearance on YosemiteGabriel de Dietrich2014-10-182-10/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, we adjust the min and max positions, which HITheme has been unable to render properly for years. This involves separating the knob and track rendering. Also, on Yosemite, the tickmarks-less slider shows a blue progress fill in the track, on the knob's left side. Finaly, and this is valid for all versions, the tickmarks are being drawn before the knob (or the whole slider for OS X versions before 10.10) Change-Id: I6fce2e298a80858a18fd9fe1e799b65265a8aefd Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | | QMacStyle: Add optional block parameter to drawNSViewInRect()Gabriel de Dietrich2014-10-182-3/+8
|/ / | | | | | | | | | | | | | | In some cases we want to do something different than just calling - [NSView drawRect:]. Change-Id: I7db704daa39611f33f270b0192c4301de62ec1bf Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | QMacStyle: Use NSRect instead of CGRect in drawNSViewInRect()v5.4.0-beta1Gabriel de Dietrich2014-10-131-3/+3
| | | | | | | | | | | | Change-Id: I90fd62dea377dfa9569d1730a67136c7a5dc6f82 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | DPI-scale PM_SubMenuOverlap after allOswald Buddenhagen2014-10-101-1/+2
| | | | | | | | | | | | | | | | | | | | This actually isn't a magic value and needs to be scaled. This partially reverts commit be1635e2d6a4e42f3f828e7831e5dbf867ba161d. Task-number: QTBUG-41864 Change-Id: Ie03c96c8b5343386f55c3ae9b988e79f943f334e Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | Don't use QStringLiteral in startsWith/endsWidthMarc Mutz2014-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For QLatin1String, startsWith/endsWith is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just use QLatin1String instead. Change-Id: I7eaf464c67b55116f970fe7f58a85f19ce4d254e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Oswald Buddenhagen2014-10-072-52/+117
|\ \