Fix the borders of drop targets to look like they did back in 1.8.0

This commit is contained in:
Inusaito Sayori
2013-08-08 22:02:24 -04:00
parent 5b4b2b1078
commit d6aace58b3
7 changed files with 38 additions and 16 deletions

View File

@@ -42,6 +42,7 @@
#include "lltextbox.h" #include "lltextbox.h"
#include "lltooldraganddrop.h" #include "lltooldraganddrop.h"
#include "lltrans.h" #include "lltrans.h"
#include "llviewborder.h"
static LLRegisterWidget<LLDropTarget> r("drop_target"); static LLRegisterWidget<LLDropTarget> r("drop_target");
@@ -63,16 +64,23 @@ LLDropTarget::LLDropTarget(const LLDropTarget::Params& p)
setControlName(p.control_name, NULL); setControlName(p.control_name, NULL);
mText->setOrigin(0, 0); mText->setOrigin(0, 0);
mText->setFollows(FOLLOWS_NONE); mText->setFollows(FOLLOWS_NONE);
mText->setMouseOpaque(false);
mText->setHAlign(LLFontGL::HCENTER); mText->setHAlign(LLFontGL::HCENTER);
mText->setBorderVisible(true); mText->setVPad(1);
mText->setBorderColor(LLUI::sColorsGroup->getColor("DefaultHighlightLight"));
mBorder = new LLViewBorder("drop_border", p.rect, LLViewBorder::BEVEL_IN);
addChild(mBorder);
mBorder->setMouseOpaque(false);
if (p.fill_parent) fillParent(getParent()); if (p.fill_parent) fillParent(getParent());
if (!p.border_visible) mBorder->setBorderWidth(0);
} }
LLDropTarget::~LLDropTarget() LLDropTarget::~LLDropTarget()
{ {
delete mText; delete mText;
delete mBorder;
} }
// static // static
@@ -89,7 +97,9 @@ void LLDropTarget::initFromXML(LLXMLNodePtr node, LLView* parent)
LLView::initFromXML(node, parent); LLView::initFromXML(node, parent);
const LLRect& rect = getRect(); const LLRect& rect = getRect();
mText->setRect(LLRect(0, rect.getHeight(), rect.getWidth(), 0)); const LLRect child_rect(0, rect.getHeight(), rect.getWidth(), 0);
mText->setRect(child_rect);
mBorder->setRect(child_rect);
if (node->hasAttribute("name")) // Views can't have names, but drop targets can if (node->hasAttribute("name")) // Views can't have names, but drop targets can
{ {
@@ -111,6 +121,13 @@ void LLDropTarget::initFromXML(LLXMLNodePtr node, LLView* parent)
node->getAttribute_bool("fill_parent", fill); node->getAttribute_bool("fill_parent", fill);
if (fill) fillParent(parent); if (fill) fillParent(parent);
} }
if (node->hasAttribute("border_visible"))
{
bool border_visible;
node->getAttribute_bool("border_visible", border_visible);
if (!border_visible) mBorder->setBorderWidth(0);
}
} }
// virtual // virtual
@@ -154,7 +171,9 @@ void LLDropTarget::fillParent(const LLView* parent)
} }
// The following block enlarges the target, but maintains the desired size for the text and border // The following block enlarges the target, but maintains the desired size for the text and border
mText->setRect(getRect()); // mText takes over the old rectangle, since the position will now be relative to the parent's rectangle for the text. const LLRect& rect = getRect(); // Children maintain the old rectangle
mText->setRect(rect);
mBorder->setRect(rect);
const LLRect& parent_rect = parent->getRect(); const LLRect& parent_rect = parent->getRect();
setRect(LLRect(0, parent_rect.getHeight(), parent_rect.getWidth(), 0)); setRect(LLRect(0, parent_rect.getHeight(), parent_rect.getWidth(), 0));
} }

View File

