summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lldockcontrol.cpp7
-rw-r--r--indra/llui/lldockcontrol.h1
-rw-r--r--indra/llui/llscrollbar.cpp24
-rw-r--r--indra/llui/llscrollbar.h3
-rw-r--r--indra/llui/llscrolllistctrl.cpp29
-rw-r--r--indra/llui/llscrolllistctrl.h2
-rw-r--r--indra/llui/llviewereventrecorder.cpp4
-rw-r--r--indra/llui/llwindowshade.cpp46
-rw-r--r--indra/llui/llwindowshade.h7
9 files changed, 68 insertions, 55 deletions
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp
index bf0862e8a9..11dbad8c09 100644
--- a/indra/llui/lldockcontrol.cpp
+++ b/indra/llui/lldockcontrol.cpp
@@ -43,6 +43,8 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,
mDockWidgetHandle = dockWidget->getHandle();
}
+ mNonToolbarPanelHandle = mDockableFloater->getRootView()->getChild<LLView>("non_toolbar_panel")->getHandle();
+
if (dockableFloater->isDocked())
{
on();
@@ -97,7 +99,10 @@ void LLDockControl::setDock(LLView* dockWidget)
void LLDockControl::getAllowedRect(LLRect& rect)
{
- rect = mDockableFloater->getRootView()->getChild<LLView>("non_toolbar_panel")->getRect();
+ if(!mNonToolbarPanelHandle.isDead())
+ {
+ rect = mNonToolbarPanelHandle.get()->getRect();
+ }
}
void LLDockControl::repositionDockable()
diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h
index fb0bf7d251..7e31330713 100644
--- a/indra/llui/lldockcontrol.h
+++ b/indra/llui/lldockcontrol.h
@@ -84,6 +84,7 @@ private:
bool mDockWidgetVisible;
DocAt mDockAt;
LLHandle<LLView> mDockWidgetHandle;
+ LLHandle<LLView> mNonToolbarPanelHandle;
LLRect mPrevDockRect;
LLRect mRootRect;
LLRect mFloaterRect;
diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp
index 9c73b1ba3f..d0eec387bd 100644
--- a/indra/llui/llscrollbar.cpp
+++ b/indra/llui/llscrollbar.cpp
@@ -113,7 +113,8 @@ LLScrollbar::LLScrollbar(const Params & p)
up_btn.tab_stop(false);
up_btn.follows.flags = (mOrientation == VERTICAL ? (FOLLOWS_RIGHT | FOLLOWS_TOP) : (FOLLOWS_LEFT | FOLLOWS_BOTTOM));
- addChild(LLUICtrlFactory::create<LLButton>(up_btn));
+ mLineUpBtn = LLUICtrlFactory::create<LLButton>(up_btn);
+ addChild(mLineUpBtn);
LLButton::Params down_btn(mOrientation == VERTICAL ? p.down_button : p.right_button);
down_btn.name(std::string("Line Down"));
@@ -123,7 +124,8 @@ LLScrollbar::LLScrollbar(const Params & p)
down_btn.mouse_held_callback.function(boost::bind(&LLScrollbar::onLineDownBtnPressed, this, _2));
down_btn.tab_stop(false);
- addChild(LLUICtrlFactory::create<LLButton>(down_btn));
+ mLineDownBtn = LLUICtrlFactory::create<LLButton>(down_btn);
+ addChild(mLineDownBtn);
}
@@ -468,22 +470,20 @@ void LLScrollbar::reshape(S32 width, S32 height, bool called_from_parent)
{
if (width == getRect().getWidth() && height == getRect().getHeight()) return;
LLView::reshape( width, height, called_from_parent );
- LLButton* up_button = getChild<LLButton>("Line Up");
- LLButton* down_button = getChild<LLButton>("Line Down");
if (mOrientation == VERTICAL)
{
- up_button->reshape(up_button->getRect().getWidth(), llmin(getRect().getHeight() / 2, mThickness));
- down_button->reshape(down_button->getRect().getWidth(), llmin(getRect().getHeight() / 2, mThickness));
- up_button->setOrigin(0, getRect().getHeight() - up_button->getRect().getHeight());
- down_button->setOrigin(0, 0);
+ mLineUpBtn->reshape(mLineUpBtn->getRect().getWidth(), llmin(getRect().getHeight() / 2, mThickness));
+ mLineDownBtn->reshape(mLineDownBtn->getRect().getWidth(), llmin(getRect().getHeight() / 2, mThickness));
+ mLineUpBtn->setOrigin(0, getRect().getHeight() - mLineUpBtn->getRect().getHeight());
+ mLineDownBtn->setOrigin(0, 0);
}
else
{
- up_button->reshape(llmin(getRect().getWidth() / 2, mThickness), up_button->getRect().getHeight());
- down_button->reshape(llmin(getRect().getWidth() / 2, mThickness), down_button->getRect().getHeight());
- up_button->setOrigin(0, 0);
- down_button->setOrigin(getRect().getWidth() - down_button->getRect().getWidth(), 0);
+ mLineUpBtn->reshape(llmin(getRect().getWidth() / 2, mThickness), mLineUpBtn->getRect().getHeight());
+ mLineDownBtn->reshape(llmin(getRect().getWidth() / 2, mThickness), mLineDownBtn->getRect().getHeight());
+ mLineUpBtn->setOrigin(0, 0);
+ mLineDownBtn->setOrigin(getRect().getWidth() - mLineDownBtn->getRect().getWidth(), 0);
}
updateThumbRect();
}
diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h
index 7b935aa51b..9607355a9d 100644
--- a/indra/llui/llscrollbar.h
+++ b/indra/llui/llscrollbar.h
@@ -161,6 +161,9 @@ private:
LLUIImagePtr mTrackImageH;
S32 mThickness;
+
+ LLButton* mLineUpBtn = nullptr;
+ LLButton* mLineDownBtn = nullptr;
};
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 8512555b49..10d0ae0678 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -196,7 +196,6 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
mHighlightedItem(-1),
mBorder(NULL),
mSortCallback(NULL),
- mCommentTextView(NULL),
mNumDynamicWidthColumns(0),
mTotalStaticColumnWidth(0),
mTotalColumnPadding(0),
@@ -288,13 +287,6 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
addColumn(*row_it);
}
- for (LLInitParam::ParamIterator<LLScrollListItem::Params>::const_iterator row_it = p.contents.rows.begin();
- row_it != p.contents.rows.end();
- ++row_it)
- {
- addRow(*row_it);
- }
-
LLTextBox::Params text_p;
text_p.name("comment_text");
text_p.border_visible(false);
@@ -302,7 +294,15 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p)
text_p.follows.flags(FOLLOWS_ALL);
// word wrap was added accroding to the EXT-6841
text_p.wrap(true);
- addChild(LLUICtrlFactory::create<LLTextBox>(text_p));
+ mCommentText = LLUICtrlFactory::create<LLTextBox>(text_p);
+ addChild(mCommentText);
+
+ for (LLInitParam::ParamIterator<LLScrollListItem::Params>::const_iterator row_it = p.contents.rows.begin();
+ row_it != p.contents.rows.end();
+ ++row_it)
+ {
+ addRow(*row_it);
+ }
}
S32 LLScrollListCtrl::getSearchColumn()
@@ -541,12 +541,7 @@ void LLScrollListCtrl::updateLayout()
getRect().getWidth() - 2 * mBorderThickness,
getRect().getHeight() - (2 * mBorderThickness ) - heading_size );
- if (mCommentTextView == NULL)
- {
- mCommentTextView = getChildView("comment_text");
- }
-
- mCommentTextView->setShape(mItemListRect);
+ mCommentText->setShape(mItemListRect);
// how many lines of content in a single "page"
S32 page_lines = getLinesPerPage();
@@ -1244,7 +1239,7 @@ void LLScrollListCtrl::deselectAllItems(bool no_commit_on_change)
void LLScrollListCtrl::setCommentText(const std::string& comment_text)
{
- getChild<LLTextBox>("comment_text")->setValue(comment_text);
+ mCommentText->setValue(comment_text);
}
LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos)
@@ -1727,7 +1722,7 @@ void LLScrollListCtrl::draw()
updateColumns();
- getChildView("comment_text")->setVisible(mItemList.empty());
+ mCommentText->setVisible(mItemList.empty());
drawItems();
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index f25ba61fd4..1f9f26e08b 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -530,7 +530,7 @@ private:
class LLViewBorder* mBorder;
LLHandle<LLContextMenu> mPopupMenuHandle;
- LLView *mCommentTextView;
+ LLTextBox* mCommentText = nullptr;
LLWString mSearchString;
LLFrameTimer mSearchTimer;
diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp
index 1bf3e3c43b..e5e0545dad 100644
--- a/indra/llui/llviewereventrecorder.cpp
+++ b/indra/llui/llviewereventrecorder.cpp
@@ -98,6 +98,7 @@ void LLViewerEventRecorder::setMouseGlobalCoords(S32 x, S32 y) {
}
void LLViewerEventRecorder::updateMouseEventInfo(S32 local_x, S32 local_y, S32 global_x, S32 global_y, std::string mName) {
+ if (!logEvents) return;
LLView * target_view = LLUI::getInstance()->resolvePath(LLUI::getInstance()->getRootView(), xui);
if (! target_view) {
@@ -126,6 +127,8 @@ void LLViewerEventRecorder::updateMouseEventInfo(S32 local_x, S32 local_y, S32 g
void LLViewerEventRecorder::logVisibilityChange(std::string xui, std::string name, bool visibility, std::string event_subtype) {
+ if (!logEvents) return;
+
LLSD event=LLSD::emptyMap();
event.insert("event",LLSD(std::string("visibility")));
@@ -167,6 +170,7 @@ void LLViewerEventRecorder::update_xui(std::string xui) {
void LLViewerEventRecorder::logKeyEvent(KEY key, MASK mask) {
+ if (!logEvents) return;
// NOTE: Event recording only logs keydown events - the viewer itself hides keyup events at a fairly low level in the code and does not appear to care about them anywhere
LLSD event = LLSD::emptyMap();
diff --git a/indra/llui/llwindowshade.cpp b/indra/llui/llwindowshade.cpp
index e48bc94b0a..8131a56288 100644
--- a/indra/llui/llwindowshade.cpp
+++ b/indra/llui/llwindowshade.cpp
@@ -81,8 +81,8 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
panel_p.background_visible = true;
panel_p.bg_alpha_image = params.bg_image;
panel_p.auto_resize = false;
- LLLayoutPanel* notification_panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
- stackp->addChild(notification_panel);
+ mNotificationsArea = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
+ stackp->addChild(mNotificationsArea);
panel_p = LLUICtrlFactory::getDefaultParams<LLLayoutPanel>();
panel_p.auto_resize = true;
@@ -92,15 +92,15 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
panel_p.mouse_opaque = false;
panel_p.background_visible = false;
panel_p.bg_alpha_color = params.shade_color;
- LLLayoutPanel* dummy_panel = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
- stackp->addChild(dummy_panel);
+ mBackgroundArea = LLUICtrlFactory::create<LLLayoutPanel>(panel_p);
+ stackp->addChild(mBackgroundArea);
layout_p = LLUICtrlFactory::getDefaultParams<LLLayoutStack>();
layout_p.rect = LLRect(0, 30, 800, 0);
layout_p.follows.flags = FOLLOWS_ALL;
layout_p.orientation = LLLayoutStack::HORIZONTAL;
stackp = LLUICtrlFactory::create<LLLayoutStack>(layout_p);
- notification_panel->addChild(stackp);
+ mNotificationsArea->addChild(stackp);
panel_p = LLUICtrlFactory::getDefaultParams<LLLayoutPanel>();
panel_p.rect.height = 30;
@@ -121,7 +121,8 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
text_p.name = "notification_text";
text_p.use_ellipses = true;
text_p.wrap = true;
- panel->addChild(LLUICtrlFactory::create<LLTextBox>(text_p));
+ mNotificationsText = LLUICtrlFactory::create<LLTextBox>(text_p);
+ panel->addChild(mNotificationsText);
panel_p = LLUICtrlFactory::getDefaultParams<LLLayoutPanel>();
panel_p.auto_resize = false;
@@ -154,11 +155,9 @@ void LLWindowShade::initFromParams(const LLWindowShade::Params& params)
void LLWindowShade::draw()
{
- LLRect message_rect = getChild<LLTextBox>("notification_text")->getTextBoundingRect();
+ LLRect message_rect = mNotificationsText->getTextBoundingRect();
- LLLayoutPanel* notification_area = getChild<LLLayoutPanel>("notification_area");
-
- notification_area->reshape(notification_area->getRect().getWidth(),
+ mNotificationsArea->reshape(mNotificationsArea->getRect().getWidth(),
llclamp(message_rect.getHeight() + 15,
llmax(mFormHeight, MIN_NOTIFICATION_AREA_HEIGHT),
MAX_NOTIFICATION_AREA_HEIGHT));
@@ -176,21 +175,21 @@ void LLWindowShade::draw()
{
hide();
}
- else if (notification_area->getVisibleAmount() < 0.01f)
+ else if (mNotificationsArea->getVisibleAmount() < 0.01f)
{
displayLatestNotification();
}
- if (!notification_area->getVisible() && (notification_area->getVisibleAmount() < 0.001f))
+ if (!mNotificationsArea->getVisible() && (mNotificationsArea->getVisibleAmount() < 0.001f))
{
- getChildRef<LLLayoutPanel>("background_area").setBackgroundVisible(false);
+ mBackgroundArea->setBackgroundVisible(false);
setMouseOpaque(false);
}
}
void LLWindowShade::hide()
{
- getChildRef<LLLayoutPanel>("notification_area").setVisible(false);
+ mNotificationsArea->setVisible(false);
}
void LLWindowShade::onCloseNotification()
@@ -244,13 +243,12 @@ void LLWindowShade::displayLatestNotification()
LLSD payload = notification->getPayload();
LLNotificationFormPtr formp = notification->getForm();
- LLLayoutPanel& notification_area = getChildRef<LLLayoutPanel>("notification_area");
- notification_area.getChild<LLUICtrl>("notification_icon")->setValue(notification->getIcon());
- notification_area.getChild<LLUICtrl>("notification_text")->setValue(notification->getMessage());
- notification_area.getChild<LLUICtrl>("notification_text")->setToolTip(notification->getMessage());
+ mNotificationsArea->getChild<LLUICtrl>("notification_icon")->setValue(notification->getIcon());
+ mNotificationsText->setValue(notification->getMessage());
+ mNotificationsText->setToolTip(notification->getMessage());
LLNotificationForm::EIgnoreType ignore_type = formp->getIgnoreType();
- LLLayoutPanel& form_elements = notification_area.getChildRef<LLLayoutPanel>("form_elements");
+ LLLayoutPanel& form_elements = mNotificationsArea->getChildRef<LLLayoutPanel>("form_elements");
form_elements.deleteAllChildren();
form_elements.reshape(form_elements.getRect().getWidth(), MIN_NOTIFICATION_AREA_HEIGHT);
@@ -355,25 +353,25 @@ void LLWindowShade::displayLatestNotification()
(*it)->translate(0, delta_y);
}
- getChildRef<LLLayoutPanel>("notification_area").setVisible(true);
- getChildRef<LLLayoutPanel>("background_area").setBackgroundVisible(mModal);
+ mNotificationsArea->setVisible(true);
+ mBackgroundArea->setBackgroundVisible(mModal);
setMouseOpaque(mModal);
}
void LLWindowShade::setBackgroundImage(LLUIImage* image)
{
- getChild<LLLayoutPanel>("notification_area")->setTransparentImage(image);
+ mNotificationsArea->setTransparentImage(image);
}
void LLWindowShade::setTextColor(LLColor4 color)
{
- getChild<LLTextBox>("notification_text")->setColor(color);
+ mNotificationsText->setColor(color);
}
bool LLWindowShade::isShown() const
{
- return getChildRef<LLLayoutPanel>("notification_area").getVisible();
+ return mNotificationsArea->getVisible();
}
void LLWindowShade::setCanClose(bool can_close)
diff --git a/indra/llui/llwindowshade.h b/indra/llui/llwindowshade.h
index a401394d78..da29188943 100644
--- a/indra/llui/llwindowshade.h
+++ b/indra/llui/llwindowshade.h
@@ -31,6 +31,9 @@
#include "llnotifications.h"
#include "lluiimage.h"
+class LLLayoutPanel;
+class LLTextBox;
+
class LLWindowShade : public LLUICtrl
{
public:
@@ -68,6 +71,10 @@ private:
void onEnterNotificationText(LLUICtrl* ctrl, const std::string& name);
void onClickIgnore(LLUICtrl* ctrl);
+ LLLayoutPanel* mBackgroundArea = nullptr;
+ LLLayoutPanel* mNotificationsArea = nullptr;
+ LLTextBox* mNotificationsText = nullptr;
+
std::vector<LLNotificationPtr> mNotifications;
LLSD mNotificationResponse;
bool mModal;