#include "../include/xcv_license.h" //PCH namespace Widgets95 {//-. //<-' /************************************ WIDGETS_95_StaticText::update_area() **********/ void ui::titlebar::_update_area() { if(!style()) //TODO: What about text? { int h; if(!_name.empty()&&_font) { //TODO: Vertical center? //NOTE: The general goal here is 6px on top, 6px below. //Or, to match place(top) labels. h = _font.height; h-=3; //ARBITRARY //2020: Why was name_span omitted? _draw uses draw_name //(I want to try & to underscore.) //_w = _x_lr+str_span(_name)+_x_rl; //name_span _w = _x_lr+name_span()+_x_rl; } else { h = ui_separator_drop; _w = 0; } _h = std::max(_h,_y_off_top+h+_y_off_bot); } } /****************************** WIDGETS_95_Separator::draw() **********/ void ui::titlebar::_draw() { if(empty()) return; //TODO: What about text? int x = 0, y = 1; //ARBITRARY if(!_name.empty()&&!style()) //GLUI_Static_Text { return draw_name(_x_lr+x,_y_off_top+y); } int width,_; column_dims(&_,&width); //TODO: Draw bar on either side of name. if(!_name.empty()) //Assuming centered. { draw_name(width/2-_w/2,_y_off_top+y); } if(style()) //GLUI_Separator { //Making this interchangeable with column (a horizontal column.) //int indent = width*0.05f; int indent = _w?std::min(_w,width):width; //int height = ui_separator_drop/2; int height = _h/2; window::draw_etched_bars(indent-1,height-1,width-indent-1,height-1,-2); } } //---. }//<-'