mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 19:45:08 +00:00
LibGUI: Put some logspam behind debugging macros.
This commit is contained in:
parent
6b2d2cc5e3
commit
7abef6ba9e
2 changed files with 12 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
#include <LibGUI/GBoxLayout.h>
|
#include <LibGUI/GBoxLayout.h>
|
||||||
#include <LibGUI/GWidget.h>
|
#include <LibGUI/GWidget.h>
|
||||||
|
|
||||||
|
//#define GBOXLAYOUT_DEBUG
|
||||||
|
|
||||||
GBoxLayout::GBoxLayout(Orientation orientation)
|
GBoxLayout::GBoxLayout(Orientation orientation)
|
||||||
: m_orientation(orientation)
|
: m_orientation(orientation)
|
||||||
{
|
{
|
||||||
|
@ -44,7 +46,9 @@ void GBoxLayout::run(GWidget& widget)
|
||||||
|
|
||||||
int number_of_entries_with_automatic_size = m_entries.size() - number_of_entries_with_fixed_size;
|
int number_of_entries_with_automatic_size = m_entries.size() - number_of_entries_with_fixed_size;
|
||||||
|
|
||||||
|
#ifdef GBOXLAYOUT_DEBUG
|
||||||
dbgprintf("GBoxLayout: available_size=%d, fixed=%d, fill=%d\n", available_size.height(), number_of_entries_with_fixed_size, number_of_entries_with_automatic_size);
|
dbgprintf("GBoxLayout: available_size=%d, fixed=%d, fill=%d\n", available_size.height(), number_of_entries_with_fixed_size, number_of_entries_with_automatic_size);
|
||||||
|
#endif
|
||||||
|
|
||||||
Size automatic_size;
|
Size automatic_size;
|
||||||
|
|
||||||
|
@ -56,7 +60,9 @@ void GBoxLayout::run(GWidget& widget)
|
||||||
automatic_size.set_height(available_size.height() / number_of_entries_with_automatic_size);
|
automatic_size.set_height(available_size.height() / number_of_entries_with_automatic_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GBOXLAYOUT_DEBUG
|
||||||
dbgprintf("GBoxLayout: automatic_size=%s\n", automatic_size.to_string().characters());
|
dbgprintf("GBoxLayout: automatic_size=%s\n", automatic_size.to_string().characters());
|
||||||
|
#endif
|
||||||
|
|
||||||
int current_x = 0;
|
int current_x = 0;
|
||||||
int current_y = 0;
|
int current_y = 0;
|
||||||
|
@ -78,7 +84,9 @@ void GBoxLayout::run(GWidget& widget)
|
||||||
rect.set_size(automatic_size);
|
rect.set_size(automatic_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GBOXLAYOUT_DEBUG
|
||||||
dbgprintf("GBoxLayout: apply, %s{%p} <- %s\n", entry.widget->class_name(), entry.widget.ptr(), rect.to_string().characters());
|
dbgprintf("GBoxLayout: apply, %s{%p} <- %s\n", entry.widget->class_name(), entry.widget.ptr(), rect.to_string().characters());
|
||||||
|
#endif
|
||||||
entry.widget->set_relative_rect(rect);
|
entry.widget->set_relative_rect(rect);
|
||||||
|
|
||||||
if (orientation() == Orientation::Horizontal)
|
if (orientation() == Orientation::Horizontal)
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#include <LibC/unistd.h>
|
#include <LibC/unistd.h>
|
||||||
#include <AK/HashMap.h>
|
#include <AK/HashMap.h>
|
||||||
|
|
||||||
|
//#define UPDATE_COALESCING_DEBUG
|
||||||
|
|
||||||
static HashMap<int, GWindow*>* s_windows;
|
static HashMap<int, GWindow*>* s_windows;
|
||||||
|
|
||||||
static HashMap<int, GWindow*>& windows()
|
static HashMap<int, GWindow*>& windows()
|
||||||
|
@ -199,7 +201,9 @@ void GWindow::update(const Rect& a_rect)
|
||||||
return;
|
return;
|
||||||
for (auto& pending_rect : m_pending_paint_event_rects) {
|
for (auto& pending_rect : m_pending_paint_event_rects) {
|
||||||
if (pending_rect.contains(a_rect)) {
|
if (pending_rect.contains(a_rect)) {
|
||||||
|
#ifdef UPDATE_COALESCING_DEBUG
|
||||||
dbgprintf("Ignoring %s since it's contained by pending rect %s\n", a_rect.to_string().characters(), pending_rect.to_string().characters());
|
dbgprintf("Ignoring %s since it's contained by pending rect %s\n", a_rect.to_string().characters(), pending_rect.to_string().characters());
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue