Skip to content
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

Add Source Toolbar #3268

Merged
merged 1 commit into from
Aug 18, 2020
Merged

Add Source Toolbar #3268

merged 1 commit into from
Aug 18, 2020

Conversation

jp9000
Copy link
Member

@jp9000 jp9000 commented Aug 11, 2020

Description

Adds a toolbar that allows quick and easy modification of most common/essential source properties or media controls without having to open a separate properties window:

obs64_2020-08-10_20-07-58
obs64_2020-08-10_20-08-09
obs64_2020-08-10_20-08-21

Motivation and Context

Originally the reason why the context bar was created was to allow us a space to add media controls for the media source (play/pause/stop/seek). However, It didn't really have much use outside of media controls; it felt sort of like wasted space. So, I added quick access to essential properties/buttons specific for each main source type that OBS comes with. This turned out to be pretty useful and a little bit of a boost to user experience (in my humble opinion).

The source toolbar can be hidden via the view menu if the user would prefer not to have extra space used.

How Has This Been Tested?

Tested with all the various sources while making it. Primarily just tested on Windows though, will try to get some testing on macOS and Linux.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@DDRBoxman DDRBoxman added the Seeking Testers Build artifacts on CI label Aug 11, 2020
@WizardCM WizardCM added the Enhancement Improvement to existing functionality label Aug 11, 2020
@exeldro
Copy link
Contributor

exeldro commented Aug 11, 2020

I would like to see the extra widget per source available in struct obs_source_info so that I can set a custom widget in sources added via plugin.
Something like:
void *(*toolbar_widget)(void *data);

@cg2121
Copy link
Contributor

cg2121 commented Aug 11, 2020

There are alignment issues in the context bar

Screenshot from 2020-08-11 01-39-07

Copy link
Member

@WizardCM WizardCM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Ubuntu, due to the default UI font, the section for the source name feels very cramped. It doesn't fit the default "Screen Capture (XSHM)" source name.

The custom field for the text source on Ubuntu works correctly if there's only 1 line of text. More than one line causes the field to disappear completely. Not sure if this is intended.
image
image

With the "Window Capture (Xcomposite)" source on Ubuntu, an extra entry appears in the source toolbar that doesn't appear in the Properties window - "[Device not connected or not available]".
image
image

Overall, this seems to work great on both Ubuntu and Windows 10.

UI/CMakeLists.txt Outdated Show resolved Hide resolved
UI/CMakeLists.txt Outdated Show resolved Hide resolved
UI/data/locale/en-US.ini Outdated Show resolved Hide resolved
UI/data/themes/Rachni.qss Outdated Show resolved Hide resolved
UI/forms/OBSBasic.ui Outdated Show resolved Hide resolved
UI/forms/OBSBasic.ui Outdated Show resolved Hide resolved
UI/forms/OBSBasic.ui Outdated Show resolved Hide resolved
UI/context-bar-controls.cpp Show resolved Hide resolved
UI/window-basic-main.cpp Outdated Show resolved Hide resolved
@jp9000
Copy link
Member Author

jp9000 commented Aug 14, 2020

The multi-line thing is intended. It's not possible to edit a multi-line string on the context bar, and having a multi-line edit box in the context bar causes a lot of problems with layout and text selection anyway. The device not connected thing is intended as well.

@jp9000 jp9000 force-pushed the context-bar branch 2 times, most recently from 77ab591 to 226d597 Compare August 14, 2020 08:40
@mufunyo
Copy link
Collaborator

mufunyo commented Aug 14, 2020

The multi-line thing is intended. It's not possible to edit a multi-line string on the context bar, and having a multi-line edit box in the context bar causes a lot of problems with layout and text selection anyway.

In that case I would replace the text box with a button reading "Edit multi-line text" or "Edit paragraph".

@jp9000 jp9000 force-pushed the context-bar branch 4 times, most recently from 0caa5b7 to b3448af Compare August 17, 2020 10:23
The source toolbar allows quick and easy access to properties and
filers, and shows common properties/features of a source type.  For
example, when you select a media source, VLC source, or the slideshow
source, you'll get media controls to control playback of the media.  If
you select a text source you can edit the font, color, or text if
applicable.  Or if you select a capture source, you can select the
display/window/etc to capture for that source.

If the source toolbar is not desired and is viewed as taking up valuable
space in the window, it can be disabled via the view menu.

Co-authored-by: Clayton Groeneveld <claytong1214@gmail.com>
Co-authored-by: Jim <obs.jim@gmail.com>
@jp9000 jp9000 merged commit bd512da into master Aug 18, 2020
@jp9000 jp9000 deleted the context-bar branch September 9, 2020 16:39
@SuslikV
Copy link
Contributor

SuslikV commented Oct 28, 2020

Two custom styles (themeID=refreshIconSmall and themeID2=contextBarButton) to single widget introduces inconvenience to design OBS themes. I couldn't believe that making Browser Refresh button of two custom styles was the simplest solution.

Please, avoid this is in the future. Give to the each element name and thus everything can be customized with QWidget#name header. Even here the Browser's button has its own name: <widget class="QPushButton" name="refresh">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement to existing functionality Seeking Testers Build artifacts on CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants