aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llgroupnotify.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llgroupnotify.cpp79
1 files changed, 36 insertions, 43 deletions
diff --git a/linden/indra/newview/llgroupnotify.cpp b/linden/indra/newview/llgroupnotify.cpp
index cae784b..5b6c3ca 100644
--- a/linden/indra/newview/llgroupnotify.cpp
+++ b/linden/indra/newview/llgroupnotify.cpp
@@ -159,18 +159,23 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject,
159 S32 y = TOP; 159 S32 y = TOP;
160 S32 x = HPAD + HPAD; 160 S32 x = HPAD + HPAD;
161 161
162 class NoticeText : public LLTextBox
163 {
164 public:
165 NoticeText(const LLString& name, const LLRect& rect, const LLString& text = LLString::null, const LLFontGL* font = NULL)
166 : LLTextBox(name, rect, text, font)
167 {
168 setHAlign(LLFontGL::RIGHT);
169 setFontStyle(LLFontGL::DROP_SHADOW_SOFT);
170 setBorderVisible(FALSE);
171 setColor( gColors.getColor("GroupNotifyTextColor") );
172 setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
173 }
174 };
175
162 176
163 // Title 177 // Title
164 LLTextBox* line; 178 addChild(new NoticeText("title",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),"Group Notice",LLFontGL::sSansSerifHuge));
165
166 line = new LLTextBox("title",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),"Group Notice",LLFontGL::sSansSerifHuge);
167 line->setHAlign(LLFontGL::RIGHT);
168 line->setFontStyle(LLFontGL::DROP_SHADOW_SOFT);
169 line->setBorderVisible(FALSE);
170 line->setColor(LLColor4::white);
171 line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
172
173 addChild(line);
174 179
175 y -= llfloor(1.5f*LINE_HEIGHT); 180 y -= llfloor(1.5f*LINE_HEIGHT);
176 181
@@ -179,28 +184,25 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject,
179 std::stringstream from; 184 std::stringstream from;
180 from << "Sent by " << from_name << ", " << group_name; 185 from << "Sent by " << from_name << ", " << group_name;
181 186
182 line = new LLTextBox("group",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),from.str().c_str(),LLFontGL::sSansSerif); 187 addChild(new NoticeText("group",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),from.str().c_str(),LLFontGL::sSansSerif));
183 line->setFontStyle(LLFontGL::DROP_SHADOW_SOFT);
184 line->setHAlign(LLFontGL::RIGHT);
185 line->setBorderVisible(FALSE);
186 line->setColor(LLColor4::white);
187 line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
188 addChild(line);
189 188
190 y -= (LINE_HEIGHT + VPAD); 189 y -= (LINE_HEIGHT + VPAD);
190 x = HPAD + HPAD;
191 191
192 LLUUID icon_id(gViewerArt.getString("notify_box_icon.tga"));
193 // TODO: change this to be the group icon. 192 // TODO: change this to be the group icon.
194 if (!group_insignia.isNull()) 193 if (!group_insignia.isNull())
195 { 194 {
196 icon_id = group_insignia; 195 icon = new LLIconCtrl("icon",
196 LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
197 group_insignia);
198 }
199 else
200 {
201 icon = new LLIconCtrl("icon",
202 LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
203 "notify_box_icon.tga");
197 } 204 }
198 205
199 x = HPAD + HPAD;
200
201 icon = new LLIconCtrl("icon",
202 LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
203 icon_id);
204 icon->setMouseOpaque(FALSE); 206 icon->setMouseOpaque(FALSE);
205 addChild(icon); 207 addChild(icon);
206 208
@@ -244,14 +246,9 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject,
244 246
245 if (mHasInventory) 247 if (mHasInventory)
246 { 248 {
247 line = new LLTextBox("subjecttitle",LLRect(x,y,x + LABEL_WIDTH,y - LINE_HEIGHT),"Attached: ",LLFontGL::sSansSerif); 249 addChild(new NoticeText("subjecttitle",LLRect(x,y,x + LABEL_WIDTH,y - LINE_HEIGHT),"Attached: ",LLFontGL::sSansSerif));
248 line->setBorderVisible(FALSE);
249 line->setColor(LLColor4::white);
250 line->setFontStyle(LLFontGL::DROP_SHADOW_SOFT);
251 line->setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
252 addChild(line);
253 250
254 LLViewerImage* item_icon = get_item_icon(mInventoryOffer->mType, 251 LLUIImagePtr item_icon = get_item_icon(mInventoryOffer->mType,
255 LLInventoryType::IT_TEXTURE, 252 LLInventoryType::IT_TEXTURE,
256 0, FALSE); 253 0, FALSE);
257 254
@@ -260,7 +257,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject,
260 257
261 std::stringstream ss; 258 std::stringstream ss;
262 ss << " " << inventory_name; 259 ss << " " << inventory_name;
263 line = new LLTextBox("object_name",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),ss.str().c_str(),LLFontGL::sSansSerif); 260 LLTextBox *line = new LLTextBox("object_name",LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),ss.str().c_str(),LLFontGL::sSansSerif);
264 line->setEnabled(FALSE); 261 line->setEnabled(FALSE);
265 line->setBorderVisible(TRUE); 262 line->setBorderVisible(TRUE);
266 line->setDisabledColor(LLColor4::blue4); 263 line->setDisabledColor(LLColor4::blue4);
@@ -271,21 +268,22 @@ LLGroupNotifyBox::LLGroupNotifyBox(const char* subject,
271 268
272 icon = new LLIconCtrl("icon", 269 icon = new LLIconCtrl("icon",
273 LLRect(x, y, x+16, y-16), 270 LLRect(x, y, x+16, y-16),
274 item_icon->getID()); 271 item_icon->getName());
275 icon->setMouseOpaque(FALSE); 272 icon->setMouseOpaque(FALSE);
276 addChild(icon); 273 addChild(icon);
277 } 274 }
278 275
279 LLButton* btn; 276 LLButton* btn;
280 btn = new LLButton("next", 277 btn = new LLButton("next",
281 LLRect(getRect().getWidth()-24, BOTTOM_PAD+16, getRect().getWidth()-8, BOTTOM_PAD), 278 LLRect(getRect().getWidth()-26, BOTTOM_PAD + 20, getRect().getWidth()-2, BOTTOM_PAD),
282 "notify_next.tga", 279 "notify_next.png",
283 "notify_next.tga", 280 "notify_next.png",
284 "", 281 "",
285 onClickNext, 282 onClickNext,
286 this, 283 this,
287 LLFontGL::sSansSerif); 284 LLFontGL::sSansSerif);
288 btn->setToolTip(LLString("Next")); // *TODO: Translate 285 btn->setToolTip(LLString("Next")); // *TODO: Translate
286 btn->setScaleImage(TRUE);
289 addChild(btn); 287 addChild(btn);
290 mNextBtn = btn; 288 mNextBtn = btn;
291 289
@@ -357,13 +355,8 @@ LLGroupNotifyBox::~LLGroupNotifyBox()
357// virtual 355// virtual
358BOOL LLGroupNotifyBox::handleRightMouseDown(S32 x, S32 y, MASK mask) 356BOOL LLGroupNotifyBox::handleRightMouseDown(S32 x, S32 y, MASK mask)
359{ 357{
360 if (getVisible() && getEnabled() && pointInView(x,y)) 358 moveToBack();
361 { 359 return TRUE;
362 moveToBack();
363 return TRUE;
364 }
365
366 return LLPanel::handleRightMouseDown(x, y, mask);
367} 360}
368 361
369 362