mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-10-02 06:19:50 -05:00
Add change count to var tab tooltip
This commit is contained in:
committed by
WarmUpTill
parent
eec9244e4c
commit
7fa0ba3355
@@ -85,7 +85,8 @@ static QString formatLastChangedTooltip(Variable *variable)
|
||||
|
||||
QString tooltip = obs_module_text(
|
||||
"AdvSceneSwitcher.variableTab.lastChanged.tooltip");
|
||||
return tooltip.arg(QString::fromStdString(variable->GetPreviousValue()));
|
||||
return tooltip.arg(QString::number(variable->GetValueChangeCount()))
|
||||
.arg(QString::fromStdString(variable->GetPreviousValue()));
|
||||
}
|
||||
|
||||
static void addVariableRow(QTableWidget *table, Variable *variable)
|
||||
|
||||
@@ -113,10 +113,11 @@ void Variable::UpdateLastUsed() const
|
||||
_lastUsed = std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
void Variable::UpdateLastChanged() const
|
||||
void Variable::UpdateLastChanged()
|
||||
{
|
||||
if (_previousValue != _value) {
|
||||
_lastChanged = std::chrono::high_resolution_clock::now();
|
||||
++_valueChangeCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,16 +38,18 @@ public:
|
||||
void SetValue(const std::string &value);
|
||||
void SetValue(double value);
|
||||
SaveAction GetSaveAction() const { return _saveAction; }
|
||||
int GetValueChangeCount() const { return _valueChangeCount; }
|
||||
std::optional<uint64_t> GetSecondsSinceLastUse() const;
|
||||
std::optional<uint64_t> GetSecondsSinceLastChange() const;
|
||||
void UpdateLastUsed() const;
|
||||
void UpdateLastChanged() const;
|
||||
void UpdateLastChanged();
|
||||
|
||||
private:
|
||||
SaveAction _saveAction = SaveAction::DONT_SAVE;
|
||||
std::string _value = "";
|
||||
std::string _previousValue = "";
|
||||
std::string _defaultValue = "";
|
||||
int _valueChangeCount = 0;
|
||||
mutable std::chrono::high_resolution_clock::time_point _lastUsed;
|
||||
mutable std::chrono::high_resolution_clock::time_point _lastChanged;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user