Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window controls missing on macOS #773

Open
qwertychouskie opened this issue Apr 10, 2024 · 7 comments
Open

Window controls missing on macOS #773

qwertychouskie opened this issue Apr 10, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@qwertychouskie
Copy link

Describe the bug
Window controls are missing on macOS.

To Reproduce
Install theme on macOS

Expected behavior
Window controls exist

Screenshots
image

Setup information

  • OS: macOS 14.4.1
  • Installation method: Manual
  • Firefox version: 124.0.2
  • Theme version: master
  • Optional features enabled: gnomeTheme.bookmarksToolbarUnderTabs = true, gnomeTheme.normalWidthTabs = true

Additional context
Sadly I have to use macOS for work

@qwertychouskie qwertychouskie added the bug Something isn't working label Apr 10, 2024
@rafaelmardojai
Copy link
Owner

The theme has the --gnome-navbar-csd-offset CSS var to know how much offset the navbar needs to show the window controls. The theme sets the value of this var based on the linux-only -moz-gtk-csd-minimize-button, -moz-gtk-csd-maximize-button and -moz-gtk-csd-close-button media queries. Then it uses the -moz-gtk-csd-reversed-placement to know if the offset needs to go in the start or end.

Said that, if you know some macOS-only media query in Firefox we could use it to set --gnome-navbar-csd-offset with some value that works for macOS, and I guess it would also need to set the offset in the start.

Otherwise you can add custom styles on top of the theme to fix your issue:

/* Window controls offset */
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
    padding-left: 117px !important;
    padding-right: 3px !important;
}

@rafaelmardojai
Copy link
Owner

Looking at https://github.com/mozilla/gecko-dev/blob/f602853ba8d55ba157e2a74d9b571615f6ed97b8/layout/style/test/chrome/chrome-only-media-queries.js looks like we might have some alternatives.

Can you check if the following code works?

@media (-moz-platform: macos) {
	:root {
		--gnome-navbar-csd-offset: 117px;
	}
	:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
		padding-left: var(--gnome-navbar-csd-offset) !important;
		padding-right: 3px !important;
	}
	:root[tabsintitlebar] #titlebar .titlebar-buttonbox-container {
		left: 0;
		right: auto !important;
	}
}

@qwertychouskie
Copy link
Author

Put that in customChrome.css, got this result:

image

@rafaelmardojai
Copy link
Owner

Hmm, so it works fine (adding the offset) but there are no window controls. I would need to inspect the UI I guess, but I don't have macOS, so we're at a dead end.

@qwertychouskie
Copy link
Author

Hmm, so it works fine (adding the offset) but there are no window controls. I would need to inspect the UI I guess, but I don't have macOS, so we're at a dead end.

I have an older Macbook that I can set up remote desktop on if you wanted to use that to test on.

@ChrisW-B
Copy link

ChrisW-B commented May 1, 2024

This seems to get the gnome style buttons workable/visible:

@media (-moz-platform: macos) {
    :root {
        --gnome-navbar-csd-offset: 120px;
    }
    :root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
        padding-left: var(--gnome-navbar-csd-offset) !important;
        padding-right: 3px !important;
    }
    :root[tabsintitlebar] #titlebar .titlebar-buttonbox-container {
        left: 0;
        right: auto !important;
    }

    :root[tabsintitlebar] #titlebar .titlebar-buttonbox {
        display: flex !important;
    }

    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-min,
    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-max,
    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-close {
        display: flex !important;
    }

    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-close {
        order: 1;
    }

    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-min {
        order: 2;
    }

    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-max {
        order: 3;
    }

    :root[tabsintitlebar]
        #titlebar
        #TabsToolbar
        .titlebar-buttonbox-container:not(#hack) {
        display: block !important;
    }

    :root[tabsintitlebar] .titlebar-buttonbox {
        position: absolute;
        top: -46px;
    }
}

Screenshot 2024-05-01 at 10 06 40 AM

I can make a PR if this is something you want, I'm not sure if you have a variable for the #nav-bar height, which is where that -46px is coming from.

I also added another 3px to --gnome-navbar-csd-offset as the button padding overlapped the maximize button on hover.

I wrote this in Nightly (127.0a1 (2024-04-30) (64-bit)) - I haven't tested it anywhere else

@qwertychouskie
Copy link
Author

This seems to get the gnome style buttons workable/visible:

@media (-moz-platform: macos) {
    :root {
        --gnome-navbar-csd-offset: 120px;
    }
    :root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
        padding-left: var(--gnome-navbar-csd-offset) !important;
        padding-right: 3px !important;
    }
    :root[tabsintitlebar] #titlebar .titlebar-buttonbox-container {
        left: 0;
        right: auto !important;
    }

    :root[tabsintitlebar] #titlebar .titlebar-buttonbox {
        display: flex !important;
    }

    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-min,
    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-max,
    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-close {
        display: flex !important;
    }

    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-close {
        order: 1;
    }

    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-min {
        order: 2;
    }

    :root[tabsintitlebar] #titlebar .titlebar-button.titlebar-max {
        order: 3;
    }

    :root[tabsintitlebar]
        #titlebar
        #TabsToolbar
        .titlebar-buttonbox-container:not(#hack) {
        display: block !important;
    }

    :root[tabsintitlebar] .titlebar-buttonbox {
        position: absolute;
        top: -46px;
    }
}

Screenshot 2024-05-01 at 10 06 40 AM

I can make a PR if this is something you want, I'm not sure if you have a variable for the #nav-bar height, which is where that -46px is coming from.

I also added another 3px to --gnome-navbar-csd-offset as the button padding overlapped the maximize button on hover.

I wrote this in Nightly (127.0a1 (2024-04-30) (64-bit)) - I haven't tested it anywhere else

I can confirm that this makes the buttons show up, but they all seem shifted too far to the right, and more importantly, I can't click on any of the tabs beneath the window buttons.

@rafaelmardojai rafaelmardojai added enhancement New feature or request and removed bug Something isn't working labels Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants