-
Notifications
You must be signed in to change notification settings - Fork 36.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qt: Introduce PlatformStyle #6487
Conversation
Very nice! Wouldn't it be possible to crate a PlattformBase class inherited from QObject, instead of passing |
I don't think that would work. There are various other ways to 'hide' the dependency, for example a singleton pattern, but I strongly prefer passing dependencies explicitly. The only place it is unfortunate is in the WalletModel / TransactionTableModel. Ideally only the view cares about the style, not the model. But the decoration icon has to be in the platform style. Could be fixed later with a delegate but this is the most straightforward. |
Fair enough. Better pass – like you introduce it in this PR – than a singleton. |
@@ -421,6 +439,8 @@ void BitcoinApplication::initializeResult(int retval) | |||
returnValue = retval ? 0 : 1; | |||
if(retval) | |||
{ | |||
// Log this only after AppInit2 finishes, as then logging setup is guaranteed complete | |||
qWarning() << "Platform customization:" << platformStyle->getName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Misses a space after :
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qt adds that, somehow
Tested ACK. Screens OSX: Screens Windows: |
3b7e2e7
to
07810e4
Compare
Again thanks for the extensive testing @jonasschnelli ! Squashed into one commit. |
Introduce a PlatformStyle to handle platform-specific customization of the UI. This replaces 'scicon', as well as #ifdefs to determine whether to place icons on buttons. The selected PlatformStyle defaults to the platform that the application was compiled on, but can be overridden from the command line with `-uiplatform=<x>`. Also fixes the warning from bitcoin#6328.
07810e4
to
eec7757
Compare
Added a comment to per-platform initialization in // This must be done inside the BitcoinApplication constructor, or after it, because
// PlatformStyle::instantiate requires a QApplication |
eec7757 qt: Introduce PlatformStyle (Wladimir J. van der Laan)
Introduce a PlatformStyle to handle platform-specific customization of the UI.
This replaces 'scicon', as well as #ifdefs to determine whether to place icons on buttons.
The selected PlatformStyle defaults to the platform that the application was compiled on, but can be overridden from the command line with
-uiplatform=<x>
.Also fixes the warning from #6328.