Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoinamountfield.cpp
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | QSize minimumSizeHint() const override { | ||||
// Cursor blinking space. | // Cursor blinking space. | ||||
w += 2; | w += 2; | ||||
QStyleOptionSpinBox opt; | QStyleOptionSpinBox opt; | ||||
initStyleOption(&opt); | initStyleOption(&opt); | ||||
QSize hint(w, h); | QSize hint(w, h); | ||||
QSize extra(35, 6); | QSize extra(35, 6); | ||||
opt.rect.setSize(hint + extra); | opt.rect.setSize(hint + extra); | ||||
extra += hint - | extra += | ||||
style() | hint - style() | ||||
->subControlRect(QStyle::CC_SpinBox, &opt, | ->subControlRect(QStyle::CC_SpinBox, &opt, | ||||
QStyle::SC_SpinBoxEditField, this) | QStyle::SC_SpinBoxEditField, this) | ||||
.size(); | .size(); | ||||
// Get closer to final result by repeating the calculation. | // Get closer to final result by repeating the calculation. | ||||
opt.rect.setSize(hint + extra); | opt.rect.setSize(hint + extra); | ||||
extra += hint - | extra += | ||||
style() | hint - style() | ||||
->subControlRect(QStyle::CC_SpinBox, &opt, | ->subControlRect(QStyle::CC_SpinBox, &opt, | ||||
QStyle::SC_SpinBoxEditField, this) | QStyle::SC_SpinBoxEditField, this) | ||||
.size(); | .size(); | ||||
hint += extra; | hint += extra; | ||||
hint.setHeight(h); | hint.setHeight(h); | ||||
opt.rect = rect(); | opt.rect = rect(); | ||||
cachedMinimumSizeHint = | cachedMinimumSizeHint = | ||||
style() | style() | ||||
->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this) | ->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this) | ||||
▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines |