Skip to content
Snippets Groups Projects
Commit c1751e36 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Add option to show seconds in status bar clock in status bar right click menu

parent d1f54f78
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -1445,6 +1445,17 @@ ...@@ -1445,6 +1445,17 @@
<key>Value</key> <key>Value</key>
<integer>1</integer> <integer>1</integer>
</map> </map>
<key>ShowStatusBarSeconds</key>
<map>
<key>Comment</key>
<string>Show seconds in the statusbar clock</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShowStreamInfo</key> <key>ShowStreamInfo</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
......
...@@ -174,7 +174,7 @@ BOOL LLStatusBar::postBuild() ...@@ -174,7 +174,7 @@ BOOL LLStatusBar::postBuild()
mPanelPopupHolder = gViewerWindow->getRootView()->getChildView("popup_holder"); mPanelPopupHolder = gViewerWindow->getRootView()->getChildView("popup_holder");
mTextTime = getChild<LLTextBox>("TimeText" ); mTextTime = getChild<LLTextBox>("TimeText");
mBtnBuyL = getChild<LLButton>("buyL"); mBtnBuyL = getChild<LLButton>("buyL");
mBtnBuyL->setCommitCallback(boost::bind(&LLStatusBar::onClickBuyCurrency, this)); mBtnBuyL->setCommitCallback(boost::bind(&LLStatusBar::onClickBuyCurrency, this));
...@@ -320,6 +320,7 @@ void LLStatusBar::refresh() ...@@ -320,6 +320,7 @@ void LLStatusBar::refresh()
{ {
static LLCachedControl<bool> show_net_stats(gSavedSettings, "ShowNetStats", false); static LLCachedControl<bool> show_net_stats(gSavedSettings, "ShowNetStats", false);
static LLCachedControl<bool> show_fps(gSavedSettings, "ShowStatusBarFPS", false); static LLCachedControl<bool> show_fps(gSavedSettings, "ShowStatusBarFPS", false);
static LLCachedControl<bool> show_clock_seconds(gSavedSettings, "ShowStatusBarSeconds", false);
bool net_stats_visible = show_net_stats; bool net_stats_visible = show_net_stats;
if (net_stats_visible) if (net_stats_visible)
...@@ -334,7 +335,7 @@ void LLStatusBar::refresh() ...@@ -334,7 +335,7 @@ void LLStatusBar::refresh()
} }
// update clock every 10 seconds // update clock every 10 seconds
if(mClockUpdateTimer.getElapsedTimeF32() > 10.f) if(mClockUpdateTimer.getElapsedTimeF32() > 10.f || (show_clock_seconds && mClockUpdateTimer.getElapsedTimeF32() > 1.f))
{ {
mClockUpdateTimer.reset(); mClockUpdateTimer.reset();
...@@ -344,7 +345,8 @@ void LLStatusBar::refresh() ...@@ -344,7 +345,8 @@ void LLStatusBar::refresh()
utc_time = time_corrected(); utc_time = time_corrected();
static const std::string timeStrTemplate = getString("time"); static const std::string timeStrTemplate = getString("time");
std::string timeStr = timeStrTemplate; static const std::string timeStrSecondsTemplate = getString("timeSeconds");
std::string timeStr = show_clock_seconds ? timeStrSecondsTemplate : timeStrTemplate;
LLSD substitution; LLSD substitution;
substitution["datetime"] = (S32) utc_time; substitution["datetime"] = (S32) utc_time;
LLStringUtil::format (timeStr, substitution); LLStringUtil::format (timeStr, substitution);
......
...@@ -53,4 +53,15 @@ ...@@ -53,4 +53,15 @@
function="CheckControl" function="CheckControl"
parameter="ShowNetStats" /> parameter="ShowNetStats" />
</menu_item_check> </menu_item_check>
<menu_item_check
label="Show seconds in clock"
layout="topleft"
name="ShowStatusBarSeconds">
<on_click
function="ToggleControl"
parameter="ShowStatusBarSeconds" />
<on_check
function="CheckControl"
parameter="ShowStatusBarSeconds" />
</menu_item_check>
</menu> </menu>
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
name="time"> name="time">
[hour12, datetime, slt]:[min, datetime, slt] [ampm, datetime, slt] [timezone,datetime, slt] [hour12, datetime, slt]:[min, datetime, slt] [ampm, datetime, slt] [timezone,datetime, slt]
</panel.string> </panel.string>
<panel.string
name="timeSeconds">
[hour12, datetime, slt]:[min, datetime, slt]:[second, datetime, slt] [ampm, datetime, slt] [timezone,datetime, slt]
</panel.string>
<panel.string <panel.string
name="timeTooltip"> name="timeTooltip">
[weekday, datetime, slt], [day, datetime, slt] [month, datetime, slt] [year, datetime, slt] [weekday, datetime, slt], [day, datetime, slt] [month, datetime, slt] [year, datetime, slt]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment