Пример #1
0
void Tweaks::OnColourTab(clColourEvent& e)
{
    TWEAKS_ENABLED_EVENT_HANDLER();

    IEditor* editor = FindEditorByPage(e.GetPage());
    if(!editor) {
        if(m_settings.GetGlobalFgColour().IsOk() && m_settings.GetGlobalBgColour().IsOk()) {
            // Non editor tab
            e.SetBgColour(m_settings.GetGlobalBgColour());
            e.SetFgColour(m_settings.GetGlobalFgColour());

        } else {
            e.Skip();
        }

    } else {

        const ProjectTweaks& tw = m_settings.GetProjectTweaks(editor->GetProjectName());
        if(tw.IsOk()) {
            e.SetBgColour(tw.GetTabBgColour());
            e.SetFgColour(tw.GetTabFgColour());

        } else if(m_settings.GetGlobalBgColour().IsOk() && m_settings.GetGlobalFgColour().IsOk()) {
            e.SetBgColour(m_settings.GetGlobalBgColour());
            e.SetFgColour(m_settings.GetGlobalFgColour());

        } else {
            e.Skip();
        }
    }
}
Пример #2
0
void Tweaks::OnColourTab(clColourEvent& e)
{
#ifdef __WXGTK__
#if CL_USE_NATIVEBOOK
    // Not supported with native notebooks
    e.Skip();
    return;
#endif
#endif

    TWEAKS_ENABLED_EVENT_HANDLER();
    
    IEditor* editor = FindEditorByPage( e.GetPage() );
    if ( !editor ) {
        
        if ( m_settings.GetGlobalFgColour().IsOk() && m_settings.GetGlobalBgColour().IsOk() ) {
            // Non editor tab
            e.SetBgColour( e.IsActiveTab() ? EditorConfigST::Get()->GetCurrentOutputviewBgColour() : m_settings.GetGlobalBgColour() );
            e.SetFgColour( e.IsActiveTab() ? EditorConfigST::Get()->GetCurrentOutputviewFgColour() : m_settings.GetGlobalFgColour() );
            
        } else {
            e.Skip();
        }
    
    } else {
        
        const ProjectTweaks& tw = m_settings.GetProjectTweaks( editor->GetProjectName() );
        if ( tw.IsOk() ) {
            e.SetBgColour( e.IsActiveTab() ? EditorConfigST::Get()->GetCurrentOutputviewBgColour() : tw.GetTabBgColour() );
            e.SetFgColour( e.IsActiveTab() ? EditorConfigST::Get()->GetCurrentOutputviewFgColour() : tw.GetTabFgColour() );
            
        } else if ( m_settings.GetGlobalBgColour().IsOk() && m_settings.GetGlobalFgColour().IsOk() ) {
            e.SetBgColour( e.IsActiveTab() ? EditorConfigST::Get()->GetCurrentOutputviewBgColour() : m_settings.GetGlobalBgColour() );
            e.SetFgColour( e.IsActiveTab() ? EditorConfigST::Get()->GetCurrentOutputviewFgColour() : m_settings.GetGlobalFgColour() );
            
        } else {
            e.Skip();
        }
    
    }
}