| 143 | } |
| 144 | |
| 145 | void iosKeyboardApp::drawTextView( const TextView &textView ) |
| 146 | { |
| 147 | gl::color( Color( "PowderBlue" ) ); |
| 148 | gl::drawSolidRect( textView.mBounds ); |
| 149 | |
| 150 | Color borderColor = textView.mIsSelected ? Color( "DodgerBlue" ) : Color( "DarkGray" ); |
| 151 | gl::color( borderColor ); |
| 152 | gl::drawStrokedRect( textView.mBounds ); |
| 153 | |
| 154 | Rectf fitRect = textView.getTextBounds(); |
| 155 | vec2 offset( 0.0f, mFont.getAscent() ); |
| 156 | |
| 157 | TextBox tbox = TextBox().font( mFont ).size( fitRect.getWidth(), fitRect.getHeight() ).premultiplied(); |
| 158 | |
| 159 | if( textView.mText.empty() && ! textView.mIsSelected ) { |
| 160 | tbox.color( Color::gray( 0.6f ) ).text( textView.mPlacerholderText ); |
| 161 | } |
| 162 | else { |
| 163 | tbox.color( Color( "FireBrick" ) ).text( textView.mText ); |
| 164 | } |
| 165 | gl::color( Color::white() ); |
| 166 | |
| 167 | auto tex = gl::Texture::create( tbox.render() ); |
| 168 | gl::draw( tex, fitRect.getUpperLeft() ); |
| 169 | } |
| 170 | |
| 171 | void iosKeyboardApp::layoutTextViews() |
| 172 | { |
nothing calls this directly
no test coverage detected