Commit graph

24 commits

Author SHA1 Message Date
Ryan Foster 02478d4939 UI: Use std::shared_ptr instead of QSharedPointer
Also use std::weak_ptr instead of QWeakPointer as needed.

Qt has been porting QSharedPointer and QWeakPointer to std::shared_ptr
and std::weak_ptr respectively. QSharedPointer is apparently 2x slower
than std::shared_ptr.

References:
 * https://bugreports.qt.io/browse/QTBUG-109570
 * https://codereview.qt-project.org/c/qt/qtbase/+/359678
 * https://codereview.qt-project.org/c/qt/qtgrpc/+/447780
 * https://codereview.qt-project.org/c/qt/qtbase/+/450134
 * https://codereview.qt-project.org/c/qt/qttools/+/450776
 * https://codereview.qt-project.org/c/qt/qttools/+/450777
 * https://codereview.qt-project.org/q/QSharedPointer
2023-10-04 18:36:20 -04:00
Ryan Foster f049d04af4 UI: Store dock titles in BrowserDock instead of relying on Qt
Attempting to set the window title of a BrowserDock that is closed, then
opening the BrowserDock, would show that BrowserDock with an incorrect
title. We can handle this by overriding the showEvent of BrowserDock and
manually setting the window title after the showEvent is called,
hopefully ensuring that we are only setting the window title on a window
that exists.
2023-08-15 12:27:18 -04:00
Ryan Foster 25b97df6eb UI: Update text for custom browser dock menu items manually
Instead of relying on the dock's having their window title already set
for the menu items to be updated, let's just manually update the menu
item text ourselves when updating the item.
2023-08-15 12:27:18 -04:00
Ryan Foster 20e4f0cad3 UI: Track custom browser dock names internally
This is a workaround for a change in Qt behavior between 6.5.1 and
6.5.2[1] which affected the outcome of attempting to set the window
title of a window that is not currently open. In Qt 6.4.3 and 6.5.1, the
window title would be set. In Qt 6.5.2, the window title will become
NULL/empty.

Instead of relying on Qt to have valid titles for custom browser dock
windows that we manage, let's track the names ourselves.

[1]: c153066baa
2023-08-15 12:27:18 -04:00
Matt Gajownik 7d9f8e7cac UI: Set browser dock title in constructor
Works around a bug in Qt where setWindowTitle called on a native window
that hasn't been initialised yet causes the title data to be lost,
resulting in the window's title never being set.
2023-08-15 12:27:18 -04:00
derrod dcc07cfe4e clang-format: Set AllowAllConstructorInitializersOnNextLine to false 2023-07-15 16:14:55 -07:00
tytan652 e6873d3278 UI: Refactor integration and browser docks
Use the QAction provided by QDockWidget with new Qt connection rather
than creating a new one for each dock.

Separate extra browser docks from extra docks, the latter is meant for
plugin/integration docks.
2023-03-17 20:21:08 +11:00
gxalpha 97f76f99e5 UI: Remove separate trash icon themeID
The removeIconSmall is now also a trash icon, so we don't need a
separate (now duplicate) themeID for it anymore.
The icon itself of course needs to stay as it's still needed.
2022-08-20 16:46:02 -07:00
tytan652 2a0e3c0c9b UI: Save custom browser docks with docks data
When saving custom browser docks, docks properties are used rather
than actions properties.
2022-03-22 22:24:23 -07:00
tytan652 b4b1b4c5d3 UI: Remove UUID from ExtraBrowsersModel
This attribute is completely unused.
2022-03-22 22:24:23 -07:00
tytan652 ed8ed0ce3f UI: Fix custom browser docks UUID
When those docks get updated, an empty string is applied to the UUID
property.
2022-03-22 22:24:23 -07:00
cg2121 7b418d5be3 UI: Use std::unique_ptr for ui variables
Most ui variables were using std::unique_ptr, but not all.
Went through all of the UI code to find where they were manually
deleted.
2022-02-20 00:30:37 -08:00
Matt Gajownik 0b67dc0285 UI: Uniquely identify Custom Browser Docks 2021-12-04 15:08:46 -08:00
Matt Gajownik bc9911f5a6 UI: Pass parent QWidget to Browser Docks 2021-11-30 23:28:20 -08:00
Matt Gajownik ab5d41c445 UI: Add separator before Custom Browser Docks in Dock menu 2021-11-26 18:06:51 +11:00
waffeln 46dcc9c2fb UI: Lower minimum dock size
Closes obsproject/obs-studio#2448
2020-03-04 22:25:39 -08:00
Matt Gajownik c988f6487d UI: Allow custom browser delete button to fill the cell 2020-02-21 22:05:37 +11:00
jp9000 d41536cf02 UI: Fix invalid escape sequences in regex string 2019-11-17 20:29:53 -08:00
Matt Gajownik 59e274f623 UI: Add support for Custom Twitch Dashboard Docks 2019-10-15 21:38:18 +11:00
jp9000 3f28d44d00 UI: Fix extra browser panels always creating on startup
The extra browser panels would always create on startup due to the
visibility change.  This fixes that by ensuring that this call blocks
signals, and ensures that the call only happens on first creation by the
user and not when the user is loading on startup.
2019-09-15 13:18:13 -07:00
jp9000 5d19786e04 UI: Fix browser docks being unchecked when created
In the view -> Docks menu, when a user first creates a custom browser
dock, the menu item associated with them used to hide/show them will be
unchecked in the menu by mistake.  This ensures they're checked when
first created.
2019-09-14 19:37:37 -07:00
jp9000 7dd465cae1 UI: Refactor all browser dock classes in to one
Refactors all cases where a window class was created to show a browser
dock in to one class: BrowserDock.  Removes some unnecessary code
duplication.
2019-09-03 19:12:36 -07:00
Clayton Groeneveld 1e033aadca UI: Fix look of extra panels trash icon 2019-08-13 00:58:04 -05:00
jp9000 0759652cee UI: Add the ability to create custom browser docks
Allows the ability for users to add custom browser widget docks that
they can use for their third party services if they feel the need,
mostly as a convenience tool so they don't have to open extra browsers
alongside the program.
2019-08-08 03:31:31 -07:00