EXP-1202 : pull from richard/viewer-experience-fui

master
Merov Linden 2011-10-05 11:49:12 -07:00
commit fb7af4d001
25 changed files with 324 additions and 229 deletions

View File

@ -48,24 +48,36 @@ const LLCommandId LLCommandId::null("null command");
//
LLCommand::Params::Params()
: function("function")
, available_in_toybox("available_in_toybox", false)
: available_in_toybox("available_in_toybox", false)
, icon("icon")
, label_ref("label_ref")
, name("name")
, parameter("parameter")
, tooltip_ref("tooltip_ref")
, execute_function("execute_function")
, execute_parameters("execute_parameters")
, is_enabled_function("is_enabled_function")
, is_enabled_parameters("is_enabled_parameters")
, is_running_function("is_running_function")
, is_running_parameters("is_running_parameters")
, is_starting_function("is_starting_function")
, is_starting_parameters("is_starting_parameters")
{
}
LLCommand::LLCommand(const LLCommand::Params& p)
: mFunction(p.function)
, mAvailableInToybox(p.available_in_toybox)
: mAvailableInToybox(p.available_in_toybox)
, mIcon(p.icon)
, mIdentifier(p.name)
, mLabelRef(p.label_ref)
, mParameter(p.parameter)
, mTooltipRef(p.tooltip_ref)
, mExecuteFunction(p.execute_function)
, mExecuteParameters(p.execute_parameters)
, mIsEnabledFunction(p.is_enabled_function)
, mIsEnabledParameters(p.is_enabled_parameters)
, mIsRunningFunction(p.is_running_function)
, mIsRunningParameters(p.is_running_parameters)
, mIsStartingFunction(p.is_starting_function)
, mIsStartingParameters(p.is_starting_parameters)
{
}

View File

@ -89,41 +89,72 @@ private:
typedef std::list<LLCommandId> command_id_list_t;
class LLCommand
{
public:
struct Params : public LLInitParam::Block<Params>
{
Mandatory<bool> available_in_toybox;
Mandatory<std::string> function;
Mandatory<std::string> icon;
Mandatory<std::string> label_ref;
Mandatory<std::string> name;
Optional<LLSD> parameter;
Mandatory<std::string> tooltip_ref;
Mandatory<std::string> execute_function;
Optional<LLSD> execute_parameters;
Optional<std::string> is_enabled_function;
Optional<LLSD> is_enabled_parameters;
Optional<std::string> is_running_function;
Optional<LLSD> is_running_parameters;
Optional<std::string> is_starting_function;
Optional<LLSD> is_starting_parameters;
Params();
};
LLCommand(const LLCommand::Params& p);
const bool availableInToybox() const { return mAvailableInToybox; }
const std::string& functionName() const { return mFunction; }
const std::string& icon() const { return mIcon; }
const LLCommandId& id() const { return mIdentifier; }
const std::string& labelRef() const { return mLabelRef; }
const LLSD& parameter() const { return mParameter; }
const std::string& tooltipRef() const { return mTooltipRef; }
const std::string& executeFunctionName() const { return mExecuteFunction; }
const LLSD& executeParameters() const { return mExecuteParameters; }
const std::string& isEnabledFunctionName() const { return mIsEnabledFunction; }
const LLSD& isEnabledParameters() const { return mIsEnabledParameters; }
const std::string& isRunningFunctionName() const { return mIsRunningFunction; }
const LLSD& isRunningParameters() const { return mIsRunningParameters; }
const std::string& isStartingFunctionName() const { return mIsStartingFunction; }
const LLSD& isStartingParameters() const { return mIsStartingParameters; }
private:
LLCommandId mIdentifier;
bool mAvailableInToybox;
std::string mFunction;
std::string mIcon;
std::string mLabelRef;
LLSD mParameter;
std::string mTooltipRef;
std::string mExecuteFunction;
LLSD mExecuteParameters;
std::string mIsEnabledFunction;
LLSD mIsEnabledParameters;
std::string mIsRunningFunction;
LLSD mIsRunningParameters;
std::string mIsStartingFunction;
LLSD mIsStartingParameters;
};

View File

@ -368,7 +368,7 @@ void LLToolBar::resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row
{
if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL)
{
button->reshape(llclamp(button->getRect().getWidth(), button->mMinWidth, button->mMaxWidth), max_row_girth);
button->reshape(button->mWidthRange.clamp(button->getRect().getWidth()), max_row_girth);
}
else // VERTICAL
{
@ -454,10 +454,10 @@ void LLToolBar::updateLayoutAsNeeded()
BOOST_FOREACH(LLToolBarButton* button, mButtons)
{
button->reshape(button->mMinWidth, button->mDesiredHeight);
button->reshape(button->mWidthRange.getMin(), button->mDesiredHeight);
button->autoResize();
S32 button_clamped_width = llclamp(button->getRect().getWidth(), button->mMinWidth, button->mMaxWidth);
S32 button_clamped_width = button->mWidthRange.clamp(button->getRect().getWidth());
S32 button_length = (orientation == LLLayoutStack::HORIZONTAL)
? button_clamped_width
: button->getRect().getHeight();
@ -472,7 +472,7 @@ void LLToolBar::updateLayoutAsNeeded()
{
if (orientation == LLLayoutStack::VERTICAL)
{ // row girth (width in this case) is clamped to allowable button widths
max_row_girth = llclamp(max_row_girth, button->mMinWidth, button->mMaxWidth);
max_row_girth = button->mWidthRange.clamp(max_row_girth);
}
// make buttons in current row all same girth
@ -601,8 +601,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
if (!mReadOnly)
{
LLUICtrl::CommitCallbackParam cbParam;
cbParam.function_name = commandp->functionName();
cbParam.parameter = commandp->parameter();
cbParam.function_name = commandp->executeFunctionName();
cbParam.parameter = commandp->executeParameters();
button->setCommitCallback(cbParam);
button->setStartDragCallback(mStartDragItemCallback);
button->setHandleDragCallback(mHandleDragItemCallback);
@ -642,8 +642,7 @@ LLToolBarButton::LLToolBarButton(const Params& p)
: LLButton(p),
mMouseDownX(0),
mMouseDownY(0),
mMinWidth(p.min_button_width),
mMaxWidth(p.max_button_width),
mWidthRange(p.button_width),
mDesiredHeight(p.desired_height),
mId("")
{
@ -656,7 +655,7 @@ BOOL LLToolBarButton::handleMouseDown(S32 x, S32 y, MASK mask)
return LLButton::handleMouseDown(x, y, mask);
}
BOOL LLToolBarButton::handleHover( S32 x, S32 y, MASK mask )
BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask)
{
// llinfos << "Merov debug: handleHover, x = " << x << ", y = " << y << ", mouse = " << hasMouseCapture() << llendl;
BOOL handled = FALSE;

View File

@ -47,13 +47,11 @@ class LLToolBarButton : public LLButton
public:
struct Params : public LLInitParam::Block<Params, LLButton::Params>
{
Optional<S32> min_button_width,
max_button_width,
desired_height;
Optional<LLUI::RangeS32> button_width;
Optional<S32> desired_height;
Params()
: min_button_width("min_button_width", 0),
max_button_width("max_button_width", S32_MAX),
: button_width("button_width"),
desired_height("desired_height", 20)
{}
@ -71,8 +69,7 @@ private:
LLCommandId mId;
S32 mMouseDownX;
S32 mMouseDownY;
S32 mMinWidth;
S32 mMaxWidth;
LLUI::RangeS32 mWidthRange;
S32 mDesiredHeight;
bool mIsDragged;
tool_startdrag_callback_t mStartDragItemCallback;

View File

@ -41,6 +41,7 @@
#include <boost/signals2.hpp>
#include "lllazyvalue.h"
#include "llframetimer.h"
#include <limits>
// LLUIFactory
#include "llsd.h"
@ -147,6 +148,122 @@ class LLUI
{
LOG_CLASS(LLUI);
public:
//
// Classes
//
struct RangeS32
{
struct Params : public LLInitParam::Block<Params>
{
Optional<S32> minimum,
maximum;
Params()
: minimum("min", 0),
maximum("max", S32_MAX)
{}
};
// correct for inverted params
RangeS32(const Params& p = Params())
: mMin(p.minimum),
mMax(p.maximum)
{
sanitizeRange();
}
RangeS32(S32 minimum, S32 maximum)
: mMin(minimum),
mMax(maximum)
{
sanitizeRange();
}
S32 clamp(S32 input)
{
if (input < mMin) return mMin;
if (input > mMax) return mMax;
return input;
}
void setRange(S32 minimum, S32 maximum)
{
mMin = minimum;
mMax = maximum;
sanitizeRange();
}
S32 getMin() { return mMin; }
S32 getMax() { return mMax; }
bool operator==(const RangeS32& other) const
{
return mMin == other.mMin
&& mMax == other.mMax;
}
private:
void sanitizeRange()
{
if (mMin > mMax)
{
llwarns << "Bad interval range (" << mMin << ", " << mMax << ")" << llendl;
// since max is usually the most dangerous one to ignore (buffer overflow, etc), prefer it
// in the case of a malformed range
mMin = mMax;
}
}
S32 mMin,
mMax;
};
struct ClampedS32 : public RangeS32
{
struct Params : public LLInitParam::Block<Params, RangeS32::Params>
{
Mandatory<S32> value;
Params()
: value("", 0)
{
addSynonym(value, "value");
}
};
ClampedS32(const Params& p)
: RangeS32(p)
{}
ClampedS32(const RangeS32& range)
: RangeS32(range)
{
// set value here, after range has been sanitized
mValue = clamp(0);
}
ClampedS32(S32 value, const RangeS32& range = RangeS32())
: RangeS32(range)
{
mValue = clamp(value);
}
S32 get()
{
return mValue;
}
void set(S32 value)
{
mValue = clamp(value);
}
private:
S32 mValue;
};
//
// Methods
//

View File

@ -87,6 +87,7 @@ namespace LLInitParam
void setValueName(const std::string& key) {}
std::string getValueName() const { return ""; }
std::string calcValueName(const T& value) const { return ""; }
void clearValueName() const {}
static bool getValueFromName(const std::string& name, T& value)
@ -124,6 +125,22 @@ namespace LLInitParam
return mValueName;
}
std::string calcValueName(const T& value) const
{
value_name_map_t* map = getValueNames();
for (typename value_name_map_t::iterator it = map->begin(), end_it = map->end();
it != end_it;
++it)
{
if (ParamCompare<T>::equals(it->second, value))
{
return it->first;
}
}
return "";
}
void clearValueName() const
{
mValueName.clear();
@ -709,10 +726,7 @@ namespace LLInitParam
{
if (!diff_param || !ParamCompare<std::string>::equals(static_cast<const self_t*>(diff_param)->getValueName(), key))
{
if (!parser.writeValue(key, name_stack))
{
return;
}
parser.writeValue(key, name_stack);
}
}
// then try to serialize value directly
@ -720,7 +734,11 @@ namespace LLInitParam
{
if (!parser.writeValue(typed_param.getValue(), name_stack))
{
return;
std::string calculated_key = typed_param.calcValueName(typed_param.getValue());
if (!diff_param || !ParamCompare<std::string>::equals(static_cast<const self_t*>(diff_param)->getValueName(), calculated_key))
{
parser.writeValue(calculated_key, name_stack);
}
}
}
}
@ -1002,9 +1020,14 @@ namespace LLInitParam
if(key.empty())
// not parsed via name values, write out value directly
{
if (!parser.writeValue(*it, name_stack))
bool value_written = parser.writeValue(*it, name_stack);
if (!value_written)
{
break;
std::string calculated_key = typed_param.calcValueName(typed_param.getValue());
if (!parser.writeValue(calculated_key, name_stack))
{
break;
}
}
}
else

View File

@ -5,183 +5,183 @@
icon="Command_AboutLand_Icon"
label_ref="Command_AboutLand_Label"
tooltip_ref="Command_AboutLand_Tooltip"
function="Floater.ToolbarToggle"
parameter="about_land"
execute_function="Floater.ToolbarToggle"
execute_parameters="about_land"
/>
<command name="appearance"
available_in_toybox="true"
icon="Command_Appearance_Icon"
label_ref="Command_Appearance_Label"
tooltip_ref="Command_Appearance_Tooltip"
function="Floater.ToolbarToggle"
parameter="appearance"
execute_function="Floater.ToolbarToggle"
execute_parameters="appearance"
/>
<command name="avatar"
available_in_toybox="true"
icon="Command_Avatar_Icon"
label_ref="Command_Avatar_Label"
tooltip_ref="Command_Avatar_Tooltip"
function="Floater.ToolbarToggle"
parameter="avatar_picker"
execute_function="Floater.ToolbarToggle"
execute_parameters="avatar_picker"
/>
<command name="build"
available_in_toybox="true"
icon="Command_Build_Icon"
label_ref="Command_Build_Label"
tooltip_ref="Command_Build_Tooltip"
function="Floater.ToolbarToggle"
parameter="build"
execute_function="Floater.ToolbarToggle"
execute_parameters="build"
/>
<command name="chat"
available_in_toybox="true"
icon="Command_Chat_Icon"
label_ref="Command_Chat_Label"
tooltip_ref="Command_Chat_Tooltip"
function="Floater.ToolbarToggle"
parameter="chat_bar"
execute_function="Floater.ToolbarToggle"
execute_parameters="chat_bar"
/>
<command name="compass"
available_in_toybox="false"
icon="Command_Compass_Icon"
label_ref="Command_Compass_Label"
tooltip_ref="Command_Compass_Tooltip"
function="Floater.ToolbarToggle"
parameter="compass"
execute_function="Floater.ToolbarToggle"
execute_parameters="compass"
/>
<command name="destinations"
available_in_toybox="true"
icon="Command_Destinations_Icon"
label_ref="Command_Destinations_Label"
tooltip_ref="Command_Destinations_Tooltip"
function="Floater.ToolbarToggle"
parameter="destinations"
execute_function="Floater.ToolbarToggle"
execute_parameters="destinations"
/>
<command name="gestures"
available_in_toybox="true"
icon="Command_Gestures_Icon"
label_ref="Command_Gestures_Label"
tooltip_ref="Command_Gestures_Tooltip"
function="Floater.ToolbarToggle"
parameter="gestures"
execute_function="Floater.ToolbarToggle"
execute_parameters="gestures"
/>
<command name="howto"
available_in_toybox="true"
icon="Command_HowTo_Icon"
label_ref="Command_HowTo_Label"
tooltip_ref="Command_HowTo_Tooltip"
function="Floater.ToolbarToggle"
parameter="help_browser"
execute_function="Floater.ToolbarToggle"
execute_parameters="help_browser"
/>
<command name="inventory"
available_in_toybox="true"
icon="Command_Inventory_Icon"
label_ref="Command_Inventory_Label"
tooltip_ref="Command_Inventory_Tooltip"
function="Floater.ToolbarToggle"
parameter="inventory"
execute_function="Floater.ToolbarToggle"
execute_parameters="inventory"
/>
<command name="map"
available_in_toybox="true"
icon="Command_Map_Icon"
label_ref="Command_Map_Label"
tooltip_ref="Command_Map_Tooltip"
function="Floater.ToolbarToggle"
parameter="world_map"
execute_function="Floater.ToolbarToggle"
execute_parameters="world_map"
/>
<command name="marketplace"
available_in_toybox="true"
icon="Command_Marketplace_Icon"
label_ref="Command_Marketplace_Label"
tooltip_ref="Command_Marketplace_Tooltip"
function="Floater.ToolbarToggle"
parameter="marketplace"
execute_function="Floater.ToolbarToggle"
execute_parameters="marketplace"
/>
<command name="minimap"
available_in_toybox="true"
icon="Command_MiniMap_Icon"
label_ref="Command_MiniMap_Label"
tooltip_ref="Command_MiniMap_Tooltip"
function="Floater.ToolbarToggle"
parameter="mini_map"
execute_function="Floater.ToolbarToggle"
execute_parameters="mini_map"
/>
<command name="move"
available_in_toybox="true"
icon="Command_Move_Icon"
label_ref="Command_Move_Label"
tooltip_ref="Command_Move_Tooltip"
function="Floater.ToolbarToggle"
parameter="moveview"
execute_function="Floater.ToolbarToggle"
execute_parameters="moveview"
/>
<command name="people"
available_in_toybox="true"
icon="Command_People_Icon"
label_ref="Command_People_Label"
tooltip_ref="Command_People_Tooltip"
function="Floater.ToolbarToggle"
parameter="people"
execute_function="Floater.ToolbarToggle"
execute_parameters="people"
/>
<command name="places"
available_in_toybox="true"
icon="Command_Places_Icon"
label_ref="Command_Places_Label"
tooltip_ref="Command_Places_Tooltip"
function="Floater.ToolbarToggle"
parameter="places"
execute_function="Floater.ToolbarToggle"
execute_parameters="places"
/>
<command name="preferences"
available_in_toybox="true"
icon="Command_Preferences_Icon"
label_ref="Command_Preferences_Label"
tooltip_ref="Command_Preferences_Tooltip"
function="Floater.ToolbarToggle"
parameter="preferences"
execute_function="Floater.ToolbarToggle"
execute_parameters="preferences"
/>
<command name="profile"
available_in_toybox="true"
icon="Command_Profile_Icon"
label_ref="Command_Profile_Label"
tooltip_ref="Command_Profile_Tooltip"
function="Floater.ToolbarToggle"
parameter="my_profile"
execute_function="Floater.ToolbarToggle"
execute_parameters="my_profile"
/>
<command name="search"
available_in_toybox="true"
icon="Command_Search_Icon"
label_ref="Command_Search_Label"
tooltip_ref="Command_Search_Tooltip"
function="Floater.ToolbarToggle"
parameter="search"
execute_function="Floater.ToolbarToggle"
execute_parameters="search"
/>
<command name="snapshot"
available_in_toybox="true"
icon="Command_Snapshot_Icon"
label_ref="Command_Snapshot_Label"
tooltip_ref="Command_Snapshot_Tooltip"
function="Floater.ToolbarToggle"
parameter="snapshot"
execute_function="Floater.ToolbarToggle"
execute_parameters="snapshot"
/>
<command name="speak"
available_in_toybox="true"
icon="Command_Speak_Icon"
label_ref="Command_Speak_Label"
tooltip_ref="Command_Speak_Tooltip"
function="Floater.ToolbarToggle"
parameter="speak"
execute_function="Floater.ToolbarToggle"
execute_parameters="speak"
/>
<command name="view"
available_in_toybox="true"
icon="Command_View_Icon"
label_ref="Command_View_Label"
tooltip_ref="Command_View_Tooltip"
function="Floater.ToolbarToggle"
parameter="camera"
execute_function="Floater.ToolbarToggle"
execute_parameters="camera"
/>
<command name="voice"
available_in_toybox="true"
icon="Command_Voice_Icon"
label_ref="Command_Voice_Label"
tooltip_ref="Command_Voice_Tooltip"
function="Floater.ToolbarToggle"
parameter="voice_controls"
execute_function="Floater.ToolbarToggle"
execute_parameters="voice_controls"
/>
</commands>

View File

@ -9671,7 +9671,7 @@
<key>ShowBuildButton</key>
<map>
<key>Comment</key>
<string>Shows/Hides Build button in the bottom tray.</string>
<string>Shows/hides build button in the bottom tray.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9682,7 +9682,7 @@
<key>ShowCameraButton</key>
<map>
<key>Comment</key>
<string>Show/Hide View button in the bottom tray.</string>
<string>Show/hide view button in the bottom tray.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9770,7 +9770,7 @@
<key>ShowGestureButton</key>
<map>
<key>Comment</key>
<string>Shows/Hides Gesture button in the bottom tray.</string>
<string>Shows/hides gesture button in the bottom tray.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9803,7 +9803,7 @@
<key>ShowMiniMapButton</key>
<map>
<key>Comment</key>
<string>Shows/Hides Mini-Map button in the bottom tray.</string>
<string>Shows/hides mini-map button in the bottom tray.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9814,7 +9814,7 @@
<key>ShowMoveButton</key>
<map>
<key>Comment</key>
<string>Shows/Hides Move button in the bottom tray.</string>
<string>Shows/hides move button in the bottom tray.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9847,7 +9847,7 @@
<key>ShowSearchButton</key>
<map>
<key>Comment</key>
<string>Shows/Hides Search button in the bottom tray.</string>
<string>Shows/hides search button in the bottom tray.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9858,7 +9858,7 @@
<key>ShowSnapshotButton</key>
<map>
<key>Comment</key>
<string>Shows/Hides Snapshot button button in the bottom tray.</string>
<string>Shows/hides snapshot button button in the bottom tray.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9880,7 +9880,7 @@
<key>ShowNavbarFavoritesPanel</key>
<map>
<key>Comment</key>
<string>Show/Hide Navigation Bar Favorites Panel</string>
<string>Show/hide navigation bar favorites panel</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9891,7 +9891,7 @@
<key>ShowNavbarNavigationPanel</key>
<map>
<key>Comment</key>
<string>Show/Hide Navigation Bar Navigation Panel</string>
<string>Show/hide navigation bar navigation panel</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9902,7 +9902,7 @@
<key>ShowWorldMapButton</key>
<map>
<key>Comment</key>
<string>Shows/Hides Map button in the bottom tray.</string>
<string>Shows/hides map button in the bottom tray.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -9913,7 +9913,7 @@
<key>ShowMiniLocationPanel</key>
<map>
<key>Comment</key>
<string>Show/Hide Mini-Location Panel</string>
<string>Show/hide mini-location panel</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<toolbars>
<bottom_toolbar
button_display_mode="0">
button_display_mode="icons_with_text">
<command name="chat"/>
<command name="speak"/>
<command name="places"/>
<command name="destinations"/>
<command name="people"/>
<command name="profile"/>
<command name="view"/>
@ -12,14 +12,14 @@
<command name="howto"/>
</bottom_toolbar>
<left_toolbar
button_display_mode="1">
button_display_mode="icons_only">
<command name="avatar"/>
<command name="appearance"/>
<command name="inventory"/>
<command name="snapshot"/>
<command name="search"/>
<command name="shop"/>
<command name="move_objects"/>
<command name="places"/>
<command name="marketplace"/>
<command name="voice"/>
<command name="minimap"/>
<command name="preferences"/>
</left_toolbar>
</toolbars>

View File

@ -100,16 +100,13 @@ BOOL LLFloaterMap::postBuild()
mTextBoxSouthWest = getChild<LLTextBox> ("floater_map_southwest");
mTextBoxNorthWest = getChild<LLTextBox> ("floater_map_northwest");
stretchMiniMap(getRect().getWidth() - MAP_PADDING_LEFT - MAP_PADDING_RIGHT
,getRect().getHeight() - MAP_PADDING_TOP - MAP_PADDING_BOTTOM);
updateMinorDirections();
// Get the drag handle all the way in back
sendChildToBack(getDragHandle());
setIsChrome(TRUE);
getDragHandle()->setTitleVisible(TRUE);
//setIsChrome(TRUE);
//getDragHandle()->setTitleVisible(TRUE);
// keep onscreen
gFloaterView->adjustToFitScreen(this, FALSE);
@ -223,40 +220,10 @@ void LLFloaterMap::draw()
LLFloater::draw();
}
// virtual
void LLFloaterMap::onFocusReceived()
{
setBackgroundOpaque(true);
LLPanel::onFocusReceived();
}
// virtual
void LLFloaterMap::onFocusLost()
{
setBackgroundOpaque(false);
LLPanel::onFocusLost();
}
void LLFloaterMap::stretchMiniMap(S32 width,S32 height)
{
//fix for ext-7112
//by default ctrl can't overlap caption area
if(mMap)
{
LLRect map_rect;
map_rect.setLeftTopAndSize( MAP_PADDING_LEFT, getRect().getHeight() - MAP_PADDING_TOP, width, height);
mMap->reshape( width, height, 1);
mMap->setRect(map_rect);
}
}
void LLFloaterMap::reshape(S32 width, S32 height, BOOL called_from_parent)
{
LLFloater::reshape(width, height, called_from_parent);
stretchMiniMap(width - MAP_PADDING_LEFT - MAP_PADDING_RIGHT
,height - MAP_PADDING_TOP - MAP_PADDING_BOTTOM);
updateMinorDirections();
}
@ -285,16 +252,3 @@ void LLFloaterMap::handleZoom(const LLSD& userdata)
mMap->setScale(scale);
}
}
void LLFloaterMap::setMinimized(BOOL b)
{
LLFloater::setMinimized(b);
if(b)
{
setTitle(getString("mini_map_caption"));
}
else
{
setTitle("");
}
}

View File

@ -45,18 +45,12 @@ public:
/*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
/*virtual*/ void draw();
/*virtual*/ void onFocusLost();
/*virtual*/ void onFocusReceived();
/*virtual*/ void setMinimized(BOOL b);
private:
void handleZoom(const LLSD& userdata);
void setDirectionPos( LLTextBox* text_box, F32 rotation );
void updateMinorDirections();
void stretchMiniMap(S32 width,S32 height);
LLTextBox* mTextBoxEast;
LLTextBox* mTextBoxNorth;
LLTextBox* mTextBoxWest;

View File

@ -61,8 +61,6 @@ BOOL LLFloaterToybox::postBuild()
center();
mBtnRestoreDefaults = getChild<LLButton>("btn_restore_defaults");
mBtnRestoreDefaults->setCommitCallback(boost::bind(&LLToolBarView::loadDefaultToolbars));
mToolBar = getChild<LLToolBar>("toybox_toolbar");
LLCommandManager& cmdMgr = LLCommandManager::instance();
@ -97,46 +95,26 @@ BOOL LLFloaterToybox::postBuild()
return TRUE;
}
void LLFloaterToybox::onOpen(const LLSD& key)
{
}
BOOL LLFloaterToybox::canClose()
{
return TRUE;
}
void LLFloaterToybox::onClose(bool app_quitting)
{
}
void LLFloaterToybox::draw()
{
llassert(gToolBarView != NULL);
LLCommandManager& cmdMgr = LLCommandManager::instance();
const command_id_list_t& command_list = mToolBar->getCommandsList();
for (U32 i = 0; i < cmdMgr.commandCount(); i++)
for (command_id_list_t::const_iterator it = command_list.begin(); it != command_list.end(); ++it)
{
LLCommand * command = cmdMgr.getCommand(i);
const LLCommandId& id = *it;
if (command->availableInToybox())
{
mToolBar->enableCommand(command->id(), !gToolBarView->hasCommand(command->id()));
}
const bool commandOnToolbar = gToolBarView->hasCommand(id);
mToolBar->enableCommand(id, !commandOnToolbar);
}
LLFloater::draw();
}
void LLFloaterToybox::onFocusReceived()
{
}
void LLFloaterToybox::onBtnRestoreDefaults()
{
LLToolBarView::loadDefaultToolbars();
}

View File

@ -42,11 +42,7 @@ public:
// virtuals
BOOL postBuild();
void onOpen(const LLSD& key);
BOOL canClose();
void onClose(bool app_quitting);
void draw();
void onFocusReceived();
protected:
void onBtnRestoreDefaults();

View File

@ -92,8 +92,6 @@ LLFloaterMove::~LLFloaterMove()
// virtual
BOOL LLFloaterMove::postBuild()
{
setIsChrome(TRUE);
setTitleVisible(TRUE); // restore title visibility after chrome applying
updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
LLDockableFloater::postBuild();

View File

@ -25,7 +25,7 @@
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llviewerprecompiledheaders.h"
#include "lltoolbarview.h"
@ -184,8 +184,8 @@ bool LLToolBarView::loadToolbars(bool force_default)
{
if (toolbar_set.left_toolbar.button_display_mode.isProvided())
{
U32 button_type = toolbar_set.left_toolbar.button_display_mode;
mToolbarLeft->setButtonType((LLToolBarEnums::ButtonType)(button_type));
LLToolBarEnums::ButtonType button_type = toolbar_set.left_toolbar.button_display_mode;
mToolbarLeft->setButtonType(button_type);
}
BOOST_FOREACH(LLCommandId::Params& command, toolbar_set.left_toolbar.commands)
{
@ -196,8 +196,8 @@ bool LLToolBarView::loadToolbars(bool force_default)
{
if (toolbar_set.right_toolbar.button_display_mode.isProvided())
{
U32 button_type = toolbar_set.right_toolbar.button_display_mode;
mToolbarRight->setButtonType((LLToolBarEnums::ButtonType)(button_type));
LLToolBarEnums::ButtonType button_type = toolbar_set.right_toolbar.button_display_mode;
mToolbarRight->setButtonType(button_type);
}
BOOST_FOREACH(LLCommandId::Params& command, toolbar_set.right_toolbar.commands)
{
@ -208,8 +208,8 @@ bool LLToolBarView::loadToolbars(bool force_default)
{
if (toolbar_set.bottom_toolbar.button_display_mode.isProvided())
{
U32 button_type = toolbar_set.bottom_toolbar.button_display_mode;
mToolbarBottom->setButtonType((LLToolBarEnums::ButtonType)(button_type));
LLToolBarEnums::ButtonType button_type = toolbar_set.bottom_toolbar.button_display_mode;
mToolbarBottom->setButtonType(button_type);
}
BOOST_FOREACH(LLCommandId::Params& command, toolbar_set.bottom_toolbar.commands)
{
@ -238,17 +238,17 @@ void LLToolBarView::saveToolbars() const
LLToolBarView::ToolbarSet toolbar_set;
if (mToolbarLeft)
{
toolbar_set.left_toolbar.button_display_mode = (int)(mToolbarLeft->getButtonType());
toolbar_set.left_toolbar.button_display_mode = mToolbarLeft->getButtonType();
addToToolset(mToolbarLeft->getCommandsList(),toolbar_set.left_toolbar);
}
if (mToolbarRight)
{
toolbar_set.right_toolbar.button_display_mode = (int)(mToolbarRight->getButtonType());
toolbar_set.right_toolbar.button_display_mode = mToolbarRight->getButtonType();
addToToolset(mToolbarRight->getCommandsList(),toolbar_set.right_toolbar);
}
if (mToolbarBottom)
{
toolbar_set.bottom_toolbar.button_display_mode = (int)(mToolbarBottom->getButtonType());
toolbar_set.bottom_toolbar.button_display_mode = mToolbarBottom->getButtonType();
addToToolset(mToolbarBottom->getCommandsList(),toolbar_set.bottom_toolbar);
}

View File

@ -50,7 +50,7 @@ public:
// the user folder for the user specific (saved) settings
struct Toolbar : public LLInitParam::Block<Toolbar>
{
Mandatory<U32> button_display_mode;
Mandatory<LLToolBarEnums::ButtonType> button_display_mode;
Multiple<LLCommandId::Params> commands;
Toolbar();
};
@ -73,7 +73,7 @@ public:
bool loadToolbars(bool force_default = false); // return false if load fails
static bool loadDefaultToolbars();
static void startDragItem( S32 x, S32 y, const LLUUID& uuid);
static BOOL handleDragItem( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type);
static BOOL handleDrop( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar);

View File

@ -1,20 +1,17 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
bg_alpha_image_overlay="DkGray_66"
legacy_header_height="0"
can_minimize="true"
can_resize="true"
follows="top|right"
height="174"
height="200"
layout="topleft"
min_height="128"
min_width="128"
name="Map"
title=""
title="Mini-map"
help_topic="map"
save_rect="true"
save_visibility="true"
single_instance="true"
left="0"
top="0"
width="200">
@ -27,17 +24,16 @@
[REGION](Double-click to teleport, shift-drag to pan)
</floater.string>
<floater.string name="mini_map_caption">
MINIMAP
Mini-map
</floater.string>
<net_map
bg_color="NetMapBackgroundColor"
follows="top|left|bottom|right"
layout="topleft"
left="0"
mouse_opaque="false"
name="Net Map"
width="200"
height="218"
height="200"
top="0"/>
<text
type="string"
@ -49,7 +45,7 @@
name="floater_map_north"
right="10"
text_color="1 1 1 0.7"
top="209">
top="189">
N
</text>
<text
@ -62,7 +58,7 @@
name="floater_map_east"
right="10"
text_color="1 1 1 0.7"
top="209">
top="189">
E
</text>
<text
@ -75,7 +71,7 @@
name="floater_map_west"
right="11"
text_color="1 1 1 0.7"
top="195">
top="175">
W
</text>
<text
@ -88,7 +84,7 @@
name="floater_map_south"
right="10"
text_color="1 1 1 0.7"
top="209">
top="189">
S
</text>
<text
@ -101,7 +97,7 @@
name="floater_map_southeast"
right="20"
text_color="1 1 1 0.7"
top="209">
top="189">
SE
</text>
<text
@ -114,7 +110,7 @@
name="floater_map_northeast"
right="20"
text_color="1 1 1 0.7"
top="209">
top="189">
NE
</text>
<text
@ -127,7 +123,7 @@
name="floater_map_southwest"
right="20"
text_color="1 1 1 0.7"
top="209">
top="189">
SW
</text>
<text
@ -140,7 +136,7 @@
name="floater_map_northwest"
right="20"
text_color="1 1 1 0.7"
top="209">
top="189">
NW
</text>
</floater>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
legacy_header_height="18"
can_dock="true"
can_dock="false"
can_minimize="true"
can_close="false"
can_close="true"
follows="bottom"
height="110"
layout="topleft"
@ -12,6 +12,7 @@
save_rect="true"
save_visibility="true"
save_dock_state="true"
title="Move"
width="133">
<string
name="walk_forward_tooltip">

View File

@ -8,7 +8,7 @@
name="Preferences"
help_topic="preferences"
single_instance="true"
title="PREFERENCES"
title="Preferences"
width="658">
<button
follows="right|bottom"

View File

@ -48,8 +48,8 @@
button_display_mode="icons_with_text"
follows="all"
left="20"
button_icon_and_text.max_button_width="140"
button_icon_and_text.min_button_width="70"
button_icon_and_text.button_width.max="140"
button_icon_and_text.button_width.min="70"
name="toybox_toolbar"
pad_left="5"
pad_right="5"

View File

@ -97,7 +97,7 @@
parameter="ShowWorldMapButton" />
</menu_item_check>
<menu_item_check
label="Mini-Map button"
label="Mini-map button"
layout="topleft"
name="ShowMiniMapButton">
<menu_item_check.on_click

View File

@ -257,7 +257,7 @@
name="World"
tear_off="true">
<menu_item_check
label="Mini-Map"
label="Mini-map"
name="Mini-Map"
shortcut="control|shift|M">
<menu_item_check.on_check

View File

@ -353,11 +353,11 @@ Disabled for now.
image_pressed_selected="PushButton_Selected_Press"
image_selected="PushButton_Selected_Press"
is_toggle="true"
label="Mini-Map"
label="Mini-map"
layout="topleft"
left="0"
name="mini_map_btn"
tool_tip="Shows/hides Mini-Map"
tool_tip="Shows/hides mini-map"
top="5"
use_ellipses="true"
width="80">

View File

@ -12,8 +12,8 @@
bg_opaque_image_overlay="MouseGray"
background_opaque="true"/>
<button_icon_and_text imgoverlay_label_space="7"
min_button_width="70"
max_button_width="140"
button_width.min="70"
button_width.max="140"
desired_height="24"
pad_left="10"
pad_right="10"
@ -25,8 +25,8 @@
<button_icon pad_left="10"
pad_right="10"
desired_height="35"
min_button_width="35"
max_button_width="35"
button_width.min="35"
button_width.max="35"
follows="left|top"
label=""
chrome="true"

View File

@ -38,7 +38,6 @@
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>