MCPcopy Create free account
hub / github.com/ElementsProject/elements / stepEnabled

Function stepEnabled

src/qt/bitcoinamountfield.cpp:257–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255 }
256
257 StepEnabled stepEnabled() const override
258 {
259 if (isReadOnly()) // Disable steps when AmountSpinBox is read-only
260 return StepNone;
261 if (text().isEmpty()) // Allow step-up with empty field
262 return StepUpEnabled;
263
264 StepEnabled rv = StepNone;
265 bool valid = false;
266 const std::pair<CAsset, CAmount> val = value(&valid);
267 if(valid)
268 {
269 if (val.second > m_min_amount) {
270 rv |= StepDownEnabled;
271 }
272 if (val.second < m_max_amount || val.first != Params().GetConsensus().pegged_asset) {
273 rv |= StepUpEnabled;
274 }
275 }
276 return rv;
277 }
278
279Q_SIGNALS:
280 void valueChanged();

Callers

nothing calls this directly

Calls 2

valueFunction · 0.85
ParamsClass · 0.50

Tested by

no test coverage detected