summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/CMakeLists.txt68
-rw-r--r--indra/llui/lldockablefloater.h3
-rw-r--r--indra/llui/llscrolllistcell.cpp72
-rw-r--r--indra/llui/llscrolllistcell.h22
4 files changed, 114 insertions, 51 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt
index e0579352d3..9108c6143c 100644
--- a/indra/llui/CMakeLists.txt
+++ b/indra/llui/CMakeLists.txt
@@ -6,33 +6,9 @@ include(00-Common)
include(Hunspell)
include(LLCommon)
include(LLImage)
-include(LLInventory)
-include(LLMath)
-include(LLMessage)
include(LLCoreHttp)
-include(LLRender)
include(LLWindow)
include(LLCoreHttp)
-include(LLFileSystem)
-include(LLXML)
-
-include_directories(
- ${LLCOMMON_INCLUDE_DIRS}
- ${LLCOREHTTP_INCLUDE_DIRS}
- ${LLIMAGE_INCLUDE_DIRS}
- ${LLINVENTORY_INCLUDE_DIRS}
- ${LLMATH_INCLUDE_DIRS}
- ${LLMESSAGE_INCLUDE_DIRS}
- ${LLRENDER_INCLUDE_DIRS}
- ${LLWINDOW_INCLUDE_DIRS}
- ${LLFILESYSTEM_INCLUDE_DIRS}
- ${LLXML_INCLUDE_DIRS}
- ${LIBS_PREBUILD_DIR}/include/hunspell
- )
-include_directories(SYSTEM
- ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
- ${LLXML_SYSTEM_INCLUDE_DIRS}
- )
set(llui_SOURCE_FILES
llaccordionctrl.cpp
@@ -260,9 +236,6 @@ set(llui_HEADER_FILES
llxyvector.h
)
-set_source_files_properties(${llui_HEADER_FILES}
- PROPERTIES HEADER_FILE_ONLY TRUE)
-
SET(llurlentry_TEST_DEPENDENCIES
llurlmatch.cpp
llurlregistry.cpp
@@ -276,42 +249,37 @@ set_source_files_properties(llurlentry.cpp
list(APPEND llui_SOURCE_FILES ${llui_HEADER_FILES})
add_library (llui ${llui_SOURCE_FILES})
+target_include_directories( llui INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
# Libraries on which this library depends, needed for Linux builds
# Sort by high-level to low-level
target_link_libraries(llui
- ${LLRENDER_LIBRARIES}
- ${LLWINDOW_LIBRARIES}
- ${LLIMAGE_LIBRARIES}
- ${LLINVENTORY_LIBRARIES}
- ${LLMESSAGE_LIBRARIES}
- ${LLCOREHTTP_LIBRARIES}
- ${LLFILESYSTEM_LIBRARIES}
- ${LLXUIXML_LIBRARIES}
- ${LLXML_LIBRARIES}
- ${LLMATH_LIBRARIES}
- ${HUNSPELL_LIBRARY}
- ${LLMESSAGE_LIBRARIES}
- ${LLCOMMON_LIBRARIES} # must be after llimage, llwindow, llrender
+ llrender
+ llwindow
+ llimage
+ llinventory
+ llmessage
+ llcorehttp
+ llfilesystem
+ llxml
+ llmath
+ ll::hunspell
+ llcommon
)
# Add tests
if(LL_TESTS)
include(LLAddBuildTest)
+ set(test_libs llmessage llcorehttp llxml llrender llcommon ll::hunspell)
+
SET(llui_TEST_SOURCE_FILES
llurlmatch.cpp
)
+ set_property( SOURCE ${llui_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_LIBRARIES ${test_libs})
LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}")
# INTEGRATION TESTS
- set(test_libs llui llmessage llcorehttp llcommon
- ${HUNSPELL_LIBRARY}
- ${LLCOMMON_LIBRARIES}
- ${BOOST_FIBER_LIBRARY} ${BOOST_CONTEXT_LIBRARY} ${BOOST_SYSTEM_LIBRARY}
- ${WINDOWS_LIBRARIES})
+
if(NOT LINUX)
- if(WINDOWS)
- LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "imm32;${test_libs}")
- else(WINDOWS)
- LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}")
- endif(WINDOWS)
+ set(test_libs llui llmessage llcorehttp llxml llrender llcommon ll::hunspell )
+ LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}")
endif(NOT LINUX)
endif(LL_TESTS)
diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h
index 89c9852f4a..5d90b3ef4e 100644
--- a/indra/llui/lldockablefloater.h
+++ b/indra/llui/lldockablefloater.h
@@ -30,6 +30,7 @@
#include "llerror.h"
#include "llfloater.h"
#include "lldockcontrol.h"
+#include <memory>
/**
* Represents floater that can dock.
@@ -131,7 +132,7 @@ protected:
boost::function<BOOL ()> mIsDockedStateForcedCallback;
private:
- std::auto_ptr<LLDockControl> mDockControl;
+ std::unique_ptr<LLDockControl> mDockControl;
LLUIImagePtr mDockTongue;
static LLHandle<LLFloater> sInstanceHandle;
/**
diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp
index 8dd552d2ad..f73c9aa539 100644
--- a/indra/llui/llscrolllistcell.cpp
+++ b/indra/llui/llscrolllistcell.cpp
@@ -54,6 +54,10 @@ LLScrollListCell* LLScrollListCell::create(const LLScrollListCell::Params& cell_
{
cell = new LLScrollListIconText(cell_p);
}
+ else if (cell_p.type() == "bar")
+ {
+ cell = new LLScrollListBar(cell_p);
+ }
else // default is "text"
{
cell = new LLScrollListText(cell_p);
@@ -174,6 +178,74 @@ void LLScrollListIcon::draw(const LLColor4& color, const LLColor4& highlight_col
}
//
+// LLScrollListBar
+//
+LLScrollListBar::LLScrollListBar(const LLScrollListCell::Params& p)
+ : LLScrollListCell(p),
+ mRatio(0),
+ mColor(p.color),
+ mBottom(1),
+ mLeftPad(1),
+ mRightPad(1)
+{}
+
+LLScrollListBar::~LLScrollListBar()
+{
+}
+
+/*virtual*/
+S32 LLScrollListBar::getHeight() const
+{
+ return LLScrollListCell::getHeight();
+}
+
+/*virtual*/
+const LLSD LLScrollListBar::getValue() const
+{
+ return LLStringUtil::null;
+}
+
+void LLScrollListBar::setValue(const LLSD& value)
+{
+ if (value.has("ratio"))
+ {
+ mRatio = value["ratio"].asReal();
+ }
+ if (value.has("bottom"))
+ {
+ mBottom = value["bottom"].asInteger();
+ }
+ if (value.has("left_pad"))
+ {
+ mLeftPad = value["left_pad"].asInteger();
+ }
+ if (value.has("right_pad"))
+ {
+ mRightPad = value["right_pad"].asInteger();
+ }
+}
+
+void LLScrollListBar::setColor(const LLColor4& color)
+{
+ mColor = color;
+}
+
+S32 LLScrollListBar::getWidth() const
+{
+ return LLScrollListCell::getWidth();
+}
+
+
+void LLScrollListBar::draw(const LLColor4& color, const LLColor4& highlight_color) const
+{
+ S32 bar_width = getWidth() - mLeftPad - mRightPad;
+ S32 left = bar_width - bar_width * mRatio;
+ left = llclamp(left, mLeftPad, getWidth() - mRightPad - 1);
+
+ gl_rect_2d(left, mBottom, getWidth() - mRightPad, mBottom - 1, mColor);
+}
+
+//
// LLScrollListText
//
U32 LLScrollListText::sCount = 0;
diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h
index ede8d847d9..2588da2331 100644
--- a/indra/llui/llscrolllistcell.h
+++ b/indra/llui/llscrolllistcell.h
@@ -33,6 +33,7 @@
#include "lluistring.h"
#include "v4color.h"
#include "llui.h"
+#include "llgltexture.h"
class LLCheckBoxCtrl;
class LLSD;
@@ -159,6 +160,7 @@ public:
void setText(const LLStringExplicit& text);
void setFontStyle(const U8 font_style);
+ void setAlignment(LLFontGL::HAlign align) { mFontAlignment = align; }
protected:
LLUIString mText;
@@ -199,6 +201,26 @@ private:
LLFontGL::HAlign mAlignment;
};
+
+class LLScrollListBar : public LLScrollListCell
+{
+public:
+ LLScrollListBar(const LLScrollListCell::Params& p);
+ /*virtual*/ ~LLScrollListBar();
+ /*virtual*/ void draw(const LLColor4& color, const LLColor4& highlight_color) const;
+ /*virtual*/ S32 getWidth() const;
+ /*virtual*/ S32 getHeight() const;
+ /*virtual*/ const LLSD getValue() const;
+ /*virtual*/ void setColor(const LLColor4&);
+ /*virtual*/ void setValue(const LLSD& value);
+
+private:
+ LLColor4 mColor;
+ F32 mRatio;
+ S32 mBottom;
+ S32 mRightPad;
+ S32 mLeftPad;
+};
/*
* An interactive cell containing a check box.
*/