mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-10 19:26:14 -05:00
This required the following adjustments: Instead of having a dedicated entry indicating the empty selection the setPlaceholderText() mechanism is used. Thus the locations where the 1st entry was assumed to be the empty selection would have to be adjusted. Additional checks for the empty string / index -1 have been added. FindIdxInRagne() was adjusted to return -1 instead of 0 in case the given string was not found. Switched to index based singal instead of text based signal to be notified about selection changes.
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
#pragma once
|
|
#include "filter-combo-box.hpp"
|
|
#include "utility.hpp"
|
|
|
|
namespace advss {
|
|
|
|
class TransitionSelection {
|
|
public:
|
|
void Save(obs_data_t *obj, const char *name = "transition",
|
|
const char *typeName = "transitionType") const;
|
|
void Load(obs_data_t *obj, const char *name = "transition",
|
|
const char *typeName = "transitionType");
|
|
|
|
enum class Type {
|
|
TRANSITION,
|
|
CURRENT,
|
|
ANY,
|
|
};
|
|
|
|
Type GetType() const { return _type; }
|
|
OBSWeakSource GetTransition() const;
|
|
std::string ToString() const;
|
|
|
|
private:
|
|
OBSWeakSource _transition;
|
|
Type _type = Type::TRANSITION;
|
|
friend class TransitionSelectionWidget;
|
|
};
|
|
|
|
class TransitionSelectionWidget : public FilterComboBox {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
TransitionSelectionWidget(QWidget *parent, bool current = true,
|
|
bool any = false);
|
|
void SetTransition(TransitionSelection &);
|
|
void Repopulate(bool current, bool any);
|
|
signals:
|
|
void TransitionChanged(const TransitionSelection &);
|
|
|
|
private slots:
|
|
void SelectionChanged(const QString &name);
|
|
|
|
private:
|
|
bool IsCurrentTransitionSelected(const QString &name);
|
|
bool IsAnyTransitionSelected(const QString &name);
|
|
};
|
|
|
|
} // namespace advss
|