Further small speedup for filebrowser
This commit is contained in:
parent
bbdd774afb
commit
2ca9f7f94d
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "lwbuttonset.h"
|
#include "lwbuttonset.h"
|
||||||
|
|
||||||
LWButtonSet::LWButtonSet () : aw(0), ah(0), ax(0), ay(0)
|
LWButtonSet::LWButtonSet () : aw(0), ah(0), ax(-1), ay(-1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,20 +42,21 @@ void LWButtonSet::getMinimalDimensions (int& w, int& h)
|
|||||||
w = 0;
|
w = 0;
|
||||||
h = 0;
|
h = 0;
|
||||||
|
|
||||||
for (size_t i = 0; i < buttons.size(); i++) {
|
for (const auto entry : buttons) {
|
||||||
int bw, bh;
|
int bw, bh;
|
||||||
buttons[i]->getSize (bw, bh);
|
entry->getSize(bw, bh);
|
||||||
w += bw;
|
w += bw;
|
||||||
|
h = std::max(bh, h);
|
||||||
if (bh > h) {
|
|
||||||
h = bh;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LWButtonSet::arrangeButtons (int x, int y, int w, int h)
|
void LWButtonSet::arrangeButtons (int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (x == ax && y == ay && w == aw && ((h == -1 && ah == 0) || h == ah )) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int mw, mh;
|
int mw, mh;
|
||||||
getMinimalDimensions (mw, mh);
|
getMinimalDimensions (mw, mh);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user