Closed
Bug 1434621
Opened 7 years ago
Closed 7 years ago
Window controls with CSD on are not vertically centered
Categories
(Firefox :: Theme, defect)
Tracking
()
RESOLVED
FIXED
Firefox 60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: pascalc, Assigned: dao)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
5.70 KB,
image/png
|
Details | |
5.84 KB,
patch
|
stransky
:
review+
|
Details | Diff | Splinter Review |
786 bytes,
patch
|
dao
:
review+
|
Details | Diff | Splinter Review |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 ID:20180131100706
Ubuntu 17.10, OSX-Arc White theme, layout.css.devPixelsPerPx set to 1.5
When I activate the CSD through the customization pane, the window controls are drawn to the top edge of the window instead of being vertically centered in the tabbar like in other gnome apps such as gedit or nautilus.
I am attaching a screenshot
The buttons are also no longer spaced consistently with other apps (not enough space between the widgets) but maybe this is bug 1433092? If not I can file another bug
Comment 1•7 years ago
|
||
Bug 1433092 is not related here as it's about horizontal spacing.
Updated•7 years ago
|
Assignee: nobody → stransky
Comment 2•7 years ago
|
||
Let's fix that at Bug 1419442.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Comment 3•7 years ago
|
||
Reopening per https://bugzilla.mozilla.org/show_bug.cgi?id=1419442#c23 - I'd fix that separately after all.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Comment hidden (mozreview-request) |
Updated•7 years ago
|
Status: REOPENED → ASSIGNED
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8952077 [details]
Bug 1434621 - [Linux/Titlebar rendering] Center titlebar buttons,
https://reviewboard.mozilla.org/r/221308/#review227136
Code analysis found 5 defects in this patch:
- 5 defects found by mozlint
You can run this analysis locally with:
- `./mach lint path/to/file` (JS/Python)
If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx
::: browser/base/content/browser-tabsintitlebar.js:238
(Diff revision 1)
> let extraMargin = tabAndMenuHeight - titlebarContentHeight;
> - if (AppConstants.platform != "macosx") {
> + if (AppConstants.platform == "linux") {
> + // Linux centers buttons at titlebar so let's emulate that.
> + if (!fullMenuHeight) {
> + // Menubar is not visible - center buttons according to tabs.
> + titlebarContent.style.marginTop = extraMargin/2 + "px";
Error: Infix operators must be spaced. [eslint: space-infix-ops]
::: browser/base/content/browser-tabsintitlebar.js:239
(Diff revision 1)
> - if (AppConstants.platform != "macosx") {
> + if (AppConstants.platform == "linux") {
> + // Linux centers buttons at titlebar so let's emulate that.
> + if (!fullMenuHeight) {
> + // Menubar is not visible - center buttons according to tabs.
> + titlebarContent.style.marginTop = extraMargin/2 + "px";
> + titlebarContent.style.marginBottom = extraMargin/2 + "px";
Error: Infix operators must be spaced. [eslint: space-infix-ops]
::: browser/base/content/browser-tabsintitlebar.js:241
(Diff revision 1)
> + if (!fullMenuHeight) {
> + // Menubar is not visible - center buttons according to tabs.
> + titlebarContent.style.marginTop = extraMargin/2 + "px";
> + titlebarContent.style.marginBottom = extraMargin/2 + "px";
> + } else {
> + if (fullMenuHeight > titlebarContentHeight) {
Error: Unexpected if as the only statement in an else block. [eslint: no-lonely-if]
::: browser/base/content/browser-tabsintitlebar.js:244
(Diff revision 1)
> + titlebarContent.style.marginBottom = extraMargin/2 + "px";
> + } else {
> + if (fullMenuHeight > titlebarContentHeight) {
> + // Buttons are smaller than menubar so center them according to menubar.
> + let fullMenuHeightMargin = fullMenuHeight - titlebarContentHeight;
> + titlebarContent.style.marginTop = fullMenuHeightMargin/2 + "px";
Error: Infix operators must be spaced. [eslint: space-infix-ops]
::: browser/base/content/browser-tabsintitlebar.js:245
(Diff revision 1)
> + } else {
> + if (fullMenuHeight > titlebarContentHeight) {
> + // Buttons are smaller than menubar so center them according to menubar.
> + let fullMenuHeightMargin = fullMenuHeight - titlebarContentHeight;
> + titlebarContent.style.marginTop = fullMenuHeightMargin/2 + "px";
> + titlebarContent.style.marginBottom = fullMenuHeightMargin/2 + (extraMargin - fullMenuHeightMargin) + "px";
Error: Infix operators must be spaced. [eslint: space-infix-ops]
Assignee | ||
Comment 7•7 years ago
|
||
I'm trying to figure out a simpler fix. How is this?
Attachment #8952673 -
Flags: review?(stransky)
Comment 8•7 years ago
|
||
Comment on attachment 8952673 [details] [diff] [review]
patch
That's very good!
Attachment #8952673 -
Flags: review?(stransky) → review+
Updated•7 years ago
|
Attachment #8952077 -
Attachment is obsolete: true
Attachment #8952077 -
Flags: review?(dao+bmo)
Updated•7 years ago
|
Attachment #8952077 -
Attachment is obsolete: false
Updated•7 years ago
|
Attachment #8952077 -
Attachment is obsolete: true
Comment 9•7 years ago
|
||
I also suggest to remove titlebar padding loaded from Gtk+ theme and apply only the one you added at #titlebar-buttonbox. Otherwise the titlebar is too big on themes which defines titlebar padding (like Adwaita).
Attachment #8952739 -
Flags: review?(dao+bmo)
Assignee | ||
Comment 10•7 years ago
|
||
Comment on attachment 8952739 [details] [diff] [review]
titlebar padding patch
Yeah, I figured we'd want to take this part of your patch but forgot about it.
Attachment #8952739 -
Flags: review?(dao+bmo) → review+
Assignee | ||
Comment 11•7 years ago
|
||
Gonna land both patches in a bit.
Assignee: stransky → dao+bmo
Component: Widget: Gtk → Theme
OS: Unspecified → Linux
Product: Core → Firefox
Comment 12•7 years ago
|
||
Great, Thanks!
Comment 13•7 years ago
|
||
Pushed by dgottwald@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cf8ac6e2c5e0
part 1: vertically center title bar buttons on Linux. r=stransky
https://hg.mozilla.org/integration/mozilla-inbound/rev/134bfa14acf9
part 2: ignore vertical titlebar padding from the Gtk+ theme since we set it with CSS on #titlebar-buttonbox. r=dao
Comment 14•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cf8ac6e2c5e0
https://hg.mozilla.org/mozilla-central/rev/134bfa14acf9
Status: ASSIGNED → RESOLVED
Closed: 7 years ago → 7 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
You need to log in
before you can comment on or make changes to this bug.
Description
•