@@ -44,11 +44,13 @@ class LLDropTarget : public LLView
public: public:
struct Params : public LLInitParam::Block<Params, LLView::Params> struct Params : public LLInitParam::Block<Params, LLView::Params>
{ {
Optional<bool> border_visible; // Whether or not to display the border
Optional<std::string> control_name; // Control to change on item drop (Per Account only) Optional<std::string> control_name; // Control to change on item drop (Per Account only)
Optional<std::string> label; // Label for the LLTextBox, used when label doesn't dynamically change on drop Optional<std::string> label; // Label for the LLTextBox, used when label doesn't dynamically change on drop
Optional<bool> fill_parent; // Whether or not to fill the direct parent, to have a larger drop target. If true, the next sibling must explicitly define its rect without deltas. Optional<bool> fill_parent; // Whether or not to fill the direct parent, to have a larger drop target. If true, the next sibling must explicitly define its rect without deltas.
Params() Params()
: control_name("control_name", "") : border_visible("border_visible", true)
, control_name("control_name", "")
, label("label", "") , label("label", "")
, fill_parent("fill_parent", false) , fill_parent("fill_parent", false)
{ {
@@ -74,6 +76,7 @@ public:
protected: protected:
LLUUID mEntityID; LLUUID mEntityID;
private: private:
class LLViewBorder* mBorder;
LLControlVariable* mControl; LLControlVariable* mControl;
class LLTextBox* mText; class LLTextBox* mText;
}; };

View File

@@ -10,7 +10,7 @@
width="610" width="610"
height="380"> height="380">
<drop_target bottom="-78" height="15" left="14" width="176" control_name="AOConfigNotecardID" fill_parent="true" name="ao_notecard" tool_tip="Drop a ZHAO notecard here. Animations have to be in the same Inventory folder as the notecard."/> <drop_target bottom="-80" height="17" left="12" width="180" control_name="AOConfigNotecardID" fill_parent="true" name="ao_notecard" tool_tip="Drop a ZHAO notecard here. Animations have to be in the same Inventory folder as the notecard."/>
<button <button
name="opencard" name="opencard"

View File

@@ -158,7 +158,7 @@
mouse_opaque="true" name="Give item:" v_pad="0" width="75"> mouse_opaque="true" name="Give item:" v_pad="0" width="75">
Give item: Give item:
</text> </text>
<drop_target bottom="-425" height="15" left_delta="81" width="318" fill_parent="true" name="drop_target_rect" label="Drop inventory item here." tool_tip="Drop inventory items here to give them to this person."/> <drop_target bottom="-427" height="17" left_delta="79" width="321" fill_parent="true" name="drop_target_rect" label="Drop inventory item here." tool_tip="Drop inventory items here to give them to this person."/>
<check_box bottom="-447" follows="left|top" font="SansSerifSmall" height="16" <check_box bottom="-447" follows="left|top" font="SansSerifSmall" height="16"
initial_value="false" label="Show in search" left="75" mouse_opaque="true" initial_value="false" label="Show in search" left="75" mouse_opaque="true"
name="allow_publish" name="allow_publish"

View File

@@ -107,7 +107,7 @@ and you can&apos;t send a folder.
name="drop_target2" width="76" /> name="drop_target2" width="76" />
<icon bottom_delta="7" height="64" image_name="icon_groupnoticeinventory.tga" <icon bottom_delta="7" height="64" image_name="icon_groupnoticeinventory.tga"
left_delta="5" mouse_opaque="true" name="drop_icon" width="64" /> left_delta="5" mouse_opaque="true" name="drop_icon" width="64" />
<group_drop_target bottom="24" left="67" fill_parent="true" height="14" width="207" name="drop_target" <group_drop_target bottom="24" left="67" fill_parent="true" height="14" width="207" name="drop_target" border_visible="false"
tool_tip="Drag an inventory item onto the message box to send it with the notice. You must have permission to copy and transfer the object to send it with the notice."/> tool_tip="Drag an inventory item onto the message box to send it with the notice. You must have permission to copy and transfer the object to send it with the notice."/>
</panel> </panel>
<panel border="false" bottom="0" follows="all" height="268" label="View Past Notice" <panel border="false" bottom="0" follows="all" height="268" label="View Past Notice"

View File

@@ -74,21 +74,21 @@ The following wildcards are available to enhance your autoresponses: #n for user
<check_box bottom_delta="0" left_delta="100" follows="left|top" control_name="AutoresponseAnyoneItem" name="AutoresponseAnyoneItem" label="Send item"/> <check_box bottom_delta="0" left_delta="100" follows="left|top" control_name="AutoresponseAnyoneItem" name="AutoresponseAnyoneItem" label="Send item"/>
<check_box bottom_delta="0" left_delta="80" follows="left|top" control_name="AutoresponseAnyoneShow" name="AutoresponseAnyoneShow" label="Show that this was sent"/> <check_box bottom_delta="0" left_delta="80" follows="left|top" control_name="AutoresponseAnyoneShow" name="AutoresponseAnyoneShow" label="Show that this was sent"/>
<text_editor bottom_delta="-47" left="8" font="SansSerifSmall" follows="left|top" height="45" max_length="1100" control_name="AutoresponseAnyoneMessage" name="AutoresponseAnyoneMessage" width="480" word_wrap="true" spell_check="true" hide_scrollbar="true"/> <text_editor bottom_delta="-47" left="8" font="SansSerifSmall" follows="left|top" height="45" max_length="1100" control_name="AutoresponseAnyoneMessage" name="AutoresponseAnyoneMessage" width="480" word_wrap="true" spell_check="true" hide_scrollbar="true"/>
<drop_target bottom_delta="-122" left="10" height="15" width="476" control_name="AutoresponseAnyoneItemID" name="AutoresponseAnyoneItemID" tool_tip="Drop an item here to have it sent with the above response."/> <drop_target bottom_delta="-124" left="8" height="17" width="480" control_name="AutoresponseAnyoneItemID" name="AutoresponseAnyoneItemID" tool_tip="Drop an item here to have it sent with the above response."/>
<check_box bottom_delta="80" left="6" follows="left|top" control_name="AutoresponseNonFriends" name="AutoresponseNonFriends" label="Autorespond to nonfriends" tool_tip="Send the message in the box below to people who are not your friends"/> <check_box bottom_delta="82" left="6" follows="left|top" control_name="AutoresponseNonFriends" name="AutoresponseNonFriends" label="Autorespond to nonfriends" tool_tip="Send the message in the box below to people who are not your friends"/>
<check_box bottom_delta="0" left_delta="250" follows="left|top" control_name="AutoresponseNonFriendsItem" name="AutoresponseNonFriendsItem" label="Send item"/> <check_box bottom_delta="0" left_delta="250" follows="left|top" control_name="AutoresponseNonFriendsItem" name="AutoresponseNonFriendsItem" label="Send item"/>
<check_box bottom_delta="0" left_delta="80" follows="left|top" control_name="AutoresponseNonFriendsShow" name="AutoresponseNonFriendsShow" label="Show that this was sent"/> <check_box bottom_delta="0" left_delta="80" follows="left|top" control_name="AutoresponseNonFriendsShow" name="AutoresponseNonFriendsShow" label="Show that this was sent"/>
<text_editor bottom_delta="-47" left="8" font="SansSerifSmall" follows="left|top" height="45" max_length="1100" control_name="AutoresponseNonFriendsMessage" name="AutoresponseNonFriendsMessage" width="480" word_wrap="true" spell_check="true" hide_scrollbar="true"/> <text_editor bottom_delta="-47" left="8" font="SansSerifSmall" follows="left|top" height="45" max_length="1100" control_name="AutoresponseNonFriendsMessage" name="AutoresponseNonFriendsMessage" width="480" word_wrap="true" spell_check="true" hide_scrollbar="true"/>
<drop_target bottom_delta="-122" left="10" height="15" width="476" control_name="AutoresponseNonFriendsItemID" name="AutoresponseNonFriendsItemID" tool_tip="Drop an item here to have it sent with the above response."/> <drop_target bottom_delta="-124" left="8" height="17" width="480" control_name="AutoresponseNonFriendsItemID" name="AutoresponseNonFriendsItemID" tool_tip="Drop an item here to have it sent with the above response."/>
<check_box bottom_delta="80" left="6" follows="left|top" control_name="AutoresponseMuted" name="AutoresponseMuted" label="Autorespond to people you have muted" tool_tip="Send the message in the box below to people you have muted."/> <check_box bottom_delta="82" left="6" follows="left|top" control_name="AutoresponseMuted" name="AutoresponseMuted" label="Autorespond to people you have muted" tool_tip="Send the message in the box below to people you have muted."/>
<check_box bottom_delta="0" left_delta="250" follows="left|top" control_name="AutoresponseMutedItem" name="AutoresponseMutedItem" label="Send item"/> <check_box bottom_delta="0" left_delta="250" follows="left|top" control_name="AutoresponseMutedItem" name="AutoresponseMutedItem" label="Send item"/>
<text_editor bottom_delta="-47" left="8" font="SansSerifSmall" follows="left|top" height="45" max_length="1100" control_name="AutoresponseMutedMessage" name="AutoresponseMutedMessage" width="480" word_wrap="true" spell_check="true" hide_scrollbar="true"/> <text_editor bottom_delta="-47" left="8" font="SansSerifSmall" follows="left|top" height="45" max_length="1100" control_name="AutoresponseMutedMessage" name="AutoresponseMutedMessage" width="480" word_wrap="true" spell_check="true" hide_scrollbar="true"/>
<drop_target bottom_delta="-122" left="10" height="15" width="476" control_name="AutoresponseMutedItemID" name="AutoresponseMutedItemID" tool_tip="Drop an item here to have it sent with the above response."/> <drop_target bottom_delta="-124" left="8" height="17" width="480" control_name="AutoresponseMutedItemID" name="AutoresponseMutedItemID" tool_tip="Drop an item here to have it sent with the above response."/>
<text bottom_delta="86" left="8" follows="left|top" name="BusyModeResponseText" tool_tip="Send the message in the box below to people who message when you are busy.">Busy Mode Response:</text> <text bottom_delta="88" left="8" follows="left|top" name="BusyModeResponseText" tool_tip="Send the message in the box below to people who message when you are busy.">Busy Mode Response:</text>
<check_box bottom_delta="-5" left_delta="250" follows="left|top" control_name="BusyModeResponseItem" name="BusyModeResponseItem" label="Send item"/> <check_box bottom_delta="-5" left_delta="250" follows="left|top" control_name="BusyModeResponseItem" name="BusyModeResponseItem" label="Send item"/>
<check_box bottom_delta="0" left_delta="80" follows="left|top" control_name="BusyModeResponseShow" name="BusyModeResponseShow" label="Show that this was sent"/> <check_box bottom_delta="0" left_delta="80" follows="left|top" control_name="BusyModeResponseShow" name="BusyModeResponseShow" label="Show that this was sent"/>
<text_editor bottom_delta="-47" left="8" font="SansSerifSmall" follows="left|top" height="45" max_length="1100" control_name="BusyModeResponse" name="BusyModeResponse" width="480" word_wrap="true" spell_check="true" hide_scrollbar="true"/> <text_editor bottom_delta="-47" left="8" font="SansSerifSmall" follows="left|top" height="45" max_length="1100" control_name="BusyModeResponse" name="BusyModeResponse" width="480" word_wrap="true" spell_check="true" hide_scrollbar="true"/>
<drop_target bottom_delta="-122" left="10" height="15" width="476" control_name="BusyModeResponseItemID" name="BusyModeResponseItemID" tool_tip="Drop an item here to have it sent with the above response."/> <drop_target bottom_delta="-124" left="8" height="17" width="480" control_name="BusyModeResponseItemID" name="BusyModeResponseItemID" tool_tip="Drop an item here to have it sent with the above response."/>
</panel> </panel>
<panel border="true" left="1" bottom="-408" height="408" width="500" label="Spam" name="Spam"> <panel border="true" left="1" bottom="-408" height="408" width="500" label="Spam" name="Spam">

View File

@@ -136,7 +136,7 @@
<combo_item name="High" value="High">High</combo_item> <combo_item name="High" value="High">High</combo_item>
</combo_box> </combo_box>
<check_box name="EmeraldBuildPrefsEmbedItem" left="5" bottom_delta="-20" follows="top" initial_value="false" label="Put an item into new objects" control_name="EmeraldBuildPrefs_EmbedItem"/> <check_box name="EmeraldBuildPrefsEmbedItem" left="5" bottom_delta="-20" follows="top" initial_value="false" label="Put an item into new objects" control_name="EmeraldBuildPrefs_EmbedItem"/>
<drop_target control_name="EmeraldBuildPrefs_Item" bottom_delta="-5" left="10" height="15" name="build_item_add_disp_rect" width="270"/> <drop_target control_name="EmeraldBuildPrefs_Item" bottom_delta="-3" left="9" height="17" name="build_item_add_disp_rect" width="274"/>
<check_box bottom_delta="4" follows="top" left_delta="274" label="Highlight selected prims" name="EmBuildPrefsRenderHighlight_toggle" control_name="RenderHighlightSelections"/> <check_box bottom_delta="4" follows="top" left_delta="274" label="Highlight selected prims" name="EmBuildPrefsRenderHighlight_toggle" control_name="RenderHighlightSelections"/>
<check_box bottom_delta="-20" follows="top" initial_value="false" label="Axis arrow on root prim position" tool_tip="Default behaviour is to show the axis on the center of mass of a linkset. If enabled, the axis will be shown on the root prim of the linkset instead." name="EmBuildPrefsActualRoot_toggle" control_name="AscentBuildPrefs_ActualRoot"/> <check_box bottom_delta="-20" follows="top" initial_value="false" label="Axis arrow on root prim position" tool_tip="Default behaviour is to show the axis on the center of mass of a linkset. If enabled, the axis will be shown on the root prim of the linkset instead." name="EmBuildPrefsActualRoot_toggle" control_name="AscentBuildPrefs_ActualRoot"/>
</panel> </panel>