summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-09-08 08:05:51 +0300
committerAndrei Karas <akaras@inbox.ru>2018-09-08 08:05:51 +0300
commit5d83c6b9c4fca96b6b0de312080346837b385f5f (patch)
tree759d0b21d62edf9949b8c7f5f0e01a28a50a8311
parent32b9e2070b3cf44b6b38ab0c0383b85e87852d50 (diff)
downloadmanaplus-5d83c6b9c4fca96b6b0de312080346837b385f5f.tar.gz
manaplus-5d83c6b9c4fca96b6b0de312080346837b385f5f.tar.bz2
manaplus-5d83c6b9c4fca96b6b0de312080346837b385f5f.tar.xz
manaplus-5d83c6b9c4fca96b6b0de312080346837b385f5f.zip
Improve perf counters display.
-rw-r--r--src/gui/widgets/tabs/statdebugtab.cpp24
-rw-r--r--src/gui/widgets/tabs/statdebugtab.h1
2 files changed, 18 insertions, 7 deletions
diff --git a/src/gui/widgets/tabs/statdebugtab.cpp b/src/gui/widgets/tabs/statdebugtab.cpp
index 6d4f8afa4..1ad858800 100644
--- a/src/gui/widgets/tabs/statdebugtab.cpp
+++ b/src/gui/widgets/tabs/statdebugtab.cpp
@@ -45,11 +45,15 @@ StatDebugTab::StatDebugTab(const Widget2 *const widget) :
// TRANSLATORS: debug window stats copy button
mCopyButton(new Button(this, _("Copy"), "copy", BUTTON_SKIN, this)),
mStatLabels(),
+ mWorseStatLabels(),
mDrawIndex(0)
{
LayoutHelper h(this);
ContainerPlacer place = h.getPlacer(0, 0);
+ mResetButton->adjustSize();
+ mCopyButton->adjustSize();
+
place(0, 0, mLPSLabel, 2, 1);
place(0, 1, mResetButton, 1, 1);
place(1, 1, mCopyButton, 1, 1);
@@ -57,13 +61,16 @@ StatDebugTab::StatDebugTab(const Widget2 *const widget) :
{
mStatLabels[f - 1] = new Label(this,
// TRANSLATORS: debug window stat label
- strprintf(_("stat%d: %d (%d) ms"), f, 0, 0));
- place(0, f + 1, mStatLabels[f - 1], 2, 1);
+ strprintf(_("stat%d: %d ms"), f, 1000));
+ mStatLabels[f - 1]->adjustSize();
+ mWorseStatLabels[f - 1] = new Label(this,
+ // TRANSLATORS: debug window stat label
+ strprintf(_("%d ms"), 1000));
+ place(0, f + 1, mStatLabels[f - 1], 3, 1);
+ place(3, f + 1, mWorseStatLabels[f - 1], 1, 1);
}
- place.getCell().matchColWidth(0, 0);
- place = h.getPlacer(0, 1);
- setDimension(Rect(0, 0, 600, 300));
+ setDimension(Rect(0, 0, 200, 300));
}
void StatDebugTab::logic()
@@ -76,9 +83,12 @@ void StatDebugTab::logic()
{
mStatLabels[f - 1]->setCaption(
// TRANSLATORS: debug window stat label
- strprintf(_("stat%d: %d (%d) ms"),
+ strprintf(_("stat%d: %d ms"),
f,
- Perf::getTime(prevPerfFrameId, f) * MILLISECONDS_IN_A_TICK,
+ Perf::getTime(prevPerfFrameId, f) * MILLISECONDS_IN_A_TICK));
+ mWorseStatLabels[f - 1]->setCaption(
+ // TRANSLATORS: debug window stat label
+ strprintf(_("%d ms"),
Perf::getWorstTime(f) * MILLISECONDS_IN_A_TICK));
}
mDrawIndex = prevPerfFrameId;
diff --git a/src/gui/widgets/tabs/statdebugtab.h b/src/gui/widgets/tabs/statdebugtab.h
index 57b2e9f4a..628629bac 100644
--- a/src/gui/widgets/tabs/statdebugtab.h
+++ b/src/gui/widgets/tabs/statdebugtab.h
@@ -49,6 +49,7 @@ class StatDebugTab final : public DebugTab,
Button *mResetButton A_NONNULLPOINTER;
Button *mCopyButton A_NONNULLPOINTER;
Label *mStatLabels[PERFSTAT_LAST_STAT - 1] A_NONNULLPOINTER;
+ Label *mWorseStatLabels[PERFSTAT_LAST_STAT - 1] A_NONNULLPOINTER;
size_t mDrawIndex;
};