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(); } } }
void Tweaks::OnTabBorderColour(clColourEvent& e) { #ifdef __WXGTK__ #if CL_USE_NATIVEBOOK // Not supported with native notebooks e.Skip(); return; #endif #endif TWEAKS_ENABLED_EVENT_HANDLER(); if ( m_settings.IsEnableTweaks() && m_settings.GetGlobalBgColour().IsOk() ) { e.SetBorderColour( DrawingUtils::DarkColour(m_settings.GetGlobalBgColour(), 1.5) ); } else { e.Skip(); } }
void Tweaks::OnCustomizeProject(clColourEvent& e) { TWEAKS_ENABLED_EVENT_HANDLER(); if ( m_project2Icon.count(e.GetString()) ) { // We got a new icon for this project! e.SetInt( m_project2Icon.find(e.GetString())->second ); } else { e.Skip(); } }
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(); } } }