Bug 1560702 - Improve hit boxes of titlebar buttons. r=stransky,desktop-theme-reviewers,dao
In order to do it, expose the button padding to CSS via env(), and make the buttons just use the regular drawing. This slightly changes the padding to the end of the titlebar to match one half of the inter-button spacing, rather that however much padding the headerbar has. We could improve on this slightly by also exposing the headerbar padding and applying that to the last button, but that's not terribly easy to do due to us supporting re-ordering of the titlebar buttons, and reversing their placement, so it'd involve some rather hacky CSS. Not impossible, but not trivial, and this looks good enough IMO. Differential Revision: https://phabricator.services.mozilla.com/D202616
This commit is contained in:
@@ -555,15 +555,16 @@ void nsImageFrame::DidSetComputedStyle(ComputedStyle* aOldStyle) {
|
||||
//
|
||||
// TODO(emilio): We might want to do the same for regular list-style-image or
|
||||
// even simple content: url() changes.
|
||||
if (mKind == Kind::XULImage) {
|
||||
if (!mContent->AsElement()->HasNonEmptyAttr(nsGkAtoms::src) && aOldStyle &&
|
||||
if (mKind == Kind::XULImage && aOldStyle) {
|
||||
if (!mContent->AsElement()->HasNonEmptyAttr(nsGkAtoms::src) &&
|
||||
aOldStyle->StyleList()->mListStyleImage !=
|
||||
StyleList()->mListStyleImage) {
|
||||
UpdateXULImage();
|
||||
}
|
||||
if (!mOwnedRequest && aOldStyle &&
|
||||
aOldStyle->StyleDisplay()->EffectiveAppearance() !=
|
||||
StyleDisplay()->EffectiveAppearance()) {
|
||||
// If we have no image our intrinsic size might be themed. We need to
|
||||
// update the size even if the effective appearance hasn't changed to
|
||||
// deal correctly with theme changes.
|
||||
if (!mOwnedRequest) {
|
||||
UpdateIntrinsicSize();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user