frontend: Replace add source dropdown with dialog#13136
frontend: Replace add source dropdown with dialog#13136Warchamp7 wants to merge 3 commits intoobsproject:masterfrom
Conversation
|
Do we have a toggle to switch it back to dropdown mode? We often add and sources on spot. While I welcome this new dialog which is user friendly. |
22b1faf to
92ddf03
Compare
Co-Authored-By: Lain <134130700+Lain-B@users.noreply.github.com>
92ddf03 to
0099129
Compare
There is no toggle. I made sure that this new dialog requires the same number of clicks or less compared to the old menu for all actions. |
0099129 to
ec17f70
Compare
🫡 |
ff302fe to
99692a0
Compare
6dd0cb5 to
3d8cc80
Compare
3d8cc80 to
dd135db
Compare
Description
Updated resubmission of #12067
This refactors a fair chunk of the
ThumbnailManager, theSourceSelectButtonand window. Thumbnails have a better lifetime hierarchy within the QObject and widget structure.The
SourceSelectButtonis better implemented now as an actual button with a paintEvent instead of a QFrame. The buttons and window now have handling for source created/removed events. The window now keeps a list of uuids instead of hacky tracking and management of the button widgets themselves.The
ThumbnailManagerchanges introduces two new classes.ThumbnailItemandThumbnailView. These changes are largely focused around improving the actual usage of thumbnails within QWidgetsThumbnailManagermaintains a list ofThumbnailItems mapped by source UUIDs and a cache of QPixmaps.ThumbnailItems are responsible for the logic relating to generating and updating the thumbnail image data for a particular source.ThumbnailViews are QObject 'proxy' instances for delivering pixmap update signals.Using a thumbnail somewhere such as in
SourceSelectButtonis done by callingThumbnailManager->createView(parent, source). This will set up aThumbnailItemfor that source if one does not exist already and then return aThumbnailViewwhich then has signals to connect to for pixmap updates.This means thumbnails are only generated once per source regardless of how many widgets might be showing a thumbnail for it.
ThumbnailViews can be marked as enabled/disabled such as when they're offscreen or otherwise not visible.ThumbnailItemwill only update if at least oneThumbnailViewfor it is enabled. When allThumbnailViewsfor a particular source are destroyed, theThumbnailItemfor that source is also destroyed and a pixmap is then stored in theThumbnailManagercache. This cache is used when recreatingThumbnailItems to prepopulate the pixmap data allowing the most recent thumbnails to be immediately available.Original description below:
Replaces the add source context menu with a brand new window.
Adds new FlowFrame and FlowLayout for automatic wrapping widget frame
Adds ThumbnailManager class
Adds new dialog for adding sources
Sources Dock Menu
New Window
obs64_E0SOtuhy93.mp4
Motivation and Context
The current process for adding a source is rather cumbersome, especially when adding a source that already exists. Ideally users should be re-using Sources whenever it makes sense, so one of the goals of this PR is exposing that better than the old radio button and list selection.
How Has This Been Tested?
Created a number of different sources. Added existing sources. Created/deleted sources while the window was open and the related sources were selected and not selected.
Types of changes
Checklist: