mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-15 05:40:01 -05:00
Improve settings button selection handling
Will now try to keep the current button selection if possible. This can be useful when switching between source of the same time.
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
#pragma once
|
||||
#include "filter-combo-box.hpp"
|
||||
|
||||
#include <obs.hpp>
|
||||
#include <QComboBox>
|
||||
#include <qmetatype.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace advss {
|
||||
|
||||
class SourceSelection;
|
||||
class FilterSelection;
|
||||
|
||||
struct SourceSettingButton {
|
||||
bool Save(obs_data_t *obj) const;
|
||||
bool Load(obs_data_t *obj);
|
||||
@@ -18,7 +22,23 @@ struct SourceSettingButton {
|
||||
|
||||
std::vector<SourceSettingButton> GetSourceButtons(OBSWeakSource source);
|
||||
void PressSourceButton(const SourceSettingButton &button, obs_source_t *source);
|
||||
void PopulateSourceButtonSelection(QComboBox *list, OBSWeakSource source);
|
||||
|
||||
class SourceSettingsButtonSelection : public FilterComboBox {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SourceSettingsButtonSelection(QWidget *parent = nullptr);
|
||||
void SetSource(const OBSWeakSource &source,
|
||||
bool restorePreviousSelection = true);
|
||||
void SetSelection(const OBSWeakSource &source,
|
||||
const SourceSettingButton &button);
|
||||
|
||||
signals:
|
||||
void SelectionChanged(const SourceSettingButton &);
|
||||
|
||||
private:
|
||||
void PopulateSelection(const OBSWeakSource &source);
|
||||
};
|
||||
|
||||
} // namespace advss
|
||||
|
||||
|
||||
Reference in New Issue
Block a user