summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
Commit message (Collapse)AuthorAgeFilesLines
* 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
|\
| * Merge remote-tracking branch 'origin/5.3' into 5.4Oswald Buddenhagen2014-10-062-52/+117
| |\ | | | | | | | | | Change-Id: I132bb6cce68e9f8413200f7ee75586bd1cada38c
| | * QMacStyle: Fix QToolButton appearance on YosemiteTimur Pocheptsov2014-10-021-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | On Yosemite checkable toolbuttons look differently when highlighted - this modification tries to imitate such look without pixmaps we used on OS X >= 10.5 && < 10.10. Change-Id: I0fcdff42a67fa6d5188c9dc64401f0f27ae60b5d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * QMacStyle: Generalize Cocoa control renderingGabriel de Dietrich2014-09-292-51/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, we were restricted by the values of ThemeButtonKind, which consist mostly of buttons. We want to generalize to other kind of controls when the time arrives. Already, QPushButton with pull- down menu is not possible to get from that enum, while its easy to get from NSPopupButton. Task-number: QTBUG-40833 Change-Id: I244c42c42ab595f4790050eb15ade70443e155b2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | | Doc: deletion plugin-howtos.qdocNico Vertriest2014-10-071-2/+3
|/ / | | | | | | | | | | | | | | | | | | Document is moved to qtdoc/doc/src/howtos Including snippet files. Task-number: QTBUG-38412 Change-Id: Iba15689ad63e17c370c21c9ee5a1fff40c79fcec Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Fix the text field alignment.BogDan Vatra2014-10-031-2/+0
| | | | | | | | | | | | | | | | All Android styled controls must use AndroidControl methods. Task-number: QTBUG-41722 Change-Id: I594829bfed8468888738b39450fe94af35f14d7a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Gabriel de Dietrich2014-10-013-22/+67
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into 5.4Gabriel de Dietrich2014-09-293-22/+67
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_unix.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I6f1aa320d5ca66cd92d601a95885aeaab0abb191
| | * QMacStyle: Improvements to some buttons on YosemiteGabriel de Dietrich2014-09-242-18/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Radio button, checkbox and non-editable combobox, in normal, small and mini sizes, and only in the inactive state. This commit amends 982b9b7ec2441103b100. Task-number: QTBUG-40833 Change-Id: If3f2bb215e9b8966cbf15f08fa252feb92483c7b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * Fix compilation on OS X with macx-clang-32Andy Shaw2014-09-231-4/+4
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-27335 Change-Id: I1703aee2d90e02b1a6ed386715bebddf6dedb9f5 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
| | * GTK syle: initialize all members of GdkColorGiuseppe D'Angelo2014-09-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Coverity rightfully complains that we're copying a struct with an uninitialized member, triggering undefined behavior. Change-Id: I7635b859eb11e5eb9b825df8e23b453116059892 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | | Don't dpi-scale -1 pixel metricsOswald Buddenhagen2014-09-301-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | It may be rounded down to 0, thus losing its magic value. Task-number: QTBUG-41324 Change-Id: I5a5b98bb24bd0478c10940a90a7dc691e2663f4d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Additional support for devicePixelRatio in CE_MenuItem’s icon paintingMihailNaydenov2014-09-306-12/+12
|/ / | | | | | | | | | | | | | | | | FusionStyle and MacStyle have this already, the change just brings it to the others. Task-number: QTBUG-40277 Change-Id: I08dc80771b9cd0ab47179e1994ab6510b022eade Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | Widgets: remove references to QStyleOptionFrameV<n>Marc Mutz2014-09-261-1/+1
| | | | | | | | | | | | | | They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame. Change-Id: Icff45cbd3a47db8618a7f7a80f7252651969237c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Update license headers and add new license filesMatti Paaso2014-09-2458-1100/+636
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Frederik Gladhorn2014-09-2418-63/+412
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-2318-63/+412
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| | * QMacStyle: Use NSView rendering for some inactive widgets on 10.10Gabriel de Dietrich2014-09-114-3/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, we use them for inactive non-editable combo box, check box, and radio button only on Yosemite. We keep as much as possible the previous behavior on older versions. In addition, we add a way for QQuickStyleItem to specify the window the item is on. This is currently without effect, since we don't seem to take the inactive window state into account. Task-number: QTBUG-40833 Change-Id: I2fb2a99e6adf1972f881195b79b07ce85a960273 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * Add missing private headers warningSamuel Gaist2014-09-048-0/+88
| | | | | | | | | | | | | | | Change-Id: I7a4dd22ea3bcebf4c3ec3ad731628fd8f3c247e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QMacStyle: Fix inactive combo box appearance in 10.10Gabriel de Dietrich2014-09-011-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As usual, HITheme is not helping, and renders inactive controls as disabled. Also, given the design changes in Yosemite, we can't just desaturate the active pixmap and render it. In this case, we render the inactive control and enhance it, making very close to the expected result. The pixel-exact version would be to render a plain push button, and then add the combo box arrows. However, these arrows would need to be created (and updated) since there seems to be no more API to render them. Task-number: QTBUG-40833 Change-Id: If1bc366c0bc83123972fabebbc8beeb9f071e7a1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * QMacStyle: Fix push buttons focus ring on YosemiteGabriel de Dietrich2014-08-271-9/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HITheme renders the focus ring in a way that diminishes contrast on the focused button edges. The same issue seems to affect combo boxes, check boxes, and radio buttons. We refactor the code that was used to draw CE_FocusFrame into qt_drawFocusRingOnPath(). We use it to render our own path for the push button contour. This should also allow us to implement the focus ring animation in the future. As a side note, notice how the square button part (kThemeBevelButton) is a complete joke. Not only we impose the wrong button kind and let HITheme do what it can with it, but we also prevent ourselves from using it by never adding padding for the focus ring. Hopefully, we can fix this whole button sizing and padding mess in 5.5 or 6.0, whatever breaks less apps around. Task-number: QTBUG-40833 Change-Id: Ib9e7829d99b38dc926c55b31c3d6d5d32b691867 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * QMacStyle: Fix QTabBar appearance on YosemiteGabriel de Dietrich2014-08-261-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The selected tab text color should be white except when the window is not active. Also, no text shadow should be rendered in any case. Finally, there's no need to move the tab shape up anymore. Task-number: QTBUG-40833 Change-Id: Ibb35f0bb7a12fb005202fd8c082eb9bb19645b2b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * QMacStyle: Fix default button look on YosemiteGabriel de Dietrich2014-08-261-40/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default button has different text color on OS X 10.10, and doesn't pulsate anymore. We first make sure we don't start any animation for default buttons. Then, we set the right text color in the attached palette, which implies making a copy of the style option object. This increases the size of this patch but keeps things sane. (It's also more concise than the QGtkStyle approach that consists on duplicating QCommonstyle's code for rendering CE_PushButtonLabel). Task-number: QTBUG-40833 Change-Id: Ifac118bb607eec17400c6ae42342a223a40843b4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
| | * QFusionStyle paints sliders outside of clipAllan Sandfeld Jensen2014-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When painting a slider the QFusionStyle overrides the existing clip on QPainter thereby causing itself to be painting unclipped. Changes replace clipping with intersection clipping. Task-number: QTBUG-40530 Change-Id: I0135928c36ca1d23c906cf82c584ded01720b1cc Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| | * Fix QT_NO_ANIMATION buildSérgio Martins2014-08-135-0/+17
| | | | | | | | | | | | | | | Change-Id: Ia589e703206d6ca675a392e634e2a445dcf4cca3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Vista style: Scale hardcoded values in menu drawing code.Friedemann Kleint2014-09-241-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | Fix the position of the menu gutter. Change-Id: Ia8e056f14315f314d1e7a8b95a1ac87f6843e466 Task-number: QTBUG-40277 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | | QCommonStyle: remove references to QStyleOptionFrameV<n>Marc Mutz2014-09-231-8/+7
| | | | | | | | | | | | | | | | | | | | | They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame. Change-Id: I55539305df28267d0671a54a5cb7fcc17d045b8b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | | QStyleSheetStyle: remove references to QStyleOptionFrameV<n>Marc Mutz2014-09-231-10/+6
|/ / | | | | | | | | | | | | They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame. Change-Id: Ic165b524e8d86a0dd5355de338e87a33cd7429c7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Remove unused variable in QStyleSheetStyle::hasStyleRule()Maks Naumov2014-09-221-1/+0
| | | | | | | | | | Change-Id: I052fcc067ffbd1d470593d16af5f2189541c6264 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QCommonStyle: cache the xpm QPixmapsMarc Mutz2014-09-181-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QPixmap(const char* const*) ctor featured prominently in the callgrind trace of tst_qmdi*, with 23% of total time spent there in tst_qmdiarea before the change. Cache the results in the QPixmapCache. That's probably a good idea for all standardPixmap()s, but none other feature prominently in any of the widgets/widgets auto-tests, so there's no immediate need to do something about it. After the change, less than 3.5% of the total time is spent on parsing XPMs. Change-Id: Idfb6ffe0d0f7a4a1f71a7c26fc9ab0f42bdbd7a8 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Allow overriding standardIcon() in a proxy styleAlexander Volkov2014-09-165-22/+22
| | | | | | | | | | | | | | [ChangeLog][QtWidgets][Styles] Allow overriding standardIcon() in a proxy style Change-Id: I3c7983a7e51a8b220a0ca8ead2b4d7b87a77d71b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Make the default value of QTreeView::indentation() be style dependentAlexander Volkov2014-09-153-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a new PM_TreeViewIndentaion enum value to QStyle and get the corresponding pixel metric in QTreeView. [ChangeLog][QtWidgets][QTreeView] Indentation is now style-dependent by default. [ChangeLog][QtWidgets][QTreeView] Added resetIndentation(). Change-Id: Ifad7987b8f3c6cd32987b89d95390f33043d8f19 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Adam Majer <adamm@zombino.com>
* | Windows styles: Avoid theme.rect recalculationMaks Naumov2014-09-082-2/+0
| | | | | | | | | | | | | | | | | | In both cases theme.rect calculated right after the "sub & SC_ScrollBarSlider" test. Change-Id: I9fa0c4e1327e68b4184674a13e7a4bf362f8deff Reviewed-by: Adam Majer <adamm@zombino.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Windows styles: Scale hardcoded-values according to DPI.Friedemann Kleint2014-09-056-72/+85
| | | | | | | | | | | | | | | | | | Factor out functions to return the fixed values and scale those. Task-number: QTBUG-38993 Task-number: QTBUG-38858 Change-Id: I59c70a206eae76bf08bc2aeb5cda5a740cd3d6dc Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | Windows styles: Add device pixel scaling for system metrics.Friedemann Kleint2014-09-055-297/+291
| | | | | | | | | | | | | | | | | | | | | | | | Metrics obtained from the system must be scaled down when device pixel ration scaling is in effect. Factor out functions to return the device pixel values which might still be used for drawing. Task-number: QTBUG-38993 Task-number: QTBUG-38858 Change-Id: I6b90629e4979436bbb46f8c1fa1ee2253ada7ece Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | QCommonStyle: replace a QPolygon with a QPoint[] (IV)Marc Mutz2014-09-041-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No need to allocate dynamic memory for a fixed-size point array when QPainter has a (QPoint*,int) overload. This one is a bit more complicated, as the QPolygon was returned from a helper function, so I wrapped the array in a minimal std::array-like StaticPolygonF. Together, these four QPolygon -> QPoint[] changes result in ca. 4.5K text size reduction for libQtWidgets. Change-Id: I082f199d5edb7a7782173fe3748220f373edac8a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | QCommonStyle: replace a QPolygon with a QPoint[] (III)Marc Mutz2014-09-041-20/+23
| | | | | | | | | | | | | | | | No need to allocate dynamic memory for a fixed-size point array when QPainter has a (QPoint*,int) overload. Change-Id: Ie1eecd376a52b73572998ba253a032deaa0daaf9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | QCommonStyle: replace a QPolygon with a QPoint[] (II)Marc Mutz2014-09-041-6/+7
| | | | | | | | | | | | | | | | No need to allocate dynamic memory for a fixed-size point array when QPainter has a (QPoint*,int) overload. Change-Id: Ifdf8224ddffe06ef7848562023e372e2c32b9ad6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | QCommonStyle: replace a QPolygon with a QPoint[] (I)Marc Mutz2014-09-041-10/+12
| | | | | | | | | | | | | | | | No need to allocate dynamic memory for a fixed-size point array when QPainter has a (QPoint*,int) overload. Change-Id: I50c69103bba47e9f6de4f5616e8f40fee522ddc2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Windows XP, Vista styles: Share dynamically resolved theme functions.Friedemann Kleint2014-09-024-202/+191
| | | | | | | | | | | | | | | | | | | | Extract a struct containing the function pointers and derive QWindowsXPStylePrivate from it, so that both styles can use them. Remove duplicated variables. Task-number: QTBUG-38858 Change-Id: I7c2c665b5930c56ffdf33c5185720f71517d146c Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | Fix radioButton height for Windows styleMaks Naumov2014-09-021-1/+1
| | | | | | | | | | | | Change-Id: I755ed32f7458fec0fcbc5243d25fb1f6ecf46492 Task-number: QTBUG-32420 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* | Add Q_ENUMS to QStyle's enumerations.Friedemann Kleint2014-08-291-0/+3
| | | | | | | | | | | | | | | | | | This makes it significantly easier to obtain debug output for style functionality. Task-number: QTBUG-38858 Change-Id: I19edc834a55fa369b6830abeb4697ae5e5ded995 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix error reported by address sanitizerOlivier Goffart2014-08-131-10/+14
| | | | | | | | | | | | | | | | It is not valid to dereference a null pointer, even if it's just in order to access enum constants Change-Id: Id404c308ae7ffd879afdd678302e3ac4e0c69001 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | OS X: Remove mnemonics in parenthesesTakumi Asaki2014-08-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | In some language, mnemonics put after label text within parentheses. e.g. "&Open" is translated to "開く(&O)" in Japanese. OS X doesn't use mnemonics and '&' in label text is removed. Mnemonics in parentheses (and spaces before them) also should be removed. Change-Id: I88c0a1f60af7e148b3cf24a4e215ce807d62bce3 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | Add the QTabBar::changeCurrentOnDrag property.Ivan Komissarov2014-08-063-0/+8
| | | | | | | | | | | | | | | | | | | | This property indicates that the current tab will change whilst dragging over the tabbar [ChangeLog][QtWidgets][QTabBar] Added changeCurrentOnDrag property. Change-Id: Ib7d5a7613c9cd8432b84c523f66c02cd6c3c3c81 Reviewed-by: David Faure <david.faure@kdab.com>
* | Fix high DPI icons in menu itemsAllan Sandfeld Jensen2014-08-011-2/+2
| | | | | | | | | | | | | | | | | | The position of high DPI icons is wrong in the Fusion style because the pixel resolution is not taking into account when centering them. Task-number: QTBUG-40277 Change-Id: I3593ed461ea57543c3ddfd473105fdc698789132 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Reduce the default frame rate of style animationsJ-P Nurmi2014-07-303-4/+38
| | | | | | | | | | | | | | | | Halves the amount of paint events triggered by transient scrollbars. Task-number: QTBUG-30316 Change-Id: Ifdf968d5c45013332758a6b751ce11d1ef2a2ca8 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>