-
Notifications
You must be signed in to change notification settings - Fork 446
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
Mac: Support Dark Mode in Advanced View #5267
Conversation
@CharlieFenton, thank you for this implementation. |
@AenBleidd Please let me finish it on the Mac before you get too deeply into texting on other platforms. If this can be made to work on other platforms with a reasonable number of fixes, I would prefer that be done in a separate PR after this one has been merged. |
@CharlieFenton, for sure I'll wait for you. |
@CharlieFenton, if you have an app_config file for a project, just make a typo under one of the headers. That should create a notice. |
I made a quick test on Windows. |
@AenBleidd Thank you for testing. Once I hear your Linux results, I will add guards to the code so it does nothing on Windows, and perhaps also Linux if needed. |
@@ -1980,6 +1980,55 @@ void CAdvancedFrame::OnSelectAll(wxCommandEvent& WXUNUSED(event)) { | |||
} | |||
|
|||
|
|||
// On the Mac, we must destroy and recreate each wxListCtrl | |||
// to properly transition between dark mode and regular mode |
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.
Add a blank comment line after this line.
clientgui/AdvancedFrame.cpp
Outdated
|
||
StopTimers(); | ||
SaveState(); | ||
// Get the list copntrol's current scroll position |
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.
Spell check: "control's"
RestoreState(); | ||
|
||
// The last tab label ("Disk") is ellipsed here unless the window is resized | ||
// TODO: figure out how to replace this hack with a proper fix |
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.
Add a blank comment line after this line.
clientgui/NoticeListCtrl.cpp
Outdated
m_noticesBody = wxT("<html><head></head><body></body></html>"); | ||
} | ||
|
||
// In Dark Mode, paint the windoe black immediately |
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.
Spell check: window
@AenBleidd Dark Mode in Advanced View on Mac is now fully working; I have not finished implementing it for Simple View. Please test Dark Mode Advanced View on Linux today if possible. |
@CharlieFenton, sure, will try to do that. I'll let you know when I get the results |
@AenBleidd I have set it up so that the selection of which platforms use the Dark Mode code requires changes in only one line: clientgui/BOINCGUIApp.h line 44. I have temporarily set that line to allow both MacOS and Linux: Again, Advanced Mode is fully implemented for macOS, but I am still working on changes for Simple Mode. Please test Advanced Mode on Linux. |
@AenBleidd @davidpanderson: I have updated the copyright dates on all source files I have modified except common/wxPieCtrl.cpp. The files common/wxPieCtrl.cpp and common/wxPieCtrl..h have copyrights from wxWidgets, though I suspect they may have been modified for BOINC in the past. I don't know what to do about these. Should we add the BOINC copyright after the wxWidgets copyright, or perhaps in front of it? |
@AenBleidd I think I have now completed implementing Dark Mode for the Macintosh. The only thing left is for me to remove |
Just wanted to also provide some error messages from this boincmgr version when executed. ./boincmgr Already have both of the supposed missing libraries loaded. $ apt search appmenu-gtk-module $ apt search libcanberra-gtk-module |
Ok, didn't realize that Notices was an actual web page pulled from the projects. |
Notices is part of the manager. It's displayed using an HTML renderer that's part of WxWidgets. In dark mode it would ideally be dark too. |
@davidpanderson, not sure wxWidgets 'smart enough' to convert colors on the html page. |
On the Mac, Notices uses wxWebView and my code does shift its display to whit text on black in Dark Mode. On at least some Linux versions, Notices uses wxHtmlWindow because wxWebView is unavailable or doesn't work. I h ave no way to test on Linux, but I will see if I can get it working with wxHtmlWindow by temporarily modifying the Mac code to use wxHtmlWindow. |
@AenBleidd I noticed one other small thing I need to fix on the Mac before it is ready to merge. I wi ll also try to get it working with wxHtmlWindow for the Notices. |
Mac: Ensure that the 3 buttons at bottom of Simple View are legible
@KeithMyers I believe I have fixed Dark Mode for the Notices tab under Advanced View and Notices under Simple View in Linux. Please test it and let us know the result. Also, please check the various dialogs (Select Computer, Computing Preferences (both Simple and Advanced Views), Other Options, Event Log Options, Exclusive Applications, Select Columns, Add Project / Account Manager, etc.) |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #5267 +/- ##
============================================
- Coverage 10.86% 10.86% -0.01%
Complexity 1064 1064
============================================
Files 279 279
Lines 35969 35973 +4
Branches 8275 8313 +38
============================================
Hits 3909 3909
- Misses 31668 31672 +4
Partials 392 392 |
New artifact works on all tabs of the Manager now. |
Looks awesome. Thanks, @CharlieFenton, @KeithMyers! |
Great work! Small suggestion: |
Not too much though. I think it's fine in my opinion. Some commentary from teammates about the shade of blue in the tasks, projects percentage areas. . . . too dark a shade of blue. I'm fine with it as it. Think this color is hard-coded. Doesn't respond to the color palette in Ubuntu Settings. Only the Event Log highlighting follows the Desktop color palette. |
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.
Looks good to me
I too am fine with the color choices as is. Niggles only for any commentary from other users. |
Our code is not setting the colors and doesn't have control over the choices. wxWidgets sets the Light Mode colors and the OS (or perhaps code in wxWidgets) decides what to change them to for Dark Mode. All we do to create the alternating row colors (which wxWidgets calls "Zebra striping") is call |
@KeithMyers Does this mean that you were able to confirm that the dialogs I listed here also display properly in Dark Modern Linux? If so, this PR is ready to be merged. |
@KeithMyers Thank you for your help with this. |
Yes, I went through every choice you mentioned and confirmed they all were in Dark Mode. |
Fixes #3115 (at least for macOS)
Implementing Dark Mode support for macOS and possibly for Windows and Linux. I am initially not guarding my changes with
#ifdef __APPLE__
or#ifdef __WXMAC__
to allow testing of theWindows and Linux CI build artifacts to see how well my Mc changes work on those platforms. I expect to add those guards before submitting this PR for merging.So far, I have Dark Mode working on the Projects, Tasks, Transfers and Disk tabs in Advanced View, as well as the Event Log and various Advanced View dialogs. I have not been able to work on the Notices tab because my attached BOINC projects currently have no notices.
I still need to implement Dark Mode for the Simple View.