Merge from viewer-experience

meow-7.2.2
Leslie Linden 2011-12-16 16:02:47 -08:00
commit 2beaa0585e
10 changed files with 107 additions and 14 deletions

View File

@ -589,15 +589,23 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height)
// virtual
void LLButton::draw()
{
static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true);
F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency();
bool flash = FALSE;
if( mFlashing )
if( mFlashing)
{
F32 elapsed = mFlashingTimer.getElapsedTimeF32();
S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f);
// flash on or off?
flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f);
if ( sEnableButtonFlashing)
{
F32 elapsed = mFlashingTimer.getElapsedTimeF32();
S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f);
// flash on or off?
flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f);
}
else
{ // otherwise just highlight button in flash color
flash = true;
}
}
bool pressed_by_keyboard = FALSE;

View File

@ -98,24 +98,25 @@ class LLCustomButtonIconCtrl : public LLButton
{
public:
struct Params
: public LLInitParam::Block<Params, LLButton::Params>
: public LLInitParam::Block<Params, LLButton::Params>
{
// LEFT, RIGHT, TOP, BOTTOM paddings of LLIconCtrl in this class has same value
Optional<S32> icon_ctrl_pad;
Params():
icon_ctrl_pad("icon_ctrl_pad", 1)
Params()
: icon_ctrl_pad("icon_ctrl_pad", 1)
{}
};
protected:
friend class LLUICtrlFactory;
LLCustomButtonIconCtrl(const Params& p):
LLButton(p),
LLCustomButtonIconCtrl(const Params& p)
: LLButton(p),
mIcon(NULL),
mIconAlignment(LLFontGL::HCENTER),
mIconCtrlPad(p.icon_ctrl_pad)
{}
{}
public:

View File

@ -598,7 +598,7 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s
pos = getEditableIndex(pos, true);
segment_set_t::iterator seg_iter = getSegIterContaining(pos);
segment_set_t::iterator seg_iter = getEditableSegIterContaining(pos);
LLTextSegmentPtr default_segment;
@ -1510,8 +1510,37 @@ void LLTextBase::getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg
}
}
LLTextBase::segment_set_t::iterator LLTextBase::getEditableSegIterContaining(S32 index)
{
segment_set_t::iterator it = getSegIterContaining(index);
if (it == mSegments.end()) return it;
if (!(*it)->canEdit()
&& index == (*it)->getStart()
&& it != mSegments.begin())
{
it--;
}
return it;
}
LLTextBase::segment_set_t::const_iterator LLTextBase::getEditableSegIterContaining(S32 index) const
{
segment_set_t::const_iterator it = getSegIterContaining(index);
if (it == mSegments.end()) return it;
if (!(*it)->canEdit()
&& index == (*it)->getStart()
&& it != mSegments.begin())
{
it--;
}
return it;
}
LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index)
{
static LLPointer<LLIndexSegment> index_segment = new LLIndexSegment();
if (index > getLength()) { return mSegments.end(); }

View File

@ -461,6 +461,8 @@ protected:
void getSegmentAndOffset( S32 startpos, segment_set_t::const_iterator* seg_iter, S32* offsetp ) const;
void getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg_iter, S32* offsetp );
LLTextSegmentPtr getSegmentAtLocalPos( S32 x, S32 y, bool hit_past_end_of_line = true);
segment_set_t::iterator getEditableSegIterContaining(S32 index);
segment_set_t::const_iterator getEditableSegIterContaining(S32 index) const;
segment_set_t::iterator getSegIterContaining(S32 index);
segment_set_t::const_iterator getSegIterContaining(S32 index) const;
void clearSegments();

View File

@ -1150,6 +1150,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>EnableButtonFlashing</key>
<map>
<key>Comment</key>
<string>Allow UI to flash buttons to get your attention</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ButtonHPad</key>
<map>
<key>Comment</key>

View File

@ -680,12 +680,29 @@ namespace action_give_inventory
std::string items;
build_items_string(inventory_selected_uuids, items);
int folders_count = 0;
std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin();
//traverse through selected inventory items and count folders among them
for ( ; it != inventory_selected_uuids.end() && folders_count <=1 ; ++it)
{
LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it);
if (NULL != inv_cat)
{
folders_count++;
}
}
// EXP-1599
// In case of sharing multiple folders, make the confirmation
// dialog contain a warning that only one folder can be shared at a time.
std::string notification = (folders_count > 1) ? "ShareFolderConfirmation" : "ShareItemsConfirmation";
LLSD substitutions;
substitutions["RESIDENTS"] = residents;
substitutions["ITEMS"] = items;
LLShareInfo::instance().mAvatarNames = avatar_names;
LLShareInfo::instance().mAvatarUuids = avatar_uuids;
LLNotificationsUtil::add("ShareItemsConfirmation", substitutions, LLSD(), &give_inventory_cb);
LLNotificationsUtil::add(notification, substitutions, LLSD(), &give_inventory_cb);
}
}

View File

@ -6,6 +6,7 @@
<menu_item_call
label="Undo"
name="Undo"
allow_key_repeat="true"
shortcut="control|Z">
<menu_item_call.on_click
function="Edit.Undo" />
@ -15,6 +16,7 @@
<menu_item_call
label="Redo"
name="Redo"
allow_key_repeat="true"
shortcut="control|Y">
<menu_item_call.on_click
function="Edit.Redo" />
@ -43,6 +45,7 @@
<menu_item_call
label="Paste"
name="Paste"
allow_key_repeat="true"
shortcut="control|V">
<menu_item_call.on_click
function="Edit.Paste" />

View File

@ -1161,6 +1161,7 @@
enabled="false"
label="Undo"
name="Undo"
allow_key_repeat="true"
shortcut="control|Z">
<on_click
function="Edit.Undo"
@ -1172,6 +1173,7 @@
enabled="false"
label="Redo"
name="Redo"
allow_key_repeat="true"
shortcut="control|Y">
<on_click
function="Edit.Redo"

View File

@ -6963,6 +6963,26 @@ With the following Residents:
yestext="OK"/>
</notification>
<notification
icon="notifytip.tga"
name="ShareFolderConfirmation"
type="alertmodal">
Only one folder at a time can be shared.
Are you sure you want to share the following items:
&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
With the following Residents:
[RESIDENTS]
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
notext="Cancel"
yestext="Ok"/>
</notification>
<notification
icon="notifytip.tga"
name="ItemsShared"

View File

@ -1,4 +1,4 @@
<paths>
<paths>
<directory>
<subdir>xui</subdir>
<subdir>en</subdir>