mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-10-25 06:12:40 +00:00
5a58aa8a6b
When a QCefWidget is alone and all by itself, no layout updates are performed on the "window". This causes a problem where it just stays in place, instead of moving with the rest of the elements. The fix to this appears to be to just add a different Qt widget into the layout. Looks stupid, is stupid, but works anyway. Qt is weird.
51 lines
991 B
C++
51 lines
991 B
C++
// AUTOGENERATED COPYRIGHT HEADER START
|
|
// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
|
|
|
#pragma once
|
|
#include "util/util-library.hpp"
|
|
|
|
#include "warning-disable.hpp"
|
|
#include <QUrl>
|
|
#include <QWidget>
|
|
#include "warning-enable.hpp"
|
|
|
|
namespace streamfx::ui {
|
|
class obs_browser_cef {
|
|
std::shared_ptr<::streamfx::util::library> _module;
|
|
|
|
void* _cef;
|
|
void* _cookie;
|
|
|
|
private:
|
|
obs_browser_cef();
|
|
|
|
public:
|
|
~obs_browser_cef();
|
|
|
|
void* cef();
|
|
|
|
void* cookie_manager();
|
|
|
|
public: // Singleton
|
|
static std::shared_ptr<obs_browser_cef> instance();
|
|
};
|
|
|
|
class obs_browser_widget : public QWidget {
|
|
Q_OBJECT
|
|
|
|
std::shared_ptr<obs_browser_cef> _cef;
|
|
QWidget* _widget;
|
|
|
|
public:
|
|
obs_browser_widget(QUrl url, QWidget* parent = nullptr);
|
|
virtual ~obs_browser_widget();
|
|
|
|
void set_url(QUrl url);
|
|
|
|
QWidget* cefwidget();
|
|
|
|
public:
|
|
static bool is_available();
|
|
};
|
|
} // namespace streamfx::ui
|