mirror of https://github.com/procxx/kepka.git
Minor refactoring
This commit is contained in:
parent
4b78d52194
commit
25fbc2f7e1
|
@ -2026,40 +2026,24 @@ void DialogsInner::loadPeerPhotos() {
|
||||||
_filterResults[from]->history()->peer->loadUserpic();
|
_filterResults[from]->history()->peer->loadUserpic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
auto offset = filteredOffset() + st::searchedBarHeight;
|
||||||
from = (yFrom > filteredOffset() + st::searchedBarHeight ?
|
from = (yFrom > offset ? ((yFrom - offset) / qint32(st::dialogsRowHeight)) : 0) - _filterResults.size();
|
||||||
((yFrom - filteredOffset() - st::searchedBarHeight) / qint32(st::dialogsRowHeight)) :
|
|
||||||
0) -
|
|
||||||
_filterResults.size();
|
|
||||||
if (from < 0) from = 0;
|
if (from < 0) from = 0;
|
||||||
if (from < _peerSearchResults.size()) {
|
if (from < _peerSearchResults.size()) {
|
||||||
qint32 to = (yTo > filteredOffset() + st::searchedBarHeight ?
|
qint32 to =
|
||||||
((yTo - filteredOffset() - st::searchedBarHeight) / qint32(st::dialogsRowHeight)) :
|
(yTo > offset ? ((yTo - offset) / qint32(st::dialogsRowHeight)) : 0) - _filterResults.size() + 1;
|
||||||
0) -
|
|
||||||
_filterResults.size() + 1;
|
|
||||||
if (to > _peerSearchResults.size()) to = _peerSearchResults.size();
|
if (to > _peerSearchResults.size()) to = _peerSearchResults.size();
|
||||||
|
|
||||||
for (; from < to; ++from) {
|
for (; from < to; ++from) {
|
||||||
_peerSearchResults[from]->peer->loadUserpic();
|
_peerSearchResults[from]->peer->loadUserpic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
from = (yFrom > filteredOffset() +
|
auto offset2 = offset + (_peerSearchResults.empty() ? 0 : st::searchedBarHeight);
|
||||||
((_peerSearchResults.empty() ? 0 : st::searchedBarHeight) + st::searchedBarHeight) ?
|
auto results_size = _filterResults.size() + _peerSearchResults.size();
|
||||||
((yFrom - filteredOffset() - (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) -
|
from = (yFrom > offset2 ? ((yFrom - offset2) / qint32(st::dialogsRowHeight)) : 0) - results_size;
|
||||||
st::searchedBarHeight) /
|
|
||||||
qint32(st::dialogsRowHeight)) :
|
|
||||||
0) -
|
|
||||||
_filterResults.size() - _peerSearchResults.size();
|
|
||||||
if (from < 0) from = 0;
|
if (from < 0) from = 0;
|
||||||
if (from < _searchResults.size()) {
|
if (from < _searchResults.size()) {
|
||||||
qint32 to = (yTo > filteredOffset() + (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) +
|
qint32 to = (yTo > offset2 ? ((yTo - offset2) / qint32(st::dialogsRowHeight)) : 0) - results_size + 1;
|
||||||
st::searchedBarHeight ?
|
|
||||||
((yTo - filteredOffset() - (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) -
|
|
||||||
st::searchedBarHeight) /
|
|
||||||
qint32(st::dialogsRowHeight)) :
|
|
||||||
0) -
|
|
||||||
_filterResults.size() - _peerSearchResults.size() + 1,
|
|
||||||
w = width();
|
|
||||||
if (to > _searchResults.size()) to = _searchResults.size();
|
if (to > _searchResults.size()) to = _searchResults.size();
|
||||||
|
|
||||||
for (; from < to; ++from) {
|
for (; from < to; ++from) {
|
||||||
|
|
|
@ -1609,11 +1609,9 @@ void LastCrashedWindow::updateControls() {
|
||||||
h += _networkSettings.height() + padding;
|
h += _networkSettings.height() + padding;
|
||||||
|
|
||||||
QRect scr(QApplication::primaryScreen()->availableGeometry());
|
QRect scr(QApplication::primaryScreen()->availableGeometry());
|
||||||
QSize s(2 * padding +
|
auto label_width = QFontMetrics(_label.font())
|
||||||
QFontMetrics(_label.font())
|
.width(qsl("Last time %1 was not closed properly.").arg(str_const_toString(AppName)));
|
||||||
.width(qsl("Last time %1 was not closed properly.").arg(str_const_toString(AppName))) +
|
QSize s(2 * padding + label_width + padding + _networkSettings.width(), h);
|
||||||
padding + _networkSettings.width(),
|
|
||||||
h);
|
|
||||||
if (s == size()) {
|
if (s == size()) {
|
||||||
resizeEvent(0);
|
resizeEvent(0);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue