@@ -55,9 +55,10 @@ class LLAccordionCtrlTab::LLAccordionCtrlTabHeader : public LLUICtrl
5555public:
5656 friend class LLUICtrlFactory ;
5757
58- struct Params : public LLInitParam ::Block<Params, LLAccordionCtrlTab::Params>
58+ struct Params : public LLAccordionCtrlTab ::Params // LLInitParam::Block<Params, LLAccordionCtrlTab::Params>
5959 {
6060 Params ();
61+ Params (const LLAccordionCtrlTab::Params& p) : LLAccordionCtrlTab::Params(p) {}
6162 };
6263
6364 LLAccordionCtrlTabHeader (const LLAccordionCtrlTabHeader::Params& p);
@@ -357,7 +358,7 @@ LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p)
357358 mWasStateStored = false ;
358359
359360 mDropdownBGColor = LLColor4::white;
360- LLAccordionCtrlTabHeader::Params headerParams;
361+ LLAccordionCtrlTabHeader::Params headerParams (p) ;
361362 headerParams.name (DD_HEADER_NAME);
362363 headerParams.title (p.title );
363364 mHeader = LLUICtrlFactory::create<LLAccordionCtrlTabHeader>(headerParams);
@@ -1051,150 +1052,226 @@ BOOL LLAccordionCtrlTab::handleScrollWheel ( S32 x, S32 y, S32 clicks )
10511052LLView* LLAccordionCtrlTab::fromXML (LLXMLNodePtr node, LLView* parent, LLUICtrlFactory* factory)
10521053{
10531054 Params p;
1055+ // Singu TODO: Widgets folder for defaults instead of shoving into params here where noted
10541056 if (node->hasAttribute (" title" ))
10551057 {
10561058 std::string title;
10571059 node->getAttributeString (" title" , title);
10581060 p.title (title);
10591061 }
1062+
10601063 if (node->hasAttribute (" expanded" ))
10611064 {
10621065 bool display_children;
10631066 node->getAttribute_bool (" expanded" , display_children);
10641067 p.display_children (display_children);
10651068 }
1069+
10661070 if (node->hasAttribute (" header_height" ))
10671071 {
10681072 S32 header_height;
10691073 node->getAttributeS32 (" header_height" , header_height);
10701074 p.header_height (header_height);
10711075 }
1076+
10721077 if (node->hasAttribute (" min_width" ))
10731078 {
10741079 S32 min_width;
10751080 node->getAttributeS32 (" min_width" , min_width);
10761081 p.min_width (min_width);
10771082 }
1083+
10781084 if (node->hasAttribute (" min_width" ))
10791085 {
10801086 S32 min_height;
10811087 node->getAttributeS32 (" min_height" , min_height);
10821088 p.min_height (min_height);
10831089 }
1090+
10841091 if (node->hasAttribute (" collapsible" ))
10851092 {
10861093 bool collapsible;
10871094 node->getAttribute_bool (" collapsible" , collapsible);
10881095 p.collapsible (collapsible);
10891096 }
1097+
10901098 if (node->hasAttribute (" header_bg_color" ))
10911099 {
10921100 LLColor4 color;
10931101 node->getAttributeColor (" header_bg_color" , color);
10941102 p.header_bg_color (color);
10951103 }
1104+ else // widget
1105+ {
1106+ p.header_bg_color (LLUI::sColorsGroup ->getColor (" ButtonUnselectedBgColor" )); // was DkGray2
1107+ }
1108+
10961109 if (node->hasAttribute (" dropdown_bg_color" ))
10971110 {
10981111 LLColor4 color;
10991112 node->getAttributeColor (" dropdown_bg_color" , color);
11001113 p.dropdown_bg_color (color);
11011114 }
1115+
11021116 if (node->hasAttribute (" header_visible" ))
11031117 {
11041118 bool header_visible;
11051119 node->getAttribute_bool (" header_visible" , header_visible);
11061120 p.header_visible (header_visible);
11071121 }
1122+
11081123 if (node->hasAttribute (" padding_left" ))
11091124 {
11101125 S32 padding_left;
11111126 node->getAttributeS32 (" padding_left" , padding_left);
11121127 p.padding_left (padding_left);
11131128 }
1129+
11141130 if (node->hasAttribute (" padding_right" ))
11151131 {
11161132 S32 padding_right;
11171133 node->getAttributeS32 (" padding_right" , padding_right);
11181134 p.padding_right (padding_right);
11191135 }
1136+
11201137 if (node->hasAttribute (" padding_top" ))
11211138 {
11221139 S32 padding_top;
11231140 node->getAttributeS32 (" padding_top" , padding_top);
11241141 p.padding_top (padding_top);
11251142 }
1143+
11261144 if (node->hasAttribute (" padding_bottom" ))
11271145 {
11281146 S32 padding_bottom;
11291147 node->getAttributeS32 (" padding_bottom" , padding_bottom);
11301148 p.padding_bottom (padding_bottom);
11311149 }
1150+
11321151 if (node->hasAttribute (" header_expand_img" ))
11331152 {
11341153 std::string image;
11351154 node->getAttributeString (" header_expand_img" , image);
1136- p.header_expand_img (LLUI::getUIImage (image));
1155+ p.header_expand_img .name (image);
1156+ }
1157+ else // widget
1158+ {
1159+ p.header_expand_img .name (" Accordion_ArrowOpened_Off" );
11371160 }
1161+
11381162 if (node->hasAttribute (" header_expand_img_pressed" ))
11391163 {
11401164 std::string image;
11411165 node->getAttributeString (" header_expand_img_pressed" , image);
1142- p.header_expand_img_pressed (LLUI::getUIImage (image));
1166+ p.header_expand_img_pressed .name (image);
1167+ }
1168+ else // widget
1169+ {
1170+ p.header_expand_img_pressed .name (" Accordion_ArrowOpened_Press" );
11431171 }
1172+
11441173 if (node->hasAttribute (" header_collapse_img" ))
11451174 {
11461175 std::string image;
11471176 node->getAttributeString (" header_collapse_img" , image);
1148- p.header_collapse_img (LLUI::getUIImage (image));
1177+ p.header_collapse_img .name (image);
1178+ }
1179+ else // widget
1180+ {
1181+ p.header_collapse_img .name (" Accordion_ArrowClosed_Off" );
11491182 }
1183+
11501184 if (node->hasAttribute (" header_collapse_img_pressed" ))
11511185 {
11521186 std::string image;
11531187 node->getAttributeString (" header_collapse_img_pressed" , image);
1154- p.header_collapse_img_pressed ( LLUI::getUIImage ( image) );
1188+ p.header_collapse_img_pressed . name ( image);
11551189 }
1190+ else // widget
1191+ {
1192+ p.header_collapse_img_pressed .name (" Accordion_ArrowClosed_Press" );
1193+ }
1194+
11561195 if (node->hasAttribute (" header_image" ))
11571196 {
11581197 std::string image;
11591198 node->getAttributeString (" header_image" , image);
1160- p.header_image (LLUI::getUIImage (image));
1199+ p.header_image .name (image);
1200+ }
1201+ else // widget
1202+ {
1203+ p.header_image .name (" Accordion_Off" );
11611204 }
1205+
11621206 if (node->hasAttribute (" header_image_over" ))
11631207 {
11641208 std::string image;
11651209 node->getAttributeString (" header_image_over" , image);
1166- p.header_image_over (LLUI::getUIImage (image));
1210+ p.header_image_over .name (image);
1211+ }
1212+ else // widget
1213+ {
1214+ p.header_image_over .name (" Accordion_Over" );
11671215 }
1216+
11681217 if (node->hasAttribute (" header_image_pressed" ))
11691218 {
11701219 std::string image;
11711220 node->getAttributeString (" header_image_pressed" , image);
1172- p.header_image_pressed (LLUI::getUIImage (image));
1221+ p.header_image_pressed .name (image);
1222+ }
1223+ else // widget
1224+ {
1225+ p.header_image_pressed .name (" Accordion_Press" );
11731226 }
1227+
11741228 if (node->hasAttribute (" header_image_focused" ))
11751229 {
11761230 std::string image;
11771231 node->getAttributeString (" header_image_focused" , image);
1178- p.header_image_focused (LLUI::getUIImage (image));
1232+ p.header_image_focused .name (image);
1233+ }
1234+ else // widget
1235+ {
1236+ p.header_image_focused .name (" Accordion_Selected" );
11791237 }
1238+
11801239 if (node->hasAttribute (" header_text_color" ))
11811240 {
11821241 LLColor4 color;
11831242 node->getAttributeColor (" header_text_color" , color);
11841243 p.header_text_color (color);
11851244 }
1245+ else // widget
1246+ {
1247+ p.header_text_color (LLUI::sColorsGroup ->getColor (" ButtonLabelColor" )); // AccordionHeaderTextColor
1248+ }
1249+
11861250 if (node->hasAttribute (" fit_panel" ))
11871251 {
11881252 bool fit_panel;
11891253 node->getAttribute_bool (" fit_panel" , fit_panel);
11901254 p.fit_panel (fit_panel);
11911255 }
1256+
11921257 if (node->hasAttribute (" selection_enabled" ))
11931258 {
11941259 bool selection_enabled;
11951260 node->getAttribute_bool (" selection_enabled" , selection_enabled);
11961261 p.selection_enabled (selection_enabled);
11971262 }
1263+
1264+ if (node->hasAttribute (" font" ))
1265+ {
1266+ std::string font;
1267+ node->getAttributeString (" font" , font);
1268+ p.font .name (font);
1269+ }
1270+ else // widget
1271+ {
1272+ p.font .name (" SansSerif" );
1273+ }
1274+
11981275 LLAccordionCtrlTab* ctrl = new LLAccordionCtrlTab (p);
11991276 ctrl->initFromXML (node, parent);
12001277 return ctrl;
0 commit comments