mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 00:32:45 +03:00
chore(ui): add FLAG_RESIZE_PENDING define to CLayoutFrame
This commit is contained in:
parent
1457703d8c
commit
ae900a1b59
@ -8,6 +8,8 @@
|
|||||||
#include <common/XML.hpp>
|
#include <common/XML.hpp>
|
||||||
#include <storm/Error.hpp>
|
#include <storm/Error.hpp>
|
||||||
|
|
||||||
|
#define FLAG_RESIZE_PENDING 0x4
|
||||||
|
|
||||||
STORM_EXPLICIT_LIST(CLayoutFrame, resizeLink) LayoutFrame::s_resizePendingList;
|
STORM_EXPLICIT_LIST(CLayoutFrame, resizeLink) LayoutFrame::s_resizePendingList;
|
||||||
|
|
||||||
float SynthesizeSide(float center, float opposite, float size) {
|
float SynthesizeSide(float center, float opposite, float size) {
|
||||||
@ -44,7 +46,7 @@ void CLayoutFrame::ResizePending() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (frame->OnFrameResize() || (frame->m_resizeCounter--, frame->m_resizeCounter == 0)) {
|
if (frame->OnFrameResize() || (frame->m_resizeCounter--, frame->m_resizeCounter == 0)) {
|
||||||
frame->m_flags &= ~0x4;
|
frame->m_flags &= ~FLAG_RESIZE_PENDING;
|
||||||
LayoutFrame::s_resizePendingList.UnlinkNode(frame);
|
LayoutFrame::s_resizePendingList.UnlinkNode(frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -394,7 +396,7 @@ int32_t CLayoutFrame::IsResizeDependency(CLayoutFrame* dependentFrame) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t CLayoutFrame::IsResizePending() {
|
uint32_t CLayoutFrame::IsResizePending() {
|
||||||
return this->m_flags & 0x4;
|
return this->m_flags & FLAG_RESIZE_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CLayoutFrame::Left() {
|
float CLayoutFrame::Left() {
|
||||||
@ -549,7 +551,7 @@ int32_t CLayoutFrame::OnFrameResize() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->m_flags &= ~(0x4 | 0x8);
|
this->m_flags &= ~(FLAG_RESIZE_PENDING | 0x8);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this->m_flags & 0x1
|
this->m_flags & 0x1
|
||||||
@ -632,12 +634,12 @@ void CLayoutFrame::Resize(int32_t force) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->m_flags & 0x4 && (this->m_flags & 0x2 || LayoutFrame::s_resizePendingList.IsLinked(this))) {
|
if (this->m_flags & FLAG_RESIZE_PENDING && (this->m_flags & 0x2 || LayoutFrame::s_resizePendingList.IsLinked(this))) {
|
||||||
this->m_resizeCounter = 6;
|
this->m_resizeCounter = 6;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->m_flags |= 0x4;
|
this->m_flags |= FLAG_RESIZE_PENDING;
|
||||||
|
|
||||||
if (this->m_flags & 0x2) {
|
if (this->m_flags & 0x2) {
|
||||||
for (auto node = this->m_resizeList.Head(); node; node = this->m_resizeList.Link(node)->Next()) {
|
for (auto node = this->m_resizeList.Head(); node; node = this->m_resizeList.Link(node)->Next()) {
|
||||||
@ -736,7 +738,7 @@ void CLayoutFrame::SetDeferredResize(int32_t enable) {
|
|||||||
|
|
||||||
this->m_flags &= ~0x2;
|
this->m_flags &= ~0x2;
|
||||||
|
|
||||||
if (this->m_flags & 0x4) {
|
if (this->m_flags & FLAG_RESIZE_PENDING) {
|
||||||
this->Resize(1);
|
this->Resize(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user