summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles/mac/qmacstyle_mac_p_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant QPair includesAhmad Samir2023-09-061-1/+0
| | | | | | | | Nothing in those files uses QPair; and a local build finished fine without them. Task-number: QTBUG-115841 Change-Id: I669cfecaa9129bce6b31e464826287f138b159db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* macOS: delay initialization of small fontVolker Hilsheimer2022-11-091-2/+1
| | | | | | | | | | | | | | | | | | During construction of a QStyle, QApplication might not yet be initialized, e.g. when calling QApplication::setStyle("macOS") before constructing QApplication. In that case, we cannot access the platform theme. We don't just want to skip initializing the small font either though. Store the smallSystemFont as a std::optional so that we can initialize it once, when the first widget gets polished. As a drive-by, remove the unused miniSystemFont variable. Fixes: QTBUG-108047 Pick-to: 6.4 6.2 Change-Id: Id750770a563611fdbc6c7031fe102a99ea692be7 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use QList instead of QVector in pluginsJarek Kobus2020-07-061-2/+2
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic86f4a3000592a1c9ae62e4a83f4fe39832a6b24 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QMdiArea: on macOS using tabs, render document icons next to the textVolker Hilsheimer2019-12-031-1/+1
| | | | | | | | | | | | | | | | This is closer to what titles of documents look like in macOS apps, even though MDI is not a well-defined concept on this platform. To implement this, the QCommonStylePrivate::tabLayout method had to be made virtual, as it is called by the QCommonStyle class. It was already reimplemented in QMacStylePrivate, but didn't get called in all cases. Now that it is called as an override, adjust the icon placement to include the padding so that we get identical results to 5.13 for normal tab widgets. Change-Id: I7a63f6d76891146ca713259096a7737a86584d81 Fixes: QTBUG-63445 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-141-2/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| * macOS: Introduce QMacKeyValueObserver and use in theme and styleTor Arne Vestbø2019-06-071-2/+2
| | | | | | | | | | | | Change-Id: I2d21c883628933543ae5a66b694ff7503119bc4a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Headers cleanup in mac styleTasuku Suzuki2019-05-121-56/+63
|/ | | | | | | | | | | Solve many duplication between _p_p.h and .cpp, sorted by module and header name, and move headers for each features at the end of includes. Change-Id: Ice9189c10d062bc473258b7ace279df057102167 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QMacStyle: fix group box for macOS MojaveTimur Pocheptsov2018-10-191-0/+1
| | | | | | | | | | | | | | This change is based on a patch started by Gabriel. It works around the apparently noop (on macOS Mojave, light theme) -drawRect: call on NSBox, replacing it with -displayRectIgnoringOpacity:inContext:. Unfortunately, this turns out to be extremely slow with dark theme, so we have to resort to a custom version of NSBox/-drawRect: which calls its super's -drawRect: and look more or less correct. Task-number: QTBUG-69650 Change-Id: I5a614d7cd8002b378c6c3804663b6559e227f628 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Convert features.toolbar to QT_[REQUIRE_]CONFIGStephan Binner2018-05-021-0/+2
| | | | | | | | Move declaration of pick/perp helpers up the dependency chain Change-Id: I7084ed829a057a0c45d60445c416fb07f2cb5624 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QMacStyle: Clean up code, remove dead bitsGabriel de Dietrich2018-04-181-7/+2
| | | | | | | | | | | | Change QMacStylePrivate::drawNSViewInRect() signature to remove all the unused parameters. Reuse recent tab direction functions where appropriate. Includes the infamous outter -> outer fix. Change-Id: I8f92d79d8a6c3b5903bfbb13293afb6f72a5340b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle doesn't depend on Carbon anymoreGabriel de Dietrich2018-04-121-3/+0
| | | | | | | | We also remove the old documentation file that is now mostly outdated. Change-Id: I32c9c6b0984be5e41653a92b0b9287a89f73ee38 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: CE_TabBarTabShape is now HITheme-freeGabriel de Dietrich2018-04-121-1/+5
| | | | | | | | | | | This should be the last bit of QMacStyle depending on HIToolBox APIs. Small and mini sizes support coming later. Same for the focus ring. Change-Id: If625fccb87ebd0607b96a8c5040888df5a2a1032 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: PE_FrameTabWidget in now HITheme-freeGabriel de Dietrich2018-04-121-2/+5
| | | | | Change-Id: If14e67bdae41099bb87fe2d7c4f65926d325766b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: CC_ComboBox is now HITheme-freeGabriel de Dietrich2018-04-121-27/+2
| | | | | | | | | | | | | | | | For the time being, no more stretched QComboBox. They were already looking bad before and nobody complained, so it's a non-issue. In the future, we might use square combo boxes in the same way as we do for push buttons but for non-editable QComboBox only. Removes what is now dead code, including some leftovers. tst_QMacStyle updated to reflect size changes to accom- modate the focus ring. Change-Id: I60fac86b9acb52cc96373bca0b3cad598ec4f1e7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: SE_PushButtonContents is HITheme-freeGabriel de Dietrich2018-03-271-0/+1
| | | | | | | | This also removes a few HITheme-related functions that are no longer needed. Change-Id: I356938d1e99f5fed106c945a94050fa35db58716 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: Refactor button sizingGabriel de Dietrich2018-03-221-0/+1
| | | | | | | | | | We prepare for a better world without HITheme. Sadly, we can't guarantee Cocoa will be good enough as a replacement. So, expect more hardcoded values and margins. Change-Id: I915906b5dbfbfbfc8c7f5c3224fc0ed98562bb9f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: Make CE_PushButtonBevel square if large enoughGabriel de Dietrich2018-03-221-0/+3
| | | | | | | | | | | | Meaning, if larger than the size of a regular NSButton. No intermediate size square buttons anymore. We'll try to get the closest one later, once the sizing problem is solved. We also refactor the button creation code a bit. Change-Id: I965520469546aea596cd1abec2309b40d70399ce Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: No more HITheme for CC_ToolButtonGabriel de Dietrich2018-03-221-0/+2
| | | | | | | | As for CE_PushButtonBevel, sizing is still pending. These two seem to go together anyway. Change-Id: I631c3f32ba201b16adbfa264a2920bfb636fb86f Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: No more HITheme for CE_PushButtonBevelGabriel de Dietrich2018-03-221-2/+4
| | | | | | | | For rendering only. Sizing is still pending and, consequently, square buttons since these depend on the button's intrinsic size. Change-Id: Iacadc02a1a75970b221543b32ca724c92e118ce1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: Make CocoaControl a full typeGabriel de Dietrich2018-03-221-1/+11
| | | | | | | And one small code clean-up. Change-Id: I57c71ce2e18c95529ee45ba4fdfc68e21209e384 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Merge remote-tracking branch 'origin/dev' into 5.11Liang Qi2018-02-101-2/+5
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvarlengtharray.qdoc src/corelib/tools/qvector.qdoc Resolved documentation changes in favor of 017569f702b6dd0, which keeps the move overloads along with its const-ref sibling. Change-Id: I0835b0b3211a418e5e50defc4cf315f0964fab79
| * QMacStyle: CE_Splitter is HITheme-freeGabriel de Dietrich2018-01-241-0/+2
| | | | | | | | | | | | Change-Id: I96a5ba5d685d1b8f95fd11489e4e95096d0fa9a4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * QMacStyle: declare block in drawNSViewInRect() as noescapeGabriel de Dietrich2018-01-241-1/+1
| | | | | | | | | | Change-Id: Ida67a963ab62c6b974eceeaf9d386b941f357798 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * QMacStyle: PE_FrameLineEdit is HITheme-freeGabriel de Dietrich2018-01-241-1/+2
| | | | | | | | | | | | | | | | CT_LineEdit is as well, so that makes QLineEdit free of HITheme APIs. Change-Id: Ia02ce9f1003e5ae9c8bf47dab9ada030feca98ba Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | QMacStyle: QMdiSubWindow is now HITheme-freeGabriel de Dietrich2018-02-051-0/+8
|/ | | | | | | | | | | | | | | | There are a couple issues. Because the actual class for the buttons returned by +[NSWindow standardWindowButton: forStyleMask:] is private, we can't fully configure them as we could with HITheme. Therefore, we don't get the mouse hovered state and the zoom button will show the fullscreen arrow instead of the '+' icon. Hopefully, QMdiArea will go the way of the dodo soon enough. It is not a thing on macOS and it has been replaced by tabbed windows UI on most desktop apps. Change-Id: Ia581f72611ad0224f42657afbc4d9f94bf5e5a3a Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* QMacStyle: Set WA_MacShowFocusRect for checkbox, radio buttonGabriel de Dietrich2018-01-171-0/+1
| | | | | | | | | | | | | | | | | | This fixes small and mini checkbox and radio button focus rings since the previous HITheme removal patch (90c9370d5098db95). But also allows to properly draw the focus ring outside the widget's boundaries, as it's common in macOS. More importantly, we pave the way to use QFocusFrame for most widgets and, eventually, implement the focus ring animation. Finally, we tweak the spacing between the indicators and their respective label. Change-Id: I4bf7ac1a06ce924a043f0365e487777d0b20a104 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QMacStyle: De-HITheme item views headers and a couple arrowsGabriel de Dietrich2017-11-151-2/+0
| | | | | | | | | | | | | | | | This one is all manual. The arrows were manual before and the header sections are now plain rectangles. Removes one usage of HIThemeDrawButton and related logic together with a cached pixmap and its rendering. Still broken in some places, but not worse than before. In particular, sunken or selected header sections will not render the left hand side section separator properly. Look can be improved in the header label with different shades for the selected or current rows/columns. Change-Id: I6b1c1f529909341bbf72e82e5a3fc61905c75fa8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: Make backingStoreNSView mutableGabriel de Dietrich2017-11-151-2/+2
| | | | | | | | Even thought the resolve function is effectively not const, it's more straightforward to call. Change-Id: I7c881183862c3c0b326daf001b2f9e569153ee76 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: Replace HITheme info structs with QMSP::CocoaControlGabriel de Dietrich2017-11-151-2/+4
| | | | | | | | This is not yet a full replacement, but a scaffolding stage until we can remove all traces of HITheme info structs. Change-Id: I10eb6a60662c6b102bc687e335d0d1bedd6a4a12 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: Remove unused codeGabriel de Dietrich2017-11-151-4/+0
| | | | | Change-Id: I6e71871b19ce12daddd4cfbbe7c1d9beede13a9b Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: Rename Cocoa controls enum namesGabriel de Dietrich2017-11-151-27/+29
| | | | | | | | | For easier sorting and grouping by actual Cocoa NSControl class. We also shorten the names and move the types inside QMacStylePrivate. Change-Id: Iac093fd359da66abd263aca841b870ea84337f50 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: De-HITheme QGroupBoxGabriel de Dietrich2017-10-031-0/+1
| | | | | | | | NSBox is good enough for this and pixel equivalent with the previous HITheme calls. Change-Id: I32b2a1cc8a9cd2a6ef17d1e01032540344808ebc Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* QMacStyle: Refactor QMacStylePrivate::cocoaControl()Gabriel de Dietrich2017-10-031-2/+2
| | | | | | | | | | That switch following the if looked a bit corny. Also made cocoaCells hash mutable to get rid of the const_cast(this) in QMSP::cocoaCell(). Change-Id: I4facec827409314cf1214152c19efb9688715eb2 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-201-0/+8
| | | | | | | | | | Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
* Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into ↵Liang Qi2017-09-061-0/+2
|\ | | | | | | refs/staging/5.10
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-061-0/+2
| | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/qopenglwidget/main.cpp src/3rdparty/pcre2/src/pcre2_printint.c src/plugins/platforms/cocoa/qnsview.mm src/widgets/widgets/qcombobox.cpp Change-Id: I37ced9da1e8056f95851568bcc52cd5dc34f56af
* | QMacStyle: No more background pattern pixmapGabriel de Dietrich2017-09-061-1/+0
| | | | | | | | | | | | | | This ain't used nowhere. Change-Id: I107bbc4d8cd223bbc726c3ce2ea00059d97e6f2c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | QMacStyle: Update HIG link, reference version of IBGabriel de Dietrich2017-09-061-3/+3
|/ | | | | Change-Id: Iae56312a78431613737b69c0e16472cafff35da9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-151-0/+8
| | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoamenu.h src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/styles/qstylehelper_p.h Change-Id: I54247c98dd79d2b3826fc062b8b11048c9c7d9bb
* Merge remote-tracking branch 'origin/5.9' into devOswald Buddenhagen2017-08-021-1/+7
| | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/widgets/qdockarealayout.cpp src/widgets/widgets/qmainwindow.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmainwindowlayout_p.h tests/auto/corelib/tools/qlocale/tst_qlocale.cpp tests/auto/other/macnativeevents/BLACKLIST tests/auto/widgets/widgets/qmenu/BLACKLIST Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
* Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-07-191-0/+2
| | | | | | | | Conflicts: src/corelib/io/qwindowspipewriter.cpp src/widgets/styles/qcommonstyle.cpp Change-Id: I0d33efdc4dc256e234abc490a18ccda72cd1d9e6
* Merge remote-tracking branch 'origin/5.9' into devGabriel de Dietrich2017-07-131-2/+8
| | | | | | | Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
* QMacStyle: Simplify logic for SC_GroupBoxLabel rectangleGabriel de Dietrich2017-07-101-0/+3
| | | | | | | | | | | This removes the single occurrence of HIThemeGetTextDimensions. Since we have access to the actual platform font through QPlatformTheme::font(), it's possible to use QFontMetricsF instead. We also cache small and mini system fonts to be reused in other places. Change-Id: I799c61eef0a2a6880a1c51aa7d3105c7e5b0ed4f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-041-1/+0
| | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
* QMacStyle: Remove HITheme APIs to render QProgresssBarGabriel de Dietrich2017-06-011-1/+5
| | | | | | | | | | We use NSProgressIndicator in a similar fashion as we do with NSScroller for transient scrollers. Also changed the signature of QCocoaDrawRectBlock. Change-Id: I0fef8e327494fb557af2c2bab2aafa57c2e69564 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QMacStyle: Remove unused default button logicGabriel de Dietrich2017-05-161-4/+0
| | | | | | | | The auto-default button part must remain, but the pulsating animation logic can go. Same for the pressed button logic. Change-Id: I0e9a755f86601780a219296fbc02a1eb2b703aea Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* QMacStyle: Move disclosure triangle into cocoaCell() logicGabriel de Dietrich2017-05-151-2/+1
| | | | | Change-Id: Ica7766dabba57af3107ea275aa48514bc65158fb Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* QMacStyle: Use NSStepperCell for QSpinBox buttonsGabriel de Dietrich2017-05-151-1/+5
| | | | | | | Includes painting and subcontrol rectangles. Change-Id: I9a4c704bdea4f20f8dca94de24063f3e14dbaf91 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* QMacStyle: Remove a couple void *, dead codeGabriel de Dietrich2017-05-151-7/+4
| | | | | Change-Id: If05fbdf8cc5ced81adfd75232313969223bf1453 Reviewed-by: Jake Petroules <jake.petroules@qt.io>