aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.h
AgeCommit message (Collapse)Author
2021-05-28Merge bitcoin-core/gui#275: Support runtime appearance adjustment on macOSHennadii Stepanov
c231254a65d390a3350fcef456d57e4a6eca0506 qt: Make TransactionView aware of runtime palette change (Hennadii Stepanov) 2b622d4aced1848393989ee906b1f9d2436f1c1a qt: Make CoinControlDialog aware of runtime palette change (Hennadii Stepanov) 97a6b5e06a532a4ee029c8ba59c3438369f8b049 qt: Make OverviewPage aware of runtime palette change (Hennadii Stepanov) d05f1b278d9846de5142a4ac3f53c84145330dd1 qt: Make UnitDisplayStatusBarControl aware of runtime palette change (Hennadii Stepanov) 6b2ce65392dc98250e84941370e975048b8afc54 qt: Replace base class of ClickableLabel with ThemedLabel (Hennadii Stepanov) ff530a2093c294a1093e1b00fb66ab0a98851c04 qt: Use GUIUtil::ThemedLabel class (Hennadii Stepanov) d99ef327a885874fed1c4e35e0f47b10290c6bd9 qt: Add GUIUtil::ThemedLabel class (Hennadii Stepanov) c054720e08b5549913f54b9b4bc4e4002617ff23 qt: Make SignVerifyMessageDialog aware of runtime palette change (Hennadii Stepanov) 0dcc3fac433b341eb6e1d3a2fb4d2de1595e8e88 qt: Make SendCoinsEntry aware of runtime palette change (Hennadii Stepanov) fa18d28e1242c2948814df1082ee12c2fecf5403 qt: Make RPCConsole aware of runtime palette change (Hennadii Stepanov) f1083826e3e68803da86af6efba21c4080769b5c qt: Make BitcoinGUI aware of runtime palette change (Hennadii Stepanov) ce17861dc419b0d1fc1d933000f484dd08bacf5b qt: Make PlatformStyle aware of runtime palette change (Hennadii Stepanov) Pull request description: On macOS switching appearance (Light -> Dark or Dark -> Light) when Bitcoin Core is running makes the GUI pretty unusable. This bug is especially important when a user chose the "Auto" mode to adjust appearance automatically. This PR fixes Bitcoin Core behavior. This is an alternative to #268. ACKs for top commit: Sjors: tACK c231254a65d390a3350fcef456d57e4a6eca0506 on macOS 11.4 goums: ACK c231254a65d390a3350fcef456d57e4a6eca0506 promag: Tested ACK c231254a65d390a3350fcef456d57e4a6eca0506 on macOS Big Sur arm64. jarolrod: tACK c231254a65d390a3350fcef456d57e4a6eca0506 Tree-SHA512: 122dda3e4c9703f68cec60613c536ca59d04c93f2c03398559f2361b8d279ae534800e8e677d94a33e10e769d00be54295a704e98afa2e986a06146b9f164854
2021-05-20Merge bitcoin-core/gui#281: set shortcuts for console's resize buttonsW. J. van der Laan
2a45134b5694c12546d77cdff541612881f7e3e7 qt: Add shortcuts for console font resize buttons (Hennadii Stepanov) a2e122f0fe72d695762db2b83905e246f451300c qt: Add GUIUtil::AddButtonShortcut (Hennadii Stepanov) 4ee9ee72363d46c5ba0c71b8d8283d9c5621e3ed qt: Use native presentation of shortcut (Hennadii Stepanov) Pull request description: On `master` the only way to resize the console font is to manually move your mouse and click the resize buttons. This PR introduces convenient keyboard shortcuts to resize the console font. The common resize shortcuts for applications are `Ctrl+=`/`Ctrl++` and `Ctrl+-`/`Ctrl+_`. This means that the resize QPushButtons need two shortcuts each, but you cannot assign multiple shortcuts to a QPushButton. See: https://doc.qt.io/qt-5/qabstractbutton.html#shortcut-prop To get around this, we introduce a new function in `guiutil`, which connects a supplied `QKeySequence` shortcut to a `QAbstractButton`. This function can be reused in other situations where more than one shortcut is needed for a button. | PR on macOS | PR on Linux | | ---------------- | ------------ | | ![mac-resize-shortcuts](https://user-images.githubusercontent.com/23396902/114750132-a2752580-9d21-11eb-9542-15716f2c257d.gif) | ![linux-resize-shortcuts](https://user-images.githubusercontent.com/23396902/114750165-aacd6080-9d21-11eb-8abc-5388690dcf0b.gif) | ACKs for top commit: hebasto: re-ACK 2a45134b5694c12546d77cdff541612881f7e3e7 Talkless: tACK 2a45134b5694c12546d77cdff541612881f7e3e7, tested on Debian Sid with Qt 5.15.2, shortcuts still work. Tree-SHA512: e894ccb7e5c695ba83998c21a474d6c587c9c849f12ced665c5e0034feb6b143e41b32ba135cab6cfab22cbf153d5a52b1083b2a278e6dfca3f5ad14c0f6c573
2021-05-17qt: Add GUIUtil::AddButtonShortcutHennadii Stepanov
Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
2021-05-01qt: Replace base class of ClickableLabel with ThemedLabelHennadii Stepanov
This change fixes the GUI when changing appearance on macOS.
2021-05-01qt: Add GUIUtil::ThemedLabel classHennadii Stepanov
The ThemedLabel class correctly handles appearance changes on macOS.
2021-04-01qt: Add GUIUtil::ExceptionSafeConnect functionHennadii Stepanov
Throwing an exception from a slot invoked by Qt's signal-slot connection mechanism is considered undefined behavior, unless it is handled within the slot. The GUIUtil::ExceptionSafeConnect function should be used for exception handling within slots.
2021-04-01qt: Make PACKAGE_BUGREPORT link clickableHennadii Stepanov
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
2021-03-03Change all ping times to std::chrono typesPieter Wuille
2021-02-22Merge #79: Embed monospaced fontWladimir J. van der Laan
67f26319a0ca7e34e3db17d9330133622a40de09 gui: Add monospaced font settings (Hennadii Stepanov) 22e0114d055b0ac6cdc47af2968b5dc742ba055a qt: Choose monospaced font in C++ code rather in `*.ui` file (Hennadii Stepanov) 623de12d040af89ff7c25de6eb0a19c67179dc5f qt: Make GUIUtil::fixedPitchFont aware of embedded font (Hennadii Stepanov) 89e421918ee8b9c8439317f747e5c37f0733d94b gui: Add Roboto Mono font (Hennadii Stepanov) Pull request description: Qt does not guarantee that the actual applied font matches to the requested one. It was noted (https://github.com/bitcoin/bitcoin/pull/16432#issuecomment-514486077): > the monospace font looks a bit weird no macOS ... because it is _not_ monospaced. Also some discrepancies I've noted on Windows while testing Qt 5.15 ([#19716](https://github.com/bitcoin/bitcoin/pull/19716)). Of course, we could check the actual font with `QFontInfo`, and try to choose another font. But this PR suggests to just embed a monospaced font, and get the GUI look (partially) independent from a platform. [Roboto Mono](https://fonts.google.com/specimen/Roboto+Mono) was chosen after discussion with Bitcoin Design community, and due to its [Apache License, Version 2.0](https://fonts.google.com/specimen/Roboto+Mono#license). Changes are scoped to the Overview page only. --- Screenshots on macOS 10.15.6 (images are simulated by code patching): - master (ca30d34cf94b7797272ef1920ca4b48716e7f999) ![Screenshot from 2020-09-03 14-10-03](https://user-images.githubusercontent.com/32963518/92107902-30357d80-edef-11ea-8a4f-b4c758eebf66.png) - this PR (3fdd5b6bd17a679d6e3876682266092159c52d59) ![Screenshot from 2020-09-03 15-41-36](https://user-images.githubusercontent.com/32963518/92116277-4b5aba00-edfc-11ea-8cb9-22fc44460bfb.png) --- More screenshots added after https://github.com/bitcoin-core/gui/pull/79#issuecomment-782909149: - Linux Mint 20.1 + Cinnamon DE ![DeepinScreenshot_select-area_20210221205410](https://user-images.githubusercontent.com/32963518/108635739-b327be80-7489-11eb-8851-ac89f61199ee.png) - Windows 10 (with depends) ![DeepinScreenshot_select-area_20210221205056](https://user-images.githubusercontent.com/32963518/108635741-b6bb4580-7489-11eb-8b6b-66be5551eb8c.png) - macOS Big Sur (with depends) ![DeepinScreenshot_select-area_20210221202917](https://user-images.githubusercontent.com/32963518/108635746-bd49bd00-7489-11eb-8cd2-cf4bb2273a6d.png) ACKs for top commit: laanwj: Tested ACK 67f26319a0ca7e34e3db17d9330133622a40de09 Tree-SHA512: a59775570b8ce314669ede50a0b69f53e8a47a41e7eea428835013240f0ce9afcff6e4c258895455b56806417ed877e5b7a9522f1904e95a5f435db8ccf6078c
2021-02-22Merge bitcoin-core/gui#204: Drop buggy TableViewLastColumnResizingFixer classMarcoFalke
3913d1e8c1f604bdd622d5e81e5077ef52b30466 qt: Drop buggy TableViewLastColumnResizingFixer class (Hennadii Stepanov) Pull request description: In Qt 5 the last column resizing with dragging its left edge works out-of-the-box. The current `TableViewLastColumnResizingFixer` implementation could put the last column content out of the view port and confuse a user: ![Screenshot from 2021-01-31 18-04-32](https://user-images.githubusercontent.com/32963518/106390022-fd6bd180-63ee-11eb-9216-6e5117f8dc96.png) Historical context: - https://github.com/bitcoin/bitcoin/pull/2862 - https://github.com/bitcoin/bitcoin/pull/3626 - https://github.com/bitcoin/bitcoin/pull/3738 - https://github.com/bitcoin/bitcoin/pull/3920 #205 is a nice addition. ACKs for top commit: jarolrod: ACK 3913d1e8c1f604bdd622d5e81e5077ef52b30466, tested on macOS 11.1 Qt 5.15.2 Talkless: tACK 3913d1e8c1f604bdd622d5e81e5077ef52b30466, tested on Debian Sid. Can confirm that behavior in previous commit does not produce scroll bar, last column gets "hidden". This PR makes clear that there's more to see in the view. promag: Tested ACK 3913d1e8c1f604bdd622d5e81e5077ef52b30466 on macos. Tree-SHA512: 12582dfce54bb1db3d9934ae092e305d32e9760cc99b0265322e161fa7f54b7d6fb6cefedf700783f767d5c3a56a8545c8d2f5ade66596c4e67b8a5287063e8a
2021-02-21qt: Make GUIUtil::fixedPitchFont aware of embedded fontHennadii Stepanov
2021-02-06gui: allow ConnectionTypeToQString to prepend direction optionallyJon Atack
2021-01-31qt: Drop buggy TableViewLastColumnResizingFixer classHennadii Stepanov
In Qt 5 the last column resizing with dragging its left edge works out-of-the-box. The current TableViewLastColumnResizingFixer implementation could put the last column content out of the view port and confuse a user.
2021-01-30gui: display plain "Inbound" in peer detailsJon Atack
2021-01-28Merge bitcoin-core/gui#85: Remove unused "What's This" button in dialogs on ↵Jonas Schnelli
Windows OS ac7ccd67d7f2b09e36dd57405f899e4698dd3d78 scripted-diff: Remove unused "What's This" button in dialogs on Windows (Hennadii Stepanov) b6951483ecdd4409a0e1d492c93bcd4d823f039d qt: Add flags to prevent a "What's This" button on Windows OS (Hennadii Stepanov) Pull request description: Fix #74. From [Qt docs](https://doc.qt.io/qt-5/qdialog.html#QDialog): > The widget flags _f_ are passed on to the `QWidget` constructor. If, for example, you don't want a **What's This** button in the title bar of the dialog, pass `Qt::WindowTitleHint | Qt::WindowSystemMenuHint` in _f_. Screenshot on Windows 10 (2004): - master (3ba25e3bdde3464eed5d2743d68546e48b005544) ![Screenshot from 2020-09-07 16-55-42](https://user-images.githubusercontent.com/32963518/92402384-20dc6a00-f138-11ea-9dcb-3e0f6373ff22.png) - this PR (e322fe7e19ac504272d14b9b4f9b28b13df888ed) ![Screenshot from 2020-09-07 18-31-16](https://user-images.githubusercontent.com/32963518/92402509-5aad7080-f138-11ea-8b63-9bbbf8b9b9e1.png) ACKs for top commit: Bosch-0: tACK ac7ccd67d7f2b09e36dd57405f899e4698dd3d78 Tested on Windows 10.0.18363 Build 18363. promag: Code review ACK ac7ccd67d7f2b09e36dd57405f899e4698dd3d78 but with some suggestions. jonasschnelli: utACK ac7ccd67d7f2b09e36dd57405f899e4698dd3d78 Tree-SHA512: f6750a17b7203106cb4db5870becba1cef6a505d4edcc710ba131338bd3aae051510627e62c9bcb8345a7f497c614709e11aeb8f6ae3ea85967bbce2a8c69e64
2021-01-10gui: return inbound {full, block} relay type in peer detailsJon Atack
2021-01-08gui: create GUIUtil::ConnectionTypeToQString utility functionJon Atack
2020-12-27gui: fix broken doxygen formatting in src/qt/guiutil.hJon Atack
2020-12-27gui: create GUIUtil::NetworkToQString() utility functionJon Atack
2020-11-25qt: Add ObjectInvoke template functionHennadii Stepanov
This is a replacement of the QMetaObject::invokeMethod functor overload which is available in Qt 5.10+. Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
2020-09-07qt: Add flags to prevent a "What's This" button on Windows OSHennadii Stepanov
2020-08-26qt, refactor: Fix 'split is deprecated' warningsHennadii Stepanov
2020-08-26qt, refactor: Fix 'pixmap is deprecated' warningsHennadii Stepanov
2020-08-26qt, refactor: Fix 'QDateTime is deprecated' warningsHennadii Stepanov
2020-07-03qt: Get rid of cursor in out-of-focus labelsHennadii Stepanov
This change is a temporary fix of QTBUG-59514.
2020-05-29Merge #17956: gui: Disable unavailable context menu items in transactions tabJonas Schnelli
2b18fd2242a589988fbb68205dae4afa0b8b3d34 Disable unavailable context menu items in transactions tab (Kristaps Kaupe) Pull request description: Fixes #9192. ACKs for top commit: jonatack: Re-ACK 2b18fd2242a5899 jonasschnelli: codereview utACK 2b18fd2242a589988fbb68205dae4afa0b8b3d34 Tree-SHA512: 4ea19c7b5976f1f0b1baecccb3077cf82f078af7257f92162686bcce2188efe49511a5f557853bc5fe0b10616708957d61c006944babbe60b8105e78751e865f
2020-05-13qt: Remove QFont warnings with QPA=minimalHennadii Stepanov
2020-05-08refactor: Use override for non-final overridersHennadii Stepanov
2020-05-04Merge #15768: gui: Add close window shortcutJonas Schnelli
f5a3a5b9ab362c58fa424261f313aa9cf46d2a98 gui: Add close window shortcut (Miguel Herranz) Pull request description: CMD+W is the standard shortcut in macOS to close a window without exiting the program. This adds support to use the shortcut in both main and debug windows. ACKs for top commit: jonasschnelli: Tested ACK f5a3a5b9ab362c58fa424261f313aa9cf46d2a98 hebasto: ACK f5a3a5b9ab362c58fa424261f313aa9cf46d2a98, tested on Linux Mint 19.3 by manually opening available dialogs and sub-windows, and applying the `Ctrl+W` shortcut. Also tested with "Minimize on close" option enabled / disabled. Tree-SHA512: 39851f6680cf97c334d5759c6f8597cb45685359417493ff8b0566672edbd32303fa15ac4260ec8ab5ea1458a600a329153014f25609e1db9cf399aa851ae2f9
2020-04-16Disable unavailable context menu items in transactions tabKristaps Kaupe
2020-03-04refactor: Convert ping wait time from double to int64_tBen Woosley
2020-03-04refactor: Convert ping time from double to int64_tBen Woosley
2020-02-05gui: Add close window shortcutMiguel Herranz
CMD+W/CTRL+W is the standard shortcut to close a window without exiting the program.
2020-01-15scripted-diff: Bump copyright of files changed in 2020MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-01-08Merge #17826: qt: Log Qt related infoWladimir J. van der Laan
a004673c54d4c015775e0baced21f3fa961bf754 qt: Add LogQtInfo() function (Hennadii Stepanov) Pull request description: This PR adds some info to `debug.log` I found useful for testing (e.g., on Wayland) and debugging issues like #17153: ``` $ ./src/qt/bitcoin-qt -printtoconsole | head -n 6 2020-01-04T14:57:40Z [main] Bitcoin Core version v0.19.99.0-0df287f4e (release build) 2020-01-04T14:57:40Z [main] InitParameterInteraction: parameter interaction: -externalip set -> setting -discover=0 2020-01-04T14:57:40Z [main] Qt 5.9.5 (dynamic), plugin=xcb (dynamic) 2020-01-04T14:57:40Z [main] System: Linux Mint 19.3, x86_64-little_endian-lp64 2020-01-04T14:57:40Z [main] Screen: HDMI-1 1600x1200, pixel ratio=1.0 2020-01-04T14:57:40Z [main] Assuming ancestors of block 00000000000000b7ab6ce61eb6d571003fbe5fe892da4c9b740c49a07542462d have valid signatures. ``` ACKs for top commit: laanwj: ACK a004673c54d4c015775e0baced21f3fa961bf754 Tree-SHA512: 496bcfd4870a2730eab92b96b3e74989a7904b21369c372b6d4368f4ca2c141e2fdc1348a1fdd18cb68bb144dcea01d3023bb782f9d030e330c187f6a5a1a082
2020-01-05qt: Add LogQtInfo() functionHennadii Stepanov
2019-12-30scripted-diff: Bump copyright of files changed in 2019MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2019-08-23qt: Add TextWidth() wrapperHennadii Stepanov
In Qt 5.12 and before the QFontMetrics::width() is used and it is deprecated since Qt 13.0. In Qt 5.11 the QFontMetrics::horizontalAdvance() was introduced.
2019-04-23Resolve the qt/guiutil <-> qt/optionsmodal CD251
This pull request attempts to resolve the `qt/guiutil` <-> `qt/optionsmodel` circular dependency. The circular dependency is resolved by moving the `Intro::getDefaultDataDirectory` member function to `GUIUtil::getDefaultDataDirectory`.
2019-01-15Add workaround for QProgressDialog bug on macOSHennadii Stepanov
See: QTBUG-65750, QTBUG-70357.
2019-01-13Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant)practicalswift
Qt-only changes.
2018-11-05qt: Add GUIUtil::bringToFrontJoão Barbosa
2018-08-08Merge #13780: 0.17: Pre-branch maintenanceWladimir J. van der Laan
3fc20632a3ad30809356a58d2cf0ea4a4ad4cec3 qt: Set BLOCK_CHAIN_SIZE = 220 (DrahtBot) 2b6a2f4a28792f2fe9dc1be843b1ff1ecae35e8a Regenerate manpages (DrahtBot) eb7daf4d600eeb631427c018a984a77a34aca66e Update copyright headers to 2018 (DrahtBot) Pull request description: Some trivial maintenance to avoid having to do it again after the 0.17 branch off. (The scripts to do this are in `./contrib/`) Tree-SHA512: 16b2af45e0351b1c691c5311d48025dc6828079e98c2aa2e600dc5910ee8aa01858ca6c356538150dc46fe14c8819ed8ec8e4ec9a0f682b9950dd41bc50518fa
2018-07-30gui: Add GUIUtil::ItemDelegate with keyEscapePressed signalJoão Barbosa
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-25Merge #13753: scripted-diff: Remove trailing whitespacesMarcoFalke
12dd101345 scripted-diff: Remove trailing whitespaces (João Barbosa) Pull request description: The script test/lint/lint-whitespace.sh should prevent new cases. This happens in some pulls where the code editor and the author 'git add's them, so this would fix it all. Tree-SHA512: bcdd3472fcd01a2754e52212c7db1de2fdc422728b06785481954a27162fb72001cb73708329cc56e95bcc5e45c1348ebc4eacc2ccfa6aa12413c7ec450b6a33
2018-07-25gui: remove macOS ProgressBar workaroundfanquake
2018-07-25gui: remove SubstituteFontsfanquake
2018-07-24scripted-diff: Remove trailing whitespacesJoão Barbosa
-BEGIN VERIFY SCRIPT- sed --in-place'' --regexp-extended 's/[[:space:]]+$//g' $(git grep -I --files-with-matches --extended-regexp '[[:space:]]+$' -- src test ':!*.svg' ':!src/crypto/sha256_sse4*' ':!src/leveldb' ':!src/qt/locale' ':!src/secp256k1' ':!src/univalue') -END VERIFY SCRIPT-
2018-06-18gui: Remove QT_VERSION fallbacks for Qt < 5Wladimir J. van der Laan
There were surprisingly many `#ifdef` fallbacks for Qt 4. Remiving them simplifies maintenance, as well as adding new GUI functionality.