summaryrefslogtreecommitdiff
path: root/indra/llui/llui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llui.cpp')
-rw-r--r--indra/llui/llui.cpp43
1 files changed, 26 insertions, 17 deletions
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 58ba9e05f5..79ad99a770 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -41,6 +41,7 @@
#include "llgl.h"
// Project includes
+#include "llcommandmanager.h"
#include "llcontrol.h"
#include "llui.h"
#include "lluicolortable.h"
@@ -57,6 +58,7 @@
#include "llfiltereditor.h"
#include "llflyoutbutton.h"
#include "llsearcheditor.h"
+#include "lltoolbar.h"
// for XUIParse
#include "llquaternion.h"
@@ -87,13 +89,14 @@ std::list<std::string> gUntranslated;
/*static*/ LLUI::remove_popup_t LLUI::sRemovePopupFunc;
/*static*/ LLUI::clear_popups_t LLUI::sClearPopupsFunc;
-// register filtereditor here
+// register filter editor here
static LLDefaultChildRegistry::Register<LLFilterEditor> register_filter_editor("filter_editor");
static LLDefaultChildRegistry::Register<LLFlyoutButton> register_flyout_button("flyout_button");
static LLDefaultChildRegistry::Register<LLSearchEditor> register_search_editor("search_editor");
// register other widgets which otherwise may not be linked in
static LLDefaultChildRegistry::Register<LLLoadingIndicator> register_loading_indicator("loading_indicator");
+static LLDefaultChildRegistry::Register<LLToolBar> register_toolbar("toolbar");
//
// Functions
@@ -103,7 +106,7 @@ void make_ui_sound(const char* namep)
std::string name = ll_safe_string(namep);
if (!LLUI::sSettingGroups["config"]->controlExists(name))
{
- llwarns << "tried to make ui sound for unknown sound name: " << name << llendl;
+ llwarns << "tried to make UI sound for unknown sound name: " << name << llendl;
}
else
{
@@ -114,12 +117,12 @@ void make_ui_sound(const char* namep)
{
if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle"))
{
- llinfos << "ui sound name: " << name << " triggered but silent (null uuid)" << llendl;
+ llinfos << "UI sound name: " << name << " triggered but silent (null uuid)" << llendl;
}
}
else
{
- llwarns << "ui sound named: " << name << " does not translate to a valid uuid" << llendl;
+ llwarns << "UI sound named: " << name << " does not translate to a valid uuid" << llendl;
}
}
@@ -127,7 +130,7 @@ void make_ui_sound(const char* namep)
{
if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle"))
{
- llinfos << "ui sound name: " << name << llendl;
+ llinfos << "UI sound name: " << name << llendl;
}
LLUI::sAudioCallback(uuid);
}
@@ -471,7 +474,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
return;
}
- // add in offset of current image to current ui translation
+ // add in offset of current image to current UI translation
const LLVector3 ui_scale = gGL.getUIScale();
const LLVector3 ui_translation = (gGL.getUITranslation() + LLVector3(x, y, 0.f)).scaledVec(ui_scale);
@@ -1613,16 +1616,16 @@ void LLUI::initClass(const settings_map_t& settings,
LLUICtrl::CommitCallbackRegistry::Registrar& reg = LLUICtrl::CommitCallbackRegistry::defaultRegistrar();
- // Callbacks for associating controls with floater visibilty:
- reg.add("Floater.Toggle", boost::bind(&LLFloaterReg::toggleFloaterInstance, _2));
- reg.add("Floater.Show", boost::bind(&LLFloaterReg::showFloaterInstance, _2));
- reg.add("Floater.Hide", boost::bind(&LLFloaterReg::hideFloaterInstance, _2));
- reg.add("Floater.InitToVisibilityControl", boost::bind(&LLFloaterReg::initUICtrlToFloaterVisibilityControl, _1, _2));
+ // Callbacks for associating controls with floater visibility:
+ reg.add("Floater.Toggle", boost::bind(&LLFloaterReg::toggleInstance, _2, LLSD()));
+ reg.add("Floater.ToggleOrBringToFront", boost::bind(&LLFloaterReg::toggleInstanceOrBringToFront, _2, LLSD()));
+ reg.add("Floater.Show", boost::bind(&LLFloaterReg::showInstance, _2, LLSD(), FALSE));
+ reg.add("Floater.Hide", boost::bind(&LLFloaterReg::hideInstance, _2, LLSD()));
// Button initialization callback for toggle buttons
reg.add("Button.SetFloaterToggle", boost::bind(&LLButton::setFloaterToggle, _1, _2));
- // Button initialization callback for toggle buttons on dockale floaters
+ // Button initialization callback for toggle buttons on dockable floaters
reg.add("Button.SetDockableFloaterToggle", boost::bind(&LLButton::setDockableFloaterToggle, _1, _2));
// Display the help topic for the current context
@@ -1631,8 +1634,12 @@ void LLUI::initClass(const settings_map_t& settings,
// Currently unused, but kept for reference:
reg.add("Button.ToggleFloater", boost::bind(&LLButton::toggleFloaterAndSetToggleState, _1, _2));
- // Used by menus along with Floater.Toggle to display visibility as a checkmark
- LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::floaterInstanceVisible, _2));
+ // Used by menus along with Floater.Toggle to display visibility as a check-mark
+ LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD()));
+ LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD()));
+
+ // Parse the master list of commands
+ LLCommandManager::load();
}
void LLUI::cleanupClass()
@@ -2026,12 +2033,12 @@ void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y)
CURSOR_HEIGHT + MOUSE_CURSOR_PADDING * 2);
S32 local_x, local_y;
- // convert screen coordinates to tooltipview-local coordinates
+ // convert screen coordinates to tooltip view-local coordinates
parent->screenPointToLocal(spawn_x, spawn_y, &local_x, &local_y);
// Start at spawn position (using left/top)
view->setOrigin( local_x, local_y - view->getRect().getHeight());
- // Make sure we're onscreen and not overlapping the mouse
+ // Make sure we're on-screen and not overlapping the mouse
view->translateIntoRectWithExclusion( virtual_window_rect, mouse_rect, FALSE );
}
@@ -2100,7 +2107,7 @@ namespace LLInitParam
void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateValueFromBlock()
{
- if (control.isProvided())
+ if (control.isProvided() && !control().empty())
{
updateValue(LLUIColorTable::instance().getColor(control));
}
@@ -2257,9 +2264,11 @@ namespace LLInitParam
// in this case, that is left+width and bottom+height
LLRect& value = getValue();
+ right.set(value.mRight, false);
left.set(value.mLeft, make_block_authoritative);
width.set(value.getWidth(), make_block_authoritative);
+ top.set(value.mTop, false);
bottom.set(value.mBottom, make_block_authoritative);
height.set(value.getHeight(), make_block_authoritative);
}