summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltoolbar.cpp9
-rw-r--r--indra/llui/lltoolbarview.cpp36
-rw-r--r--indra/llui/lltoolbarview.h8
-rw-r--r--indra/llui/llui.cpp1
-rw-r--r--indra/llui/lluictrlfactory.h4
5 files changed, 37 insertions, 21 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 1e8be93f17..167dbfcc47 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -30,9 +30,7 @@
#include "boost/foreach.hpp"
#include "lltoolbar.h"
-// uncomment this and remove the one in llui.cpp when there is an external reference to this translation unit
-// thanks, MSVC!
-//static LLDefaultChildRegistry::Register<LLToolBar> r1("toolbar");
+static LLDefaultChildRegistry::Register<LLToolBar> r1("toolbar");
namespace LLToolBarEnums
{
@@ -62,7 +60,7 @@ LLToolBar::Params::Params()
background_image("background_image")
{}
-LLToolBar::LLToolBar(const Params& p)
+LLToolBar::LLToolBar(const LLToolBar::Params& p)
: LLUICtrl(p),
mButtonType(p.button_display_mode),
mSideType(p.side),
@@ -78,6 +76,9 @@ LLToolBar::LLToolBar(const Params& p)
void LLToolBar::initFromParams(const LLToolBar::Params& p)
{
+ // Initialize the base object
+ LLUICtrl::initFromParams(p);
+
LLLayoutStack::ELayoutOrientation orientation = getOrientation(p.side);
LLLayoutStack::Params centering_stack_p;
diff --git a/indra/llui/lltoolbarview.cpp b/indra/llui/lltoolbarview.cpp
index 0e54c91cea..590cd4ffca 100644
--- a/indra/llui/lltoolbarview.cpp
+++ b/indra/llui/lltoolbarview.cpp
@@ -28,6 +28,7 @@
#include "linden_common.h"
#include "lltoolbarview.h"
+
#include "lltoolbar.h"
#include "llbutton.h"
@@ -35,33 +36,39 @@ LLToolBarView* gToolBarView = NULL;
static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view");
-LLToolBarView::LLToolBarView(const Params& p)
+LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)
: LLUICtrl(p)
{
}
-BOOL LLToolBarView::postBuild()
+void LLToolBarView::initFromParams(const LLToolBarView::Params& p)
+{
+ // Initialize the base object
+ LLUICtrl::initFromParams(p);
+}
+
+LLToolBarView::~LLToolBarView()
{
- LLRect ctrl_rect = getRect();
- LLButton* btn = getChild<LLButton>("test");
- LLRect btn_rect = btn->getRect();
- llinfos << "Merov debug : control rect = " << ctrl_rect.mLeft << ", " << ctrl_rect.mTop << ", " << ctrl_rect.mRight << ", " << ctrl_rect.mBottom << llendl;
- llinfos << "Merov debug : test rect = " << btn_rect.mLeft << ", " << btn_rect.mTop << ", " << btn_rect.mRight << ", " << btn_rect.mBottom << llendl;
- return TRUE;
}
void LLToolBarView::draw()
{
static bool debug_print = true;
+ static S32 old_width = 0;
+ static S32 old_height = 0;
LLToolBar* toolbar_bottom = getChild<LLToolBar>("toolbar_bottom");
LLToolBar* toolbar_left = getChild<LLToolBar>("toolbar_left");
LLToolBar* toolbar_right = getChild<LLToolBar>("toolbar_right");
+ LLPanel* sizer_left = getChild<LLPanel>("sizer_left");
LLRect bottom_rect = toolbar_bottom->getRect();
LLRect left_rect = toolbar_left->getRect();
LLRect right_rect = toolbar_right->getRect();
+ LLRect sizer_left_rect = sizer_left->getRect();
+ if ((old_width != getRect().getWidth()) || (old_height != getRect().getHeight()))
+ debug_print = true;
if (debug_print)
{
LLRect ctrl_rect = getRect();
@@ -69,13 +76,18 @@ void LLToolBarView::draw()
llinfos << "Merov debug : draw bottom rect = " << bottom_rect.mLeft << ", " << bottom_rect.mTop << ", " << bottom_rect.mRight << ", " << bottom_rect.mBottom << llendl;
llinfos << "Merov debug : draw left rect = " << left_rect.mLeft << ", " << left_rect.mTop << ", " << left_rect.mRight << ", " << left_rect.mBottom << llendl;
llinfos << "Merov debug : draw right rect = " << right_rect.mLeft << ", " << right_rect.mTop << ", " << right_rect.mRight << ", " << right_rect.mBottom << llendl;
+ llinfos << "Merov debug : draw s left rect = " << sizer_left_rect.mLeft << ", " << sizer_left_rect.mTop << ", " << sizer_left_rect.mRight << ", " << sizer_left_rect.mBottom << llendl;
+ old_width = ctrl_rect.getWidth();
+ old_height = ctrl_rect.getHeight();
debug_print = false;
}
// Debug draw
- gl_rect_2d(getLocalRect(), LLColor4::blue, TRUE);
- gl_rect_2d(bottom_rect, LLColor4::red, TRUE);
- gl_rect_2d(left_rect, LLColor4::green, TRUE);
- gl_rect_2d(right_rect, LLColor4::yellow, TRUE);
+ LLColor4 back_color = LLColor4::blue;
+ back_color[VALPHA] = 0.5f;
+// gl_rect_2d(getLocalRect(), back_color, TRUE);
+// gl_rect_2d(bottom_rect, LLColor4::red, TRUE);
+// gl_rect_2d(left_rect, LLColor4::green, TRUE);
+// gl_rect_2d(right_rect, LLColor4::yellow, TRUE);
LLUICtrl::draw();
}
diff --git a/indra/llui/lltoolbarview.h b/indra/llui/lltoolbarview.h
index 0bd0070ab7..73278e226b 100644
--- a/indra/llui/lltoolbarview.h
+++ b/indra/llui/lltoolbarview.h
@@ -30,19 +30,23 @@
#include "lluictrl.h"
+class LLUICtrlFactory;
+
// Parent of all LLToolBar
class LLToolBarView : public LLUICtrl
{
public:
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> {};
- void draw();
- /*virtual*/ BOOL postBuild();
+ virtual ~LLToolBarView();
+ virtual void draw();
protected:
friend class LLUICtrlFactory;
LLToolBarView(const Params&);
+ void initFromParams(const Params&);
+
private:
LLHandle<LLView> mSnapView;
};
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 1bc575438c..a4303780fd 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -93,7 +93,6 @@ std::list<std::string> gUntranslated;
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");
-static LLDefaultChildRegistry::Register<LLToolBar> r1("toolbar");
// register other widgets which otherwise may not be linked in
static LLDefaultChildRegistry::Register<LLLoadingIndicator> register_loading_indicator("loading_indicator");
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index d345ad4cd0..71c38237c1 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -172,7 +172,7 @@ public:
static T* createFromFile(const std::string &filename, LLView *parent, const widget_registry_t& registry, LLXMLNodePtr output_node = NULL)
{
T* widget = NULL;
-
+
std::string skinned_filename = findSkinnedFilename(filename);
instance().pushFileName(filename);
{
@@ -201,10 +201,10 @@ public:
// not of right type, so delete it
if (!widget)
{
+ llwarns << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << llendl;
delete view;
view = NULL;
}
-
}
}
fail: