diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp index 531612ff..3412e5ea 100644 --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -623,6 +623,7 @@ namespace Breeze bool flat = stateProperties.value("flat"); bool defaultButton = stateProperties.value("defaultButton"); bool hasNeutralHighlight = stateProperties.value("hasNeutralHighlight"); + bool isActiveWindow = stateProperties.value("isActiveWindow"); // don't render background if flat and not hovered, down, checked, or given visual focus if (flat && !(hovered || down || checked || visualFocus) @@ -649,7 +650,7 @@ namespace Breeze : alphaColor(palette.buttonText().color(), 0.125); penBrush = hasNeutralHighlight ? neutralText(palette) : KColorUtils::mix(palette.button().color(), palette.buttonText().color(), 0.3); - } else if (defaultButton) { + } else if (isActiveWindow && defaultButton) { bgBrush = alphaColor(highlightColor, 0.125); penBrush = KColorUtils::mix( highlightColor, @@ -668,7 +669,7 @@ namespace Breeze : KColorUtils::mix(palette.button().color(), palette.buttonText().color(), 0.125); penBrush = hasNeutralHighlight ? neutralText(palette) : KColorUtils::mix(palette.button().color(), palette.buttonText().color(), 0.3); - } else if (defaultButton) { + } else if (isActiveWindow && defaultButton) { bgBrush = KColorUtils::mix(palette.button().color(), highlightColor, 0.2); penBrush = KColorUtils::mix( highlightColor, @@ -700,7 +701,7 @@ namespace Breeze } // Gradient - if (!(flat || down || hovered || checked) && enabled) { + if (isActiveWindow && !(flat || down || hovered || checked) && enabled) { QLinearGradient bgGradient(frameRect.topLeft(), frameRect.bottomLeft()); bgGradient.setColorAt(0, KColorUtils::mix(bgBrush.color(), Qt::white, 0.03125)); bgGradient.setColorAt(0.5, bgBrush.color()); @@ -713,7 +714,7 @@ namespace Breeze } // Shadow - if (!(flat || down || checked) && enabled) { + if (isActiveWindow && !(flat || down || checked) && enabled) { renderRoundedRectShadow(painter, shadowedRect, shadowColor(palette)); } diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index a0022a42..64601b3d 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -3862,6 +3862,7 @@ namespace Breeze stateProperties["hasMenu"] = hasMenu; stateProperties["defaultButton"] = defaultButton; stateProperties["hasNeutralHighlight"] = hasNeutralHighlight; + stateProperties["isActiveWindow"] = widget ? widget->isActiveWindow() : true; _helper->renderButtonFrame(painter, option->rect, option->palette, stateProperties, bgAnimation, penAnimation);