summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatereditextdaycycle.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-01-08 18:38:16 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-01-08 18:38:16 +0200
commit89abadaf2f8a4ea76bfe6433d6f3426ca41963dc (patch)
treef4ece404ef88f4a02532e02c6a82dc35dd1ec9d5 /indra/newview/llfloatereditextdaycycle.cpp
parent1871f03d12e7a8e388d188f87e612117bcda75c1 (diff)
SL-10280 Added label repositioning code to display percentage in correct places.
Diffstat (limited to 'indra/newview/llfloatereditextdaycycle.cpp')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index cb6fd611ec..b27efb56fd 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -354,6 +354,17 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key)
mCurrentTimeLabel->setTextArg("[DSC]", std::string());
}
+ // Adjust Time&Percentage labels' location according to length
+ LLRect label_rect = getChild<LLTextBox>("p0", true)->getRect();
+ F32 slider_width = mFramesSlider->getRect().getWidth();
+ for (int i = 1; i < max_elm; i++)
+ {
+ LLTextBox *pcnt_label = getChild<LLTextBox>("p" + llformat("%d", i), true);
+ LLRect new_rect = pcnt_label->getRect();
+ new_rect.mLeft = label_rect.mLeft + (S32)(slider_width * (F32)i / (F32)(max_elm - 1)) - (S32)(pcnt_label->getTextPixelWidth() / 2);
+ pcnt_label->setRect(new_rect);
+ }
+
// Altitudes&Track labels
LLUIString formatted_label = getString("sky_track_label");
const LLEnvironment::altitude_list_t &altitudes = LLEnvironment::instance().getRegionAltitudes();