-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
UI: Refactor system tray #10614
base: master
Are you sure you want to change the base?
UI: Refactor system tray #10614
Conversation
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.
The frontend API should not be consumed in the UI, it should be done alike to #7278.
#7278 will need to be merged first in order to use signals instead of the frontend api. So until that happens, I'll mark this as draft for now. |
19f53cd
to
60fae99
Compare
This has been updated to use the OBSBasic signals instead of the frontend api, as #7278 was merged. |
60fae99
to
c0c1845
Compare
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.
I think previewProjector
and studioProgramProjector
can be QScopedPointer
since those have the same lifetime as OBSSystemTrayIcon
instance.
@@ -199,6 +200,7 @@ class OBSBasic : public OBSMainWindow { | |||
friend struct BasicOutputHandler; | |||
friend struct OBSStudioAPI; | |||
friend class ScreenshotObj; | |||
friend class OBSSystemTrayIcon; |
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.
This should be avoided.
I didn't check yet what forces you to add that but I'm sure it can be avoided, friend
is a last resort.
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.
The triggered slots for the outputs were private in OBSBasic.
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.
For that, add a signal in OBSSystemTrayIcon
(you can check OBSBasicControls
) and connect this signal and the private slot in OBSBasic side.
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.
I've added signals to the system tray. Now the only reason it still needs to be a friend class is the open projector functions.
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.
So AddProjectorMenuMonitors
is the issue.
I don't know if re-creating previewProjector
and studioProgramProjector
is necessary, I need to understand more the code.
But I think those QMenu mainly containing things from OBSBasic, could be created in OBSBasic and given to the OBSSystemTrayIcon
instance when needed (e.g. trayIcon->SetPreviewProjectorMenu(createdMenu)
and trayIcon->SetStudioProgramProjectorMenu(createdMenu2)
called from OBSBasic).
70a637f
to
bae3302
Compare
This moves the system tray to its own file.
bae3302
to
4f88559
Compare
Description
This moves the system tray to its own file.
Motivation and Context
Instead of being strewn all over OBSBasic, the system tray code is now consolidated into its own file, making it easier to maintain.
How Has This Been Tested?
Used system tray to perform actions in OBS.
Types of changes
Checklist: