Changeset 492 for trunk/src/gui


Ignore:
Timestamp:
05/05/16 19:37:28 (9 years ago)
Author:
epyon
Message:
 
Location:
trunk/src/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/gui_environment.cc

    r444 r492  
    182182                {
    183183                        handle h = get_element( position( ev.mbutton.x, ev.mbutton.y ) );
     184                        element* e = m_elements.get( h );
     185                        if ( e->m_on_click ) e->m_on_click();
     186
    184187                        set_selected( h );
    185188                        return true;
     
    312315}
    313316
     317void nv::gui::environment::set_on_click( handle e, const function< void() >& on_click )
     318{
     319        element* ep = m_elements.get( e );
     320        if ( ep != nullptr )
     321        {
     322                ep->m_on_click = on_click;
     323        }
     324}
     325
    314326void nv::gui::environment::set_text( handle e, const string_twine& text )
    315327{
  • trunk/src/gui/gui_gfx_renderer.cc

    r491 r492  
    249249                const char* stext[] = { "", "selected", "hover" };
    250250                const char* selector = stext[border];
    251                 if ( e->m_flags[HOVER] )    selector = stext[2];
    252                 if ( e->m_flags[SELECTED] ) selector = stext[1];
     251                if ( e->m_flags[HOVER] && e->m_flags[DIRTY_HOVER] )    selector = stext[2];
     252                if ( e->m_flags[SELECTED] && e->m_flags[DIRTY_SELECT] ) selector = stext[1];
    253253
    254254                if ( m_style.get( e, "skin", selector, path ) )
Note: See TracChangeset for help on using the changeset viewer.