diff options
author | James Cook <james@lindenlab.com> | 2009-10-13 23:50:09 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-10-13 23:50:09 +0000 |
commit | 15218864c31b991842700ed5584fc495117f7527 (patch) | |
tree | e7ebe71384fd91b08bfbc177c818bbf9c1e0e358 /indra/llui | |
parent | d5e687baa30eec64430878cf947537780d78ee48 (diff) |
EXT-1351 DEV-38496 Add "show rectangles" check to UI Preview Tool, which draws outlines of widgets and makes tooltips show their names and sizes. Used for localization to catch string truncations and fix them. Reviewed with Leyla.
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llview.cpp | 15 | ||||
-rw-r--r-- | indra/llui/llview.h | 16 |
2 files changed, 19 insertions, 12 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 1df8838738..7db6eab9ad 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -57,14 +57,13 @@ #include "lltexteditor.h" #include "lltextbox.h" -BOOL LLView::sDebugRects = FALSE; -BOOL LLView::sDebugKeys = FALSE; S32 LLView::sDepth = 0; -BOOL LLView::sDebugMouseHandling = FALSE; +bool LLView::sDebugRects = false; +bool LLView::sDebugRectsShowNames = true; +bool LLView::sDebugKeys = false; +bool LLView::sDebugMouseHandling = false; std::string LLView::sMouseHandlerMessage; -//BOOL LLView::sEditingUI = FALSE; BOOL LLView::sForceReshape = FALSE; -//LLView* LLView::sEditingUIView = NULL; std::set<LLView*> LLView::sPreviewHighlightedElements; BOOL LLView::sHighlightingDiffs = FALSE; LLView* LLView::sPreviewClickedElement = NULL; @@ -1353,7 +1352,7 @@ void LLView::drawDebugRect() LLRect debug_rect = mUseBoundingRect ? mBoundingRect : mRect; // draw red rectangle for the border - LLColor4 border_color(0.f, 0.f, 0.f, 1.f); + LLColor4 border_color(0.25f, 0.25f, 0.25f, 1.f); if(preview_iter != sPreviewHighlightedElements.end()) { if(LLView::sPreviewClickedElement && this == sPreviewClickedElement) @@ -1388,7 +1387,9 @@ void LLView::drawDebugRect() gGL.end(); // Draw the name if it's not a leaf node or not in editing or preview mode - if (mChildList.size() && preview_iter == sPreviewHighlightedElements.end()) + if (mChildList.size() + && preview_iter == sPreviewHighlightedElements.end() + && sDebugRectsShowNames) { //char temp[256]; S32 x, y; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 7ddff2bd9e..5e35068733 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -586,14 +586,20 @@ private: default_widget_map_t& getDefaultWidgetMap() const; public: - static BOOL sDebugRects; // Draw debug rects behind everything. - static BOOL sDebugKeys; + // Depth in view hierarchy during rendering static S32 sDepth; - static BOOL sDebugMouseHandling; + + // Draw debug rectangles around widgets to help with alignment and spacing + static bool sDebugRects; + + // Draw widget names and sizes when drawing debug rectangles, turning this + // off is useful to make the rectangles themselves easier to see. + static bool sDebugRectsShowNames; + + static bool sDebugKeys; + static bool sDebugMouseHandling; static std::string sMouseHandlerMessage; static S32 sSelectID; -// static BOOL sEditingUI; -// static LLView* sEditingUIView; static std::set<LLView*> sPreviewHighlightedElements; // DEV-16869 static BOOL sHighlightingDiffs; // DEV-16869 static LLView* sPreviewClickedElement; // DEV-16869 |