Commit Graph

58 Commits (40a598008d0b05f5f0081d1d661740730499edd1)

Author SHA1 Message Date
VodBox 3d544653e8 UI: Cleanup libobs C++ type use 2021-11-26 23:23:51 +13:00
tt2468 71d7b6855d UI: Refresh source tree when an item source is removed
Previously, calling `obs_source_remove()` on an input would not fully
remove it if there was a scene item of the input on the current scene.

Now, when calling `obs_source_remove()` and there is a scene item of
the removed input on the current scene, the UI refreshes the scene
items, allowing the scene item to be released completely and the
input destroyed.
2021-11-20 19:58:38 -08:00
jp9000 da04907927 Revert "UI: Disable hotkeys when a user is expected to type text"
This reverts commit f832d14220.

Reverting this until we do more investigation. Currently, any text
that can be typed in a dialog requires the dialog to re-enable hotkeys
on destruction, which is frustrating. There has to be a better way.
2021-10-03 07:52:44 -07:00
Ryan Foster f832d14220 UI: Disable hotkeys when a user is expected to type text
Disable hotkeys when a user starts an interaction with the UI where they
are expected to type text and re-enable hotkeys when the interaction is
completed.
2021-09-04 15:22:21 -07:00
gxalpha 85891630b3 UI: Dim hidden source items in source tree
Dims the items of hidden sources in the sources dock to make it more
obvious that they are not visible. Both the icon and the sources name
are affected.
2021-08-17 08:24:28 -07:00
Georges Basile Stavracas Neto 4c07ba6886 Revert "UI: Disable drag/drop on Linux scenes/sources (for now)"
This reverts commit 457adcedd3.

Requires https://github.com/obsproject/obs-browser/pull/304
2021-07-28 10:28:49 +10:00
Exeldro 5998f4cc4d UI: Optimize backup scene for undo/redo 2021-06-08 23:29:17 -07:00
jp9000 457adcedd3 UI: Disable drag/drop on Linux scenes/sources (for now)
Due to a Qt issue on Linux, disable drag/drop on the scenes/sources list
on Linux for the time being.
2021-05-31 12:18:45 -07:00
jp9000 c4c5b0d21d UI: Add Group/Ungroup Undo/Redo actions 2021-05-21 18:17:09 -07:00
jp9000 7bdd384fd5 UI: Fix hide undo/redo not working with group items
Fixes obsproject/obs-studio#4702
2021-05-17 16:34:56 -07:00
jp9000 0d482be14a UI: Use std::bind for visibility undo/redo action
This is better and slightly more optimal code over what it was before.
2021-04-27 21:31:07 -07:00
jp9000 78f1983f7d UI: Remove unnecessary Undo/Redo cleanup func
Since fixing the reference holding issue with scene/source deletion, the
undo/redo cleanup function (last param of add_action) is no longer
required.
2021-04-27 20:45:43 -07:00
jp9000 59603f47ad UI: Use scene backup/undo/redo funcs for reordering
Fixes a bug where groups would not be backed up properly
2021-04-23 12:40:33 -07:00
jp9000 4188899194 UI: Add undo/redo for source reordering 2021-04-20 19:38:53 -07:00
jp9000 8175700620 UI: Add Undo/Redo for source visibility
(Author note: This is why I hate supporting undo/redo.)

Fixes obsproject/obs-studio#4447
2021-04-16 20:33:53 -07:00
Clayton Groeneveld 7dfd36f9e8 UI: Force current scene when using undo/redo
The undo/redo functions are setting the current scene. Everytime
it would do this, it would actually transition to the scene.
This forces the current scene, so it fixes a bug where the
transition would be grayed out when undoing/redoing.
2021-04-10 01:49:30 -07:00
wangshaohui 48b779c7b2 UI: Ignore scene source which has been removed
While getting source list, we should ignore scene source which has been
removed. If we don't ignore it, a deleted scene source will be added
later. Besides, signals of that scene have been sent before, such as
"remove" of scene. So we can't remove this scene source by "auto
removeItem" defined in SourceTreeItem::ReconnectSignals().

Fixes obsproject/obs-studio#2602
2021-03-31 02:48:54 -07:00
wangshaohui 81c4750fbf UI: Fix UI deadlock after dragging source
Fixes obsproject/obs-studio#2609
2021-03-30 05:49:00 -07:00
Ford Smith 60d95cb5bd UI/libobs: Undo/Redo Sources and Scenes
Implements the Undo/Redo for scenes and sources, ranging from renaming,
deletion, addition. It also adds several elements to libobs that were
designed to facilitate undo/redo, and should not affect the rest of
libobs.
2021-03-29 03:06:26 -04:00
Kurt Kartaltepe 513bcb8e35 UI: Cleanup Qt for Qt6
This changes cleans up some deprecated functions that were removed in
Qt6. Some are placed behind version ifdefs and others are replaced for
their non-deprecated Qt5 version.
2021-03-08 21:41:13 -08:00
Richard Stanway 38ad3ba18f UI: Add deferred function to update context bar
With the queued connection in d68484e7, the "Deselect" signal for
sources which are being deleted is never fired, as the object is gone by
the time the queued signal is processed. This results in the context bar
not updating.

This commit adds a new UpdateContextBarDeferred function, allowing
queuing of only the context bar update instead of the whole signal
handler.
2020-12-14 11:53:01 -08:00
Exeldro d68484e7b7 UI: Handle (de)select scene items queued
The (de)select signal can come from a obs_scene_enum_items
which locks the scene. The Qt::QueuedConnection makes sure
the (de)select is handled outside of that lock.
Fixes the deadlock from #3673
2020-12-11 17:05:38 -08:00
VodBox 89b4e9136f UI: Various screen reader fixes
This commit fixes various issues with screen readers in the main OBS
interface. These were tested using NVDA on Windows 10 2004.

Audio track selection in Settings now says Track 1, 2, etc, rather than
just the number.

Various checkboxes that just say "Enable" now have accessible text that
says what the enable is for (since it says "checkbox", the fact it's an
enable should hopefully be clear).

Type in the recording tab of output now has accessible text which says
"Recording Type".

Items in the Advanced Audio Properties window now have accessible text
for what they are for. Currently some do not report correct values, but
that will require an accessible interface in Qt to be written
specifically for that, which will be done at a later date.

Buttons in the filters window now have accessible text for what they do.

All the right side buttons in hotkeys now have tooltips, and by
extension, accessible text.
2020-11-25 19:38:05 -08:00
Joshua Berenhaus f56ab9a38b UI: Set focus back to label after source rename
Fixes obsproject/obs-studio#3465
2020-10-09 14:01:25 -07:00
Colin Edwards fddbbe259d UI: Source Toolbar
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>
2020-08-17 07:18:18 -07:00
Clayton Groeneveld 2fe749fc84 UI: Make select/deselect signals work w/ group items 2020-05-19 06:36:00 -05:00
Matt Gajownik c50f488085 UI: Dynamically set widget index when renaming sources 2020-03-04 19:22:30 +11:00
jp9000 9f1c442d35 UI: Add option to toggle source icons to View menu 2020-01-20 23:19:32 -08:00
Clayton Groeneveld 4e85843d4e UI: Fix source icons being shifted to the right 2019-12-03 05:55:52 -06:00
Clayton Groeneveld 82ffcdc827 UI: Add source icons 2019-11-24 20:50:42 -08:00
jp9000 3064887ae2 Revert "UI: Various screen reader fixes"
This reverts commit b5843caa48.

This breaks some hotkeys because the signals are tied to a signal which
is now triggered because "toggled" is used instead of "clicked", so just
revert it for now for the release and look at it later post-patch.
2019-09-12 13:55:31 -07:00
VodBox b5843caa48 UI: Various screen reader fixes
This commit fixes various issues with screen readers in the main OBS
interface. These were tested using NVDA on Windows 10 1903.

Checkboxes or buttons which toggle, when receiving an activate signal
from the screen reader would visually update, but not perform any
action. This is because they're listening only for clicks. They should
all now be listening for toggles instead.

The screen reader would navigate through the UI in the order that
elements are defined in the .ui XML, and not by their row positions.
The XML has been reordered so that things should be defined in their row
order.

Audio track selection now says Track 1, 2, etc, rather than just the
number. Various checkboxes that just say "Enable" now have accessible
text that says what the enable is for (since it says "checkbox", the
fact it's an enable should hopefully be clear). Type in the recording
tab of output now has accessible text which says "Recording Type".

All the right side buttons in hotkeys now have tooltips, and by
extension, accessible text. Currently it does not yet say what hotkey
the action is in relation to, but that would require more locales.
2019-09-04 12:43:56 +12:00
VodBox 128b90af9d UI: Add box select to preview
This change adds the ability to box select by clicking and dragging from
an empty part of the preview.

Shift + Drag add any items in the box to the selection. Alt + Drag will
remove items in the box from the selection. Ctrl + Drag inverts the
selected state for items in the box.
2019-08-17 07:42:14 -07:00
jp9000 d5d8492bb3 UI: Add LineEditChanged and LineEditCanceled
These functions allow item delegates (editors) or item widgets with
event filters to detect whether a user has finished editing a line edit
control.  This separates the code so it can be used elsewhere than just
in the source tree widget.
2019-08-08 03:25:33 -07:00
Richard Stanway 183cc920c8 UI: Avoid ternary operator for mixed types 2019-06-29 01:28:16 +02:00
jp9000 f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
Chris Angelico 2fe641b8a4 libobs, UI: Implement item_locked event
Similar to item_visible, this event fires whenever a scene item is
locked or unlocked. This allows the UI and libobs to remain in sync
regarding scene elements' statuses.
2019-06-15 16:09:10 -07:00
jp9000 4d3414a1ce UI: Fix editor inheriting source list stylesheet
Fixes a bug where if the user gave a custom color to a source list item,
the edit box used with renaming the item would also have that
background color while editing the name, awkwardly.
2019-06-11 22:20:51 -07:00
jp9000 b5b11dbf47 UI: Fix bug with custom source list item color
If the user gave the source list item a custom color, the "background"
stylesheet value would apply to children of the item widget, causing the
lock/eye checkboxes to also have that background color added on top of
the chosen color.  This is fixed by explicitly settings the background
value to none on the lock/eye checkboxes.
2019-06-11 21:31:26 -07:00
Clayton Groeneveld 189e48835d UI: Change icons to svg
This changes all of the icons from png to svg. With svgs, scaling is
unlimited. With the svgs, the issue of the @ symbols with the Windows
updater is no longer an issue.

I changed the colors of the icons to a light gray (#d2d2d2), in the
dark themes, because I thought they looked better with this color.

The mute, unmute, plus, minus, up, down and expand icons are from the
Feather Icons set. https://feathericons.com/

The visibility icon is from the Octicons set. https://octicons.github.com/

The locked and unlocked icons are from the Open Iconic set.
https://github.com/iconic/open-iconic
2019-04-22 01:50:03 -07:00
Colin Edwards ff72e9efc3 UI: Show a message in the empty source list 2019-04-12 04:17:39 -07:00
Anthony Torres fdae1bbc0f UI: Add text autoselect for source rename 2019-04-08 02:14:06 -07:00
jp9000 1b8ecae3b9 UI: Fix potential race condition for hover items
The graphics thread should not be accessing any Qt objects that aren't
guaranteed to exist.  Instead, store the currently hovering list/preview
scene items in the preview class.
2019-02-11 15:30:56 -08:00
jp9000 476716798b UI: Fix being unable to drag/drop source list items 2019-02-09 12:56:48 -08:00
VodBox 6c880fb3c8 UI: Change preview handles/outline and add hover 2019-02-08 20:58:40 +13:00
jp9000 0a202ab77b UI: Fix potential race condition
The signal mutex can be locked within other signal mutexes, causing a
potential hard cross-lock when releasing certain sources.  Instead,
defer the Disconnect() call to the UI thread.

This fixes a potential freeze on exit.
2019-02-07 17:00:46 -08:00
jp9000 8f52179912 UI: Fix accessibility/narration text on sources list
Fixes the narration reading (for the blind) for items in the sources
list; previously they would not be read due to the new custom model.
This issue is solved by returning the name of item in the form of a
QVariant of a QString returned from the QAbstractItemModel::data virtual
function when the Qt::AccessibleTextRole role is used.
2019-01-20 00:55:56 -08:00
Shaolin 6c17c10e77 UI: Add rename scene/source shortcut
This creates a hidden QAction in sceneDocks and sourceDocks so we can
assign a shortcut to perform the renaming action.
2018-08-31 22:08:53 -03:00
jp9000 4e97b1bb30 UI: Fix macOS bug (scrollbar blocking lock icons)
Normally on macOS, scrollbars are supposed to appear/disappear as you
scroll, but they would be on top of the content you're scrolling.
However, Qt has a bug where if you apply a custom theme to scroll bars,
they no longer disappear.  This causes things under the scrollbar (such
as the lock icons in the sources list) to disappear under the scrollbar,
because macOS normally expects those scrollbars to face out.  This fixes
that issue by adding a space to the end of the sources list box items to
allow space for the scrollbar.
2018-08-28 20:38:31 -07:00
jp9000 448399d5ea UI: Fix group sub-item selection bug
If a group's sub-item is selected in the list box and you select the
group via the preview, the sub-item would be deselected, but that
deselection would not be applied to the sub-item in the list box despite
being deselected.
2018-08-16 12:40:45 -07:00