Пример #1
0
void clAuiGlossyTabArt::DoSetColours()
{
    // Set the colours
    // based on the selected book theme
    DoInitializeColoursFromTheme();
    m_activeTabTextColour = *wxBLACK;
    m_tabTextColour = m_activeTabTextColour.ChangeLightness(120);
#ifdef __WXOSX__
    // use a bit darker colour on OSX
    m_tabBgColour = m_tabBgColour.ChangeLightness(90);
    m_innerPenColour = m_tabBgColour.ChangeLightness(110);
    m_penColour = m_innerPenColour.ChangeLightness(90);
#else
    m_tabBgColour = m_tabBgColour.ChangeLightness(120);
    m_penColour = m_innerPenColour.ChangeLightness(90);
#endif
    
            
    // And finally let the plugins override the colours
    clColourEvent tabColourEvent(wxEVT_COLOUR_TAB);
    if(EventNotifier::Get()->ProcessEvent(tabColourEvent)) {
        m_activeTabBgColour = tabColourEvent.GetBgColour();
        m_activeTabTextColour = tabColourEvent.GetFgColour();
        m_tabTextColour = tabColourEvent.GetFgColour();
        m_tabBgColour = m_activeTabBgColour.ChangeLightness(120);
    }

    clColourEvent tabPenColour(wxEVT_GET_TAB_BORDER_COLOUR);
    if(EventNotifier::Get()->ProcessEvent(tabPenColour)) {
        m_activeTabPenColour = tabPenColour.GetBorderColour();
        m_penColour = m_activeTabPenColour.ChangeLightness(120);
        m_innerPenColour = m_activeTabPenColour.ChangeLightness(150);
    }
}
Пример #2
0
void clAuiMainNotebookTabArt::DoSetColours()
{
    // Set the colours
    // based on the selected book theme
    if(!m_bgColour.IsOk()) {
        DoInitializeColoursFromTheme();
    }

    // If we have an active editor, update the colours, if not - keep the old ones
    IEditor* editor = m_manager->GetActiveEditor();

    // We use the colour theme based on the active editor
    if(editor) {
        // Change lightness ranges between 0-200
        // 0 would be completely black, 200 completely white an ialpha of 100 returns the same colour.
        m_activeTabBgColour = editor->GetSTC()->StyleGetBackground(0);
        if(DrawingUtils::IsDark(m_activeTabBgColour)) {
            // adjust some colours
            m_activeTabTextColour = *wxWHITE;
            m_tabTextColour = *wxWHITE;
            m_activeTabPenColour = m_activeTabBgColour.ChangeLightness(80);
            m_tabBgColour = m_activeTabBgColour.ChangeLightness(110);
#ifdef __WXMAC__
            m_bgColour = m_activeTabBgColour.ChangeLightness(150);
#else
            m_bgColour = m_activeTabBgColour.ChangeLightness(130);
#endif
            m_penColour = m_activeTabPenColour.ChangeLightness(110);
            m_innerPenColour = m_penColour.ChangeLightness(115);

        } else {
            wxColour tmp = m_activeTabBgColour;
            DoInitializeColoursFromTheme();
            m_activeTabBgColour = tmp;
        }
    }
}
void clAuiMainNotebookTabArt::DoSetColours()
{
    // Set the colours
    // based on the selected book theme
    if(!m_bgColour.IsOk()) {
        DoInitializeColoursFromTheme();
    }

    // If we have an active editor, update the colours, if not - keep the old ones
    IEditor* editor = m_manager->GetActiveEditor();
    SetLightColours();

    // We use the colour theme based on the active editor
    if(editor) {
        // Change lightness ranges between 0-200
        // 0 would be completely black, 200 completely white an ialpha of 100 returns the same colour.
        m_activeTabBgColour = editor->GetCtrl()->StyleGetBackground(0);
        if(DrawingUtils::IsDark(m_activeTabBgColour)) {
            SetDarkColours();
        }
    }
}
void clAuiMainNotebookTabArt::DoSetColours()
{
    // Set the colours
    // based on the selected book theme
    if(!m_bgColour.IsOk()) {
        DoInitializeColoursFromTheme();
    }

    // If we have an active editor, update the colours, if not - keep the old ones
    IEditor* editor = m_manager->GetActiveEditor();

    // Default buttons
    m_bmpClose = wxXmlResource::Get()->LoadBitmap("tab_x_close");
    m_bmpCloseHover = wxXmlResource::Get()->LoadBitmap("tab_x_close_hover");
    m_bmpClosePressed = wxXmlResource::Get()->LoadBitmap("tab_x_close_pressed");

    // We use the colour theme based on the active editor
    if(editor) {
        // Change lightness ranges between 0-200
        // 0 would be completely black, 200 completely white an ialpha of 100 returns the same colour.
        m_activeTabBgColour = editor->GetCtrl()->StyleGetBackground(0);
        if(DrawingUtils::IsDark(m_activeTabBgColour)) {

            // Adjust the button colours
            m_bmpClose = wxXmlResource::Get()->LoadBitmap("tab_x_close_dark");
            m_bmpCloseHover = wxXmlResource::Get()->LoadBitmap("tab_x_close_dark_hover");
            m_bmpClosePressed = wxXmlResource::Get()->LoadBitmap("tab_x_close_dark_pressed");

            // adjust some colours
            m_activeTabTextColour = *wxWHITE;
            m_tabTextColour = m_activeTabTextColour.ChangeLightness(70);
            m_activeTabPenColour = m_activeTabBgColour.ChangeLightness(80);
            m_tabBgColour = m_activeTabBgColour.ChangeLightness(110);
#ifdef __WXMAC__
            m_bgColour = m_activeTabBgColour.ChangeLightness(150);
#else
            m_bgColour = m_activeTabBgColour.ChangeLightness(130);
#endif
            m_penColour = m_activeTabPenColour.ChangeLightness(110);
            m_innerPenColour = m_penColour.ChangeLightness(115);

        } else {
            wxColour tmp = m_activeTabBgColour;
            DoInitializeColoursFromTheme();
            m_activeTabBgColour = tmp;
            m_activeTabTextColour = *wxBLACK;
            m_tabTextColour = m_activeTabTextColour.ChangeLightness(130);
#ifdef __WXOSX__
            // use a bit darker colour on OSX
            m_tabBgColour = m_tabBgColour.ChangeLightness(90);
            m_innerPenColour = m_tabBgColour.ChangeLightness(110);
            m_penColour = m_innerPenColour.ChangeLightness(90);
#else
            m_tabBgColour = m_tabBgColour.ChangeLightness(120);
            m_penColour = m_innerPenColour.ChangeLightness(90);
#endif
        }
    } else {
        m_activeTabBgColour = DrawingUtils::GetPanelBgColour();
        m_activeTabTextColour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
    }
}