Commit Graph

189 Commits (master)

Author SHA1 Message Date
gxalpha 8cf46ca68c UI: Properly register VoidFunc in Meta Object System 2022-08-20 16:45:07 -07:00
Matt Gajownik c7da23bf96 UI: Remove spaces from translation keys
Qt translation strings use the full English string as an identifier,
rather than a standardised key. Meanwhile, .ini files aren't designed
for keys with spaces, so a translation string for "Restore Defaults"
won't match unless the ini line is
"Restore Defaults"="Defaults"
which is inconsistent, unpleasant and harder to read.
2022-08-18 03:35:51 -07:00
cg2121 ccfe300f72 UI: Reintroduce faster theme switching
Based on (was reverted):
08cee21158

This simplifies the faster switching code, as setting an empty
stylesheet resets it to default.
2022-08-18 02:34:47 -07:00
gxalpha 0a94b3ce16 UI: Only set QStyle on app start
Setting a QStyle resets the color palette. This is unhelpful when a few
lines before that we set a new palette. In theory the setStyle call
could just be moved up, but we don't need to since we always set the
same style so there's no reason to call it multiple times.
2022-08-18 14:22:55 +10:00
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
derrod 9140c260ee UI: Add Whats New for macOS/Linux
- Requires MbedTLS on Linux
- Enabled by default on macOS and Flatpak
- Enabled on linux via ENABLE_WHATSNEW_LINUX
- Enables compilation of blake2 on Linux/macOS
- Makes header name check also work with lowercase header
- Changes WahtsNew to be only enabled when browser panels are available
2022-08-13 16:46:48 -07:00
Matt Gajownik 3a7a6f4dc0 UI: Fix build error with stray defaultStylesheet 2022-08-09 22:57:23 +10: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
gxalpha 37526e9ac9 UI: Add macOS permissions window
Co-Authored-By: Matt Gajownik <git@wizardcm.com>
2022-07-31 18:14:41 +02:00
gxalpha e75b509bba UI: Include OpenSans font with OBS
Also reinstates the font-family statement removed in 2941c48
2022-07-31 20:23:19 +10:00
Clayton Groeneveld 2d6a9c9cc1 UI: Show spacing helpers in preview
This shows distance between sides of preview and edges of sources.
This will allow users to more easily align sources.

Co-authored-by: Palakis <contact@slepin.fr>
2022-07-30 19:41:18 -07: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
jp9000 8ef134be79 UI: Set default theme to Yami
Note that this adds a new CurrentTheme3 config variable to preserve
settings of versions older than 28, making this change safely
backward-compatible.
2022-07-28 20:38:51 -07:00
PatTheMav e15fdf69c0 UI: Add functions to check for and request macOS permissions
Adds functions to check and/or request specific macOS permissions
(audio device access, video device access, accessibility access, and
screen capture access).

By default only audio capture, video capture, and accessibility are
requested on launch - the first two have straight-forward "Yes/No"
prompts, the latter requires people to enable OBS in the settings
application (but is required for hotkey functionality, independent
of scene setups).
2022-07-26 14:20:34 +02:00
PatTheMav c1740e3636 UI: Add initialization to ensure compat between pthread and NSThread
Ensures that Cocoa knows that we intend to use multiple threads, per
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html#//apple_ref/doc/uid/10000057i-CH15-SW21
2022-07-25 17:27:07 +02:00
tytan652 6d06052c51 UI: Enforce Fusion Qt style on Linux
The Breeze Qt style plugin adds frame arround QDockWidget with QPainter
which can not be modifed. To avoid this the base style is enforce to the
Qt default style on Linux: Fusion.
2022-07-24 10:22:18 +10:00
gxalpha e3f416f3fc UI: Replace QMessageBox setButtonText with addButton 2022-07-22 09:37:17 -04: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
gxalpha 0fa7834bfc UI: Use libobs rosetta detection 2022-06-19 01:37:15 +02:00
Georges Basile Stavracas Neto ca2d02c2ce Drop GLX renderer
"They must often change, who would be constant in happiness or wisdom"

 - Confucius
2022-05-24 14:31:48 -03:00
jpark37 e646eb4828 UI: Restore portable mode on Windows 2022-05-08 06:47:09 +02:00
PatTheMav 55b23a26d2 UI: Fix configuration path handling for Linux portable builds
Original code uses simple `ifdef` pattern as well using the preprocessor
definition in a conditional check. With the rework, the definition was
set to an empty string (if the build flag is not enabled), which leads
to it being evaluated as "true" all the time.

This change uses simpler definition check and fences off code relying
on the flag being enabled.
2022-05-03 14:35:08 -04:00
tt2468 af67ef8e57 libobs, UI: Fix `--verbose` logging for stdout
Verbosity of stdout was previously hardcoded to INFO, while log viewer
and log files had correct verbosity. This makes the behavior of
--verbose make sense in all places.
2022-04-09 16:48:37 -07:00
gxalpha e33b7d2dab UI: Disable wheel scrolling on QComboBoxes
Adds a new ProxyStyle, OBSIgnoreWheelProxyStyle, and applies it to the
entire program. This style sets a StyleHint to disable mouse wheel
scrolling on QComboBoxes.
The existing OBSProxyStyle, which is used only for the context bar, has
been renamed accordingly.
2022-04-02 16:04:51 -07:00
gxalpha ee781bfa24 UI: Remove unneeded QProxyStyle include 2022-03-26 17:57:14 +11:00
gxalpha dde2fe209a UI: Remove InitApplicationBundle() function 2022-03-19 15:13:00 -07:00
PatTheMav 1f0f2be15e
UI: Update CMakeLists.txt for main OBS app 2022-03-16 23:11:58 +01:00
Misutaa Asriel 4afafaac6d UI: Fix unorthodox macOS Dock icon behavior
Fixes overriding of macOS dock icon behavior.

macOS sets the icon on launch based on:
- The Information PLIST
- A user provided icon by Finder

setWindowIcon overrides this behavior.

Therefore, this commit resolves this issue,
by doing nothing if target is macOS.
2022-03-08 08:50:34 -08:00
gxalpha 6d86b58ed7 UI: Simplify multi-instance check 2022-03-05 15:21:11 -08:00
jpark37 fa5a05f188 UI: Restore LC_NUMERIC to C locale on Mac/Linux
Recommended by QCoreApplication doc for Unix.

Fixes CUBE LUT load, and FFmpeg output args for foreign locales.
2022-03-01 12:53:51 -08:00
Matt Gajownik 2ded0f7050 UI: Log 'Hide OBS from capture' on startup & settings change 2022-02-20 13:38:17 +11:00
Rodney b7a24d54c9
UI: Add warning on startup for running in Wine 2022-02-07 14:16:59 -08: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
gxalpha d601577706 UI: Fix small typo 2022-01-21 10:07:25 -05:00
Nicolas Fella f43b046f8b UI: Set desktopFileName for QApplication
This needs to match the base name of the .desktop file name.

This is needed for propagating the correct App ID on Wayland,
which is needed e.g. for proper window icons on Plasma.
2022-01-16 18:03:27 +11:00
Norihiro Kamae 2fc83f9408 UI: Do not localize timestamp in log file
Millisecond time in the log was added in 36ad777b8 but the millisecond
was not always added just after the second digits depending on locale
settings. To make consistency in the log file, `%T` is specified for
`strtime` instead of `%X` so that the time format is not localized.
2022-01-04 02:02:59 -08:00
gxalpha 8298f040fe UI: Add Rosetta Detection
Adds a check that detects if OBS is running on Rosetta on macOS and logs
the result.
2022-01-04 01:57:02 -08:00
VodBox 3d544653e8 UI: Cleanup libobs C++ type use 2021-11-26 23:23:51 +13: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
jpark37 86b607154a UI: Add support for real-time work queue 2021-10-10 19:53:27 -07:00
Matt Gajownik 115973b1ed UI: Log compiled & runtime Qt versions 2021-10-10 10:21:19 +11:00
Bob van de Vijver 1b280e0ac4 UI: Add ShutDownActiveOutputsOnExit setting
Adds a new setting to the general OBS settings, which can be checked
in order to no longer show the "confirm close" dialog when there are
still streams/recordings running.
2021-10-07 09:07:06 -07:00
jp9000 c459e8954c UI: Fix enter/esc when hotkeys are disabled in focus
Fixes an issue where enter/escape/return would not work in the program
if hotkeys were disabled while in focus. No other known keys were
affected by this filter issue.
2021-09-20 08:19:13 -07:00
Ryan Foster fd2aaf92b9 UI: Fix Qt6-incompatible call to QLocale::setDefault
The YouTube integration changes introduced code that does not build on
Qt6. The errors were:

 * void QLocale::setDefault(const QLocale &)': cannot convert argument 1
   from 'QString' to 'const QLocale &'

 * no suitable user-defined conversion from "QString" to "const QLocale"
   exists

This commit creates a new QLocale in place from a QString using the
`QLocale(const QString &name)` constructor, and passing that QLocale to
QLocale::setDefault.
2021-09-10 10:23:24 -07:00
Matt Gajownik 58caf406cd UI: Load theme palette before loading theme
This ensures the theme loads its own palette colours rather than default.
2021-08-23 17:14:22 -07:00
jp9000 7fffca945e Revert "UI: Remove macOS-Default Full Screen Menu Item"
This reverts commit cf445be44c.

Did not mean to merge this. #4768
2021-08-17 06:00:53 -07:00
gxalpha cf445be44c UI: Remove macOS-Default Full Screen Menu Item
macOS looks if the NSUserDefault NSFullScreenMenuItemEverywhere is set
to true, and if it is, it adds its own full screen menu item.
Sets this NSUserDefault to false since it defaults to true.
2021-08-17 05:58:29 -07:00
tytan652 47df2467e9 UI: Force Wayland usage under Wayland session
Qt doesn't use the Wayland platform on GNOME, so we have to
force it using the QT_QPA_PLATFORM env var. It's still possible to
use other QPA platforms using this env var, or the -platform command
line option.

qt5-wayland is now a required dependency for OBS on Linux (or FreeBSD).

Co-authored-by: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
2021-08-15 05:05:29 -07:00
Yuriy Chumak c4840ddba0 UI: Set Qt locale to current OBS locale
(Jim note: This will cause certain Qt functions to treat string
conversions differently depending on the language. Useful when using Qt
to perform these conversions.)
2021-07-24 15:50:59 -07:00