diff options
-rw-r--r-- | indra/llui/lltoolbar.cpp | 9 | ||||
-rw-r--r-- | indra/llui/lltoolbarview.cpp | 36 | ||||
-rw-r--r-- | indra/llui/lltoolbarview.h | 8 | ||||
-rw-r--r-- | indra/llui/llui.cpp | 1 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.h | 4 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/main_view.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_toolbar_view.xml | 28 |
8 files changed, 55 insertions, 41 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: diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d197782eed..e851398bf5 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1783,15 +1783,12 @@ void LLViewerWindow::initBase() // *TODO: Eventually, suppress the existence of this debug setting and turn toolbar FUI on permanently if (gSavedSettings.getBOOL("DebugToolbarFUI")) { - llinfos << "Merov debug : Creating the toolbar view" << llendl; // Get a pointer to the toolbar view holder LLPanel* panel_holder = main_view->getChild<LLPanel>("toolbar_view_holder"); - llinfos << "Merov debug : panel_holder = " << panel_holder << llendl; // Load the toolbar view from file - gToolBarView = LLUICtrlFactory::getInstance()->createFromFile<LLToolBarView>("panel_toolbar_view.xml", NULL, LLPanel::child_registry_t::instance()); - llinfos << "Merov debug : gToolBarView = " << gToolBarView << llendl; + gToolBarView = LLUICtrlFactory::getInstance()->createFromFile<LLToolBarView>("panel_toolbar_view.xml", panel_holder, LLPanel::child_registry_t::instance()); // Attach it to the toolbar view holder - panel_holder->addChild(gToolBarView); + //panel_holder->addChild(gToolBarView); } // Constrain floaters to inside the menu and status bar regions. diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index a21c988bb8..448f10a93c 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -170,7 +170,8 @@ top="0" left="0" mouse_opaque="false" - tab_stop="false"/> + tab_stop="false"> + </panel> </layout_panel> </layout_stack> <panel mouse_opaque="false" diff --git a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml index b58f8e837a..33a19bcdb0 100644 --- a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml +++ b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<ui_ctrl +<toolbar_view follows="all" layout="topleft" name="toolbar view" @@ -16,7 +16,6 @@ width="30" left="0" top="0" - button_display_mode="icons_only" side="left" visible="true" /> <toolbar @@ -27,7 +26,6 @@ width="964" left="30" top="470" - button_display_mode="icons_with_text" side="bottom" visible="true" /> <toolbar @@ -38,18 +36,20 @@ width="30" left="994" top="0" - button_display_mode="icons_only" side="right" visible="true" /> - <button - follows="none" - name="test" + <panel + follows="right|bottom|left" layout="topleft" - top="100" - left="100" - height="28" - width="28" - image_selected="eye_button_active.tga" - image_unselected="eye_button_inactive.tga" + name="sizer_left" + height="500" + width="30" + left="0" + top="0" + background_opaque="false" + border_visible="false" + background_visible="true" + bg_opaque_image="Toast_Over" + bg_alpha_image="Toast_Background" visible="true" /> -</ui_ctrl> +</toolbar_view> |