2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 23:15:59 +00:00

media overview multiple selection done, fixed search result delete crash

This commit is contained in:
John Preston
2014-08-21 16:18:56 +04:00
parent db7fa9ba2f
commit 8a817eb204
13 changed files with 267 additions and 83 deletions

View File

@@ -24,9 +24,7 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
Dropdown::Dropdown(QWidget *parent) : TWidget(parent),
_hiding(false), a_opacity(0), _shadow(st::dropdownShadow) {
_width = st::dropdownPadding.left() + st::dropdownPadding.right();
_height = st::dropdownPadding.top() + st::dropdownPadding.bottom();
resize(_width, _height);
resetButtons();
_hideTimer.setSingleShot(true);
connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(hideStart()));
@@ -48,6 +46,16 @@ IconedButton *Dropdown::addButton(IconedButton *button) {
return button;
}
void Dropdown::resetButtons() {
_width = st::dropdownPadding.left() + st::dropdownPadding.right();
_height = st::dropdownPadding.top() + st::dropdownPadding.bottom();
resize(_width, _height);
for (int32 i = 0, l = _buttons.size(); i < l; ++i) {
delete _buttons[i];
}
_buttons.clear();
}
void Dropdown::resizeEvent(QResizeEvent *e) {
int32 top = st::dropdownPadding.top();
for (Buttons::const_iterator i = _buttons.cbegin(), e = _buttons.cend(); i != e; ++i) {