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

"New Private Tab" button in tab-bar eats "New Tab" button space (Australis) #137

Closed
Dimas-sc opened this issue Apr 7, 2014 · 5 comments
Closed

Comments

@Dimas-sc
Copy link
Contributor

Dimas-sc commented Apr 7, 2014

http://i.imgur.com/ffgPrLt.png

As you can see in the capture, putting the "New Private Tab" button next to the core "New Tab" button isn't accurate and when you want to click the core button the "New Private Tab" button is activated instead.

@Infocatcher
Copy link
Owner

Oh, I see, this is
chrome://browser/skin/browser.css

.tabbrowser-tab {
  pointer-events: none;
}

.tab-background-middle,
.tabs-newtab-button,
.tab-close-button {
  pointer-events: auto;
}

trick for tabs (and "curves" of tabs isn't accessible).
And this can't be easily used for toolbarbutton because image inside button isn't accessible. And (as I understand) accessibility may be changed only using custom binding, like following:

.tabs-newtab-button {
    pointer-events: none;
    -moz-binding: url("override.xml#toolbarbutton");
}
.tabs-newtab-button > .toolbarbutton-icon {
    pointer-events: auto;
    padding: 5px 12px;
}

with

<?xml version="1.0"?>
<bindings id="toolbarbuttonBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <binding id="toolbarbutton" display="xul:hbox" role="xul:toolbarbutton"
        extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton" />
</bindings>

But only one extension may override binding. So, this will break all extensions, that wants to use similar trick. :(

@Infocatcher Infocatcher added the bug label Apr 7, 2014
@Infocatcher Infocatcher changed the title "New Private Tab" button in tab-bar eats "New Tab" button space "New Private Tab" button in tab-bar eats "New Tab" button space (Australis) Apr 7, 2014
Infocatcher added a commit that referenced this issue Apr 8, 2014
Infocatcher added a commit that referenced this issue Apr 8, 2014
Infocatcher added a commit that referenced this issue Apr 8, 2014
@Infocatcher
Copy link
Owner

But only one extension may override binding. So, this will break all extensions, that wants to use similar trick. :(

I used generated binding that extends current one, but this may break anyway (e.g. if you disable another restartless extension with similar trick).
Also I had to handle left-click manually (but this shouldn't create any problems from user side).

Also added two hidden preferences:

  • extensions.privateTab.fixAfterTabsButtonsAccessibility to disable this fix
  • extensions.privateTab.fixAfterTabsButtonsAccessibility.iconPadding to override autodetected padding for button's icon

And for added user styles (Stylish) and extensions like Classic Theme Restorer Private Tab styles aren't updated automatically (and you should re-enable extension).

Test version: private_tab-0.1.7.1pre2-fx-sm.xpi (source source).

@Dimas-sc
Copy link
Contributor Author

Dimas-sc commented Apr 8, 2014

It works perfectly now!

If you need some advanced testing tell me. Do you think we could create a Firefox bug for a better / no-conflict fix?

Thx!

Infocatcher added a commit that referenced this issue Apr 8, 2014
(for better compatibility with other themes and extensions like Tree Style Tab)
(#137)
@Infocatcher
Copy link
Owner

Do you think we could create a Firefox bug for a better / no-conflict fix?

May be, but how many extensions have buttons after last tab? I know only about Tab Mix Plus, but with only some GUI settings for New Tab button placement.

Also I corrected code to better resize button's icon, now should work better with other themes/extensions (e.g. with Tree Style Tab).
Test version re-uploaded, link still the same.

Infocatcher added a commit that referenced this issue Apr 8, 2014
@Dimas-sc
Copy link
Contributor Author

Dimas-sc commented Apr 8, 2014

Agree, solved! :D

Infocatcher added a commit that referenced this issue Apr 8, 2014
(we correct accessibility using CSS, but still can click or right edge of rightmost button)
(#137)
Infocatcher added a commit that referenced this issue Apr 11, 2014
Infocatcher added a commit that referenced this issue Apr 11, 2014
Infocatcher added a commit that referenced this issue Apr 12, 2014
Infocatcher added a commit that referenced this issue Apr 12, 2014
Previous implementation works wrong with button's padding (and introduces horizontal overflow in Tree Style Tab)
(#137, piroor/treestyletab#684)
Infocatcher added a commit that referenced this issue May 6, 2014
for "beforehovered" attribute on last tab
Note: there also logical bug in old code:
if(btn.id == "tabbrowser-tabs")
(only tabs before buttons)
(#138, also related to #137)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants