Commit Graph

34 Commits (master)

Author SHA1 Message Date
pkv 3191c73e16 UI: Fix theme leak
This fixes leaks when loading and switching themes.

Signed-off-by: pkv <pkv@obsproject.com>
2022-08-16 07:36:18 -07:00
Matt Gajownik a7503254f3 Revert "UI: Apply default stylesheet before applying theme"
This reverts commit 08cee21158.

Turns out that while this did improve theme switching performance, it
also completely breaks styling on macOS and introduces visual quirks
on Windows after switching themes, such as sliders and dropdown contents.

# Conflicts:
#	UI/obs-app.cpp
#	UI/obs-app.hpp
2022-08-09 22:39:26 +10:00
Matt Gajownik cb8bc3413a UI: Add support for theme meta, parent theme palette
Theme Meta allows individual themes to provide additional information to
OBS.

The primarily goal is for a theme to define a "parent", allowing to
extend existing themes with additional attributes.
2022-07-30 18:48:19 +10:00
gxalpha 80e2a980bf UI: Remove disable_high_dpi_scaling option on Qt 6
With Qt 6, high dpi scaling is always enabled and the
AA_DisableHighDpiScaling becomes no-op. As such, the command line
argument can get removed.
2022-07-20 14:14:38 -04:00
Matt Gajownik 08cee21158 UI: Apply default stylesheet before applying theme
This significantly improves performance when switching themes.
The original intent was to "clear" customizations applied by the
previously selected theme. This change does not seem to achieve that goal.
2022-07-04 23:28:48 +10:00
Richard Stanway 076cd5d5d4 UI: Add option to hide OBS windows on Windows
This uses the SetWindowDisplayAffinity API to hide windows from capture
applications (including OBS). This is not perfect - internal windows
such as context menus, combo box dropdowns, etc will still be displayed.
Even with these limitations, it should help people with single monitors
capture content with less interference from the OBS window.

This implementation is for Windows only but the code is generic enough
that adding other platforms should be straightforward.
2022-01-22 15:14:16 -08:00
Ryan Foster 54a808c34a UI: Set Twitch Panel Dark Mode using OBS theme
Check if the current OBS theme is "Dark Mode"-esque and use that to
determine if the Twitch browser panel docks should use Twitch's Dark
Mode or not.
2021-11-24 00:03:39 -08:00
tt2468 502bc3bf0a UI: Add startup flag to disable missing files window
Adds a startup flag (--disable-missing-files-check) to disable the
missing files dialog from appearing on load. For some users, the
missing files dialog may interfere with automation of OBS, or the
user may also purposefully have missing files in their scene
collection which they do not want to be warned about.
2021-07-09 18:32:56 +12:00
Lordmau5 5b899788da UI: Add launch parameter to disable high-DPI scaling 2021-02-01 05:44:37 -08:00
Ryan Foster 9b1d1c1b3d UI: Make GetUnusedSceneCollectionFile usable elsewhere 2021-01-11 14:49:59 -08:00
jp9000 e5d8f345fc UI: Fix screenshots preventing auto-remux
Due to the fact that a global was used on GenerateSpecifiedFilename to
save the remux file name, when a screenshot was made, it would overwrite
the filename being remuxed, because screenshots use the same function to
generate filenames as well.

This solves that problem by removing the global and the changes to
GeneratedSpecifiedFilename, and isolating that to the output handler.

Coincidentally, this bug probably also happened with replay buffers
under certain circumstances.

Fixes obsproject/obs-studio#3497
Closes obsproject/obs-studio#3498
2020-09-26 08:19:27 -07:00
Clayton Groeneveld cc565653d3 UI: Simplify path generation code 2020-07-30 17:41:43 -07:00
Richard Stanway 06321f89e1 UI: Remove OBSContext class and shutdown in run_program
The OBSContext never called obs_startup but would always call
obs_shutdown in its destructor, resulting in shutdown calls even if
libobs wasn't initialized (eg due to a startup error). Instead, we now
track if libobs was initialized in OBSApp and call shutdown in the
destructor.
2020-07-23 23:17:52 +02:00
derrod 30862d75ae UI: Add flag/file to disable built-in updater
When distributing OBS via third party platforms that have their own
update systems we want to be able to disable the OBS updater without
having to resort to having a separate build entirely.
2020-07-18 21:33:47 +02:00
jp9000 a72a52fa38 UI: Add virtual camera to UI
Adds a virtual camera button to the main user interface.  If virtual
camera is not installed, it will not add the button.  On Windows, it
detects whether the virtual camera filters are properly registered, and
will only add the button if the virtual camera filter is confirmed
registered.

Also adds a virtual camera option to the auto-configuration wizard,
which will just simply set the user's resolution/scale to 1920x1080 at
30 FPS.
2020-07-07 06:09:59 -07:00
Clayton Groeneveld e0135823ce UI: Restart program when audio/locale changed 2020-02-16 16:12:00 -06:00
Jonathan Baecker 19464e6552 UI: Add ability to disable hotkeys when not in focus 2019-07-22 01:20:12 -07:00
jp9000 9ca1e85f7d UI: Fix hotkeys working even when disabled in focus
Fixes a bug where the hotkey inject would trigger hotkeys despite
hotkeys being disabled when in focus.
2019-07-22 01:11:34 -07: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
jp9000 106222154a UI: Add way to exec std::function via invokeMethod
Allows the ability to use invokeMethod on the OBSApp object to execute
an std::function.  This allows deferring an std::function call to the Qt
event queue.
2019-03-05 14:39:24 -08:00
cg2121 2fedcab987 UI: Add option to auto remux 2018-09-18 20:55:12 -05:00
jp9000 8dc2e6b5fb UI: Add signal for when theme has changed 2018-07-21 19:14:36 -07:00
jp9000 e1ab9a0fc4 UI: Add ability to parse OBSStyle from qss
Adds the ability to set the current palette for the program via adding
"OBSTheme" objects to the qss files.  The values for the OBSTheme object
are the values used by QPalette::ColorRole.

Modifying the global palette allows the ability to easily/quickly look
up application theme colors (especially if you would like to use them
for QML), as well as the ability to fix the hyperlink color issue.  (On
dark themes, links would still be dark blue, causing them to be
difficult to see)
2018-07-21 19:14:36 -07:00
Shaolin b8a901c870 UI: Convert multiview layout string profiles to int
This commit series changes the ini user configuration multiview layout
so that string values were converted to int. In order to prevent past
user saves to break we verify if the ini still have string values and
convert that to int on obs init.

This will make the code easier to maintain in clearer to read the
multiview layout settings, also, makes the addition of new layouts
easier.
2018-05-20 23:20:52 -03:00
jp9000 051c58eeb7 UI: Add opt. to enable/disable in-focus hotkey blocking
Adds an option to enable/disable blocking hotkeys when the window is in
focus which is normally used in order to prevent hotkey/shortcut
conflicts.  This does not apply to the settings window; the hotkey
behavior is unchanged with the settings window (in order to prevent
hotkeys from being used while setting hotkeys for example).

Closes obsproject/obs-studio#1267
2018-05-06 17:14:04 -07:00
jp9000 3b64610717 UI: Add Help -> Crash Reports submenu
Adds the ability to upload crash reports, making it easier for users to
give us crash data.  This should be considered a temporarily solution,
as automated crash reporting should be the ideal solution as soon as
time permits.
2018-03-16 16:27:49 -07:00
jp9000 96ce9633e0 UI: Warn user if multiple instances of the UI are open
Uses a named mutex to detect if multiple instances of the program are
open, and if so warns the user.  When running in portable mode, uses a
separate unique mutex name mapped to the user's config directory to
ensure that no two portable builds use the same config directory.  This
way, portable builds do not conflict with normal builds or other
separate portable builds.
2017-05-14 15:25:34 -07:00
Shamun 0206227b75 UI: Add command line option for starting up always on top
Closes jp9000/obs-studio#853
2017-04-30 07:49:25 -07:00
Richard Stanway fdc9c47875
UI: Hide OpenGL and D3D adapter on Windows
OpenGL on Windows is rather unstable and can result in graphical
corruption or the complete inability to start OBS since some GPUs do not
support the minimum requirements after switching to OpenGL. The UI option
is now hidden unless --allow-opengl is passed on the command line.

The D3D adapter is currently unused and we often find users are concerned
when their GPU does not appear in the list.
2017-04-10 15:54:51 +02:00
cg2121 7c98edccc5 UI: Add more command line options 2017-01-11 15:48:59 -06:00
Ryan Foster b75292dbf4 UI: Add Portable Mode indicator to title bar and log
Closes jp9000/obs-studio#654
2016-10-09 18:10:18 -07:00
jp9000 48f0c73f82 UI: Use rect intersection test for validating position
Instead of checking to see if the window's position is valid, check to
see if the rectangles of the window and the monitor intersect via a
rectangle intersection test.
2016-09-28 22:26:28 -07:00
jp9000 8836592d92 UI: Add front-end API library
Allows manipulating and modifying the front-end via plugins.
2016-09-06 22:01:48 -07:00
jp9000 01b274f1da UI: Rename 'obs' dir to 'UI'
This is to prevent confusion both when prefixing commits and when
reading the directory structure for the first time.
2016-08-27 20:19:45 -07:00