X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c70331e28be93b833dfa4f2594a25841fcb6e20..d07f2e19181bc5caf29eb2338ce513be6fa42405:/src/ribbon/art_msw.cpp diff --git a/src/ribbon/art_msw.cpp b/src/ribbon/art_msw.cpp index eb530dcef3..9318b309c2 100644 --- a/src/ribbon/art_msw.cpp +++ b/src/ribbon/art_msw.cpp @@ -1063,7 +1063,7 @@ void wxRibbonMSWArtProvider::DrawTab( if(tab.rect.height <= 2) return; - if(tab.active || tab.hovered) + if(tab.active || tab.hovered || tab.highlight) { if(tab.active) { @@ -1098,6 +1098,41 @@ void wxRibbonMSWArtProvider::DrawTab( dc.GradientFillLinear(background, m_tab_hover_background_colour, m_tab_hover_background_gradient_colour, wxSOUTH); } + else if(tab.highlight) + { + wxRect background(tab.rect); + + background.x += 2; + background.y += 2; + background.width -= 4; + background.height -= 3; + int h = background.height; + background.height /= 2; + + //For highlight pages we show a colour between the active page and for a hovered page: + wxColour top_colour1((m_tab_active_background_colour.Red() + m_tab_hover_background_top_colour.Red())/2, + (m_tab_active_background_colour.Green() + m_tab_hover_background_top_colour.Green())/2, + (m_tab_active_background_colour.Blue() + m_tab_hover_background_top_colour.Blue())/2); + + wxColour bottom_colour1((m_tab_active_background_gradient_colour.Red() + m_tab_hover_background_top_gradient_colour.Red())/2, + (m_tab_active_background_gradient_colour.Green() + m_tab_hover_background_top_gradient_colour.Green())/2, + (m_tab_active_background_gradient_colour.Blue() + m_tab_hover_background_top_gradient_colour.Blue())/2); + + dc.GradientFillLinear(background, top_colour1, bottom_colour1, wxSOUTH); + + background.y += background.height; + background.height = h - background.height; + + wxColour top_colour2((m_tab_active_background_colour.Red() + m_tab_hover_background_colour.Red())/2, + (m_tab_active_background_colour.Green() + m_tab_hover_background_colour.Green())/2, + (m_tab_active_background_colour.Blue() + m_tab_hover_background_colour.Blue())/2); + + wxColour bottom_colour2((m_tab_active_background_gradient_colour.Red() + m_tab_hover_background_gradient_colour.Red())/2, + (m_tab_active_background_gradient_colour.Green() + m_tab_hover_background_gradient_colour.Green())/2, + (m_tab_active_background_gradient_colour.Blue() + m_tab_hover_background_gradient_colour.Blue())/2); + + dc.GradientFillLinear(background, top_colour2, bottom_colour2, wxSOUTH); + } wxPoint border_points[6]; border_points[0] = wxPoint(1, tab.rect.height - 2); @@ -2854,7 +2889,7 @@ bool wxRibbonMSWArtProvider::GetButtonBarButtonSize( if(wxRibbonCanLabelBreakAtPosition(label, i)) { int width = wxMax( - dc.GetTextExtent(label.Mid(0, i - 1)).GetWidth(), + dc.GetTextExtent(label.Left(i)).GetWidth(), dc.GetTextExtent(label.Mid(i + 1)).GetWidth() + last_line_extra_width); if(width < best_width) {