mirror of
https://github.com/vale981/tdesktop
synced 2025-03-05 17:51:41 -05:00
Version 1.7.3: Fix checkbox in url auth.
This commit is contained in:
parent
caf1af8963
commit
53ba300d7e
2 changed files with 15 additions and 1 deletions
|
@ -408,12 +408,25 @@ Checkbox::Checkbox(
|
|||
: RippleButton(parent, st.ripple)
|
||||
, _st(st)
|
||||
, _check(std::move(check))
|
||||
, _text(_st.style, text, _checkboxOptions, (_st.width > 0) ? _st.width : QFIXED_MAX) {
|
||||
, _text(
|
||||
_st.style,
|
||||
text,
|
||||
_checkboxOptions,
|
||||
countTextMinWidth()) {
|
||||
_check->setUpdateCallback([=] { updateCheck(); });
|
||||
resizeToText();
|
||||
setCursor(style::cur_pointer);
|
||||
}
|
||||
|
||||
int Checkbox::countTextMinWidth() const {
|
||||
const auto leftSkip = _st.checkPosition.x()
|
||||
+ checkRect().width()
|
||||
+ _st.textPosition.x();
|
||||
return (_st.width > 0)
|
||||
? std::max(_st.width - leftSkip, 1)
|
||||
: QFIXED_MAX;
|
||||
}
|
||||
|
||||
QRect Checkbox::checkRect() const {
|
||||
auto size = _check->getSize();
|
||||
return QRect({
|
||||
|
|
|
@ -191,6 +191,7 @@ protected:
|
|||
private:
|
||||
void resizeToText();
|
||||
QPixmap grabCheckCache() const;
|
||||
int countTextMinWidth() const;
|
||||
|
||||
const style::Checkbox &_st;
|
||||
std::unique_ptr<AbstractCheckView> _check;
|
||||
|
|
Loading…
Add table
Reference in a new issue