diff options
Diffstat (limited to 'linden/indra/llui/llviewborder.cpp')
-rw-r--r-- | linden/indra/llui/llviewborder.cpp | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/linden/indra/llui/llviewborder.cpp b/linden/indra/llui/llviewborder.cpp index 6c2d9fa..e8cff7b 100644 --- a/linden/indra/llui/llviewborder.cpp +++ b/linden/indra/llui/llviewborder.cpp | |||
@@ -33,6 +33,8 @@ | |||
33 | #include "llglimmediate.h" | 33 | #include "llglimmediate.h" |
34 | #include "llfocusmgr.h" | 34 | #include "llfocusmgr.h" |
35 | 35 | ||
36 | static LLRegisterWidget<LLViewBorder> r("view_border"); | ||
37 | |||
36 | LLViewBorder::LLViewBorder( const LLString& name, const LLRect& rect, EBevel bevel, EStyle style, S32 width ) | 38 | LLViewBorder::LLViewBorder( const LLString& name, const LLRect& rect, EBevel bevel, EStyle style, S32 width ) |
37 | : | 39 | : |
38 | LLView( name, rect, FALSE ), | 40 | LLView( name, rect, FALSE ), |
@@ -66,47 +68,45 @@ void LLViewBorder::setColorsExtended( const LLColor4& shadow_light, const LLColo | |||
66 | 68 | ||
67 | void LLViewBorder::setTexture( const LLUUID &image_id ) | 69 | void LLViewBorder::setTexture( const LLUUID &image_id ) |
68 | { | 70 | { |
69 | mTexture = LLUI::sImageProvider->getImageByID(image_id); | 71 | mTexture = LLUI::sImageProvider->getUIImageByID(image_id); |
70 | } | 72 | } |
71 | 73 | ||
72 | 74 | ||
73 | void LLViewBorder::draw() | 75 | void LLViewBorder::draw() |
74 | { | 76 | { |
75 | if( getVisible() ) | 77 | if( STYLE_LINE == mStyle ) |
76 | { | 78 | { |
77 | if( STYLE_LINE == mStyle ) | 79 | if( 0 == mBorderWidth ) |
80 | { | ||
81 | // no visible border | ||
82 | } | ||
83 | else | ||
84 | if( 1 == mBorderWidth ) | ||
85 | { | ||
86 | drawOnePixelLines(); | ||
87 | } | ||
88 | else | ||
89 | if( 2 == mBorderWidth ) | ||
78 | { | 90 | { |
79 | if( 0 == mBorderWidth ) | 91 | drawTwoPixelLines(); |
80 | { | ||
81 | // no visible border | ||
82 | } | ||
83 | else | ||
84 | if( 1 == mBorderWidth ) | ||
85 | { | ||
86 | drawOnePixelLines(); | ||
87 | } | ||
88 | else | ||
89 | if( 2 == mBorderWidth ) | ||
90 | { | ||
91 | drawTwoPixelLines(); | ||
92 | } | ||
93 | else | ||
94 | { | ||
95 | llassert( FALSE ); // not implemented | ||
96 | } | ||
97 | } | 92 | } |
98 | else | 93 | else |
99 | if( STYLE_TEXTURE == mStyle ) | ||
100 | { | 94 | { |
101 | if( mTexture ) | 95 | llassert( FALSE ); // not implemented |
102 | { | ||
103 | drawTextures(); | ||
104 | } | ||
105 | } | 96 | } |
97 | } | ||
98 | else | ||
99 | if( STYLE_TEXTURE == mStyle ) | ||
100 | { | ||
101 | if( mTexture ) | ||
102 | { | ||
103 | drawTextures(); | ||
104 | } | ||
105 | } | ||
106 | |||
107 | // draw the children | ||
108 | LLView::draw(); | ||
106 | 109 | ||
107 | // draw the children | ||
108 | LLView::draw(); | ||
109 | } | ||
110 | } | 110 | } |
111 | 111 | ||
112 | void LLViewBorder::drawOnePixelLines() | 112 | void LLViewBorder::drawOnePixelLines() |
@@ -134,11 +134,10 @@ void LLViewBorder::drawOnePixelLines() | |||
134 | 134 | ||
135 | if( mHasKeyboardFocus ) | 135 | if( mHasKeyboardFocus ) |
136 | { | 136 | { |
137 | F32 lerp_amt = gFocusMgr.getFocusFlashAmt(); | ||
138 | top_color = gFocusMgr.getFocusColor(); | 137 | top_color = gFocusMgr.getFocusColor(); |
139 | bottom_color = top_color; | 138 | bottom_color = top_color; |
140 | 139 | ||
141 | LLUI::setLineWidth(lerp(1.f, 3.f, lerp_amt)); | 140 | LLUI::setLineWidth(lerp(1.f, 3.f, gFocusMgr.getFocusFlashAmt())); |
142 | } | 141 | } |
143 | 142 | ||
144 | S32 left = 0; | 143 | S32 left = 0; |
@@ -225,20 +224,20 @@ void LLViewBorder::drawTwoPixelLines() | |||
225 | 224 | ||
226 | void LLViewBorder::drawTextures() | 225 | void LLViewBorder::drawTextures() |
227 | { | 226 | { |
228 | LLGLSUIDefault gls_ui; | 227 | //LLGLSUIDefault gls_ui; |
229 | 228 | ||
230 | llassert( FALSE ); // TODO: finish implementing | 229 | //llassert( FALSE ); // TODO: finish implementing |
231 | 230 | ||
232 | gGL.color4fv(UI_VERTEX_COLOR.mV); | 231 | //gGL.color4fv(UI_VERTEX_COLOR.mV); |
233 | 232 | ||
234 | mTexture->bind(); | 233 | //mTexture->bind(); |
235 | glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); | 234 | //glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); |
236 | glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); | 235 | //glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); |
237 | 236 | ||
238 | drawTextureTrapezoid( 0.f, mBorderWidth, getRect().getWidth(), 0, 0 ); | 237 | //drawTextureTrapezoid( 0.f, mBorderWidth, getRect().getWidth(), 0, 0 ); |
239 | drawTextureTrapezoid( 90.f, mBorderWidth, getRect().getHeight(), (F32)getRect().getWidth(),0 ); | 238 | //drawTextureTrapezoid( 90.f, mBorderWidth, getRect().getHeight(), (F32)getRect().getWidth(),0 ); |
240 | drawTextureTrapezoid( 180.f, mBorderWidth, getRect().getWidth(), (F32)getRect().getWidth(),(F32)getRect().getHeight() ); | 239 | //drawTextureTrapezoid( 180.f, mBorderWidth, getRect().getWidth(), (F32)getRect().getWidth(),(F32)getRect().getHeight() ); |
241 | drawTextureTrapezoid( 270.f, mBorderWidth, getRect().getHeight(), 0, (F32)getRect().getHeight() ); | 240 | //drawTextureTrapezoid( 270.f, mBorderWidth, getRect().getHeight(), 0, (F32)getRect().getHeight() ); |
242 | } | 241 | } |
243 | 242 | ||
244 | 243 | ||