traxium / tabtree

Tab Tree extension for Firefox
https://addons.mozilla.org/en-US/firefox/addon/tab-tree/
GNU General Public License v3.0
144 stars 29 forks source link

Borders #106

Open mgwio opened 8 years ago

mgwio commented 8 years ago

Hi,

Is there something that is continuously overwriting border settings somewhere? DOM inspector shows that the borders on the sidebar are set to 1px none rgb(128,128,128), but none of the CSS sources tell the origin, and they're impossible to change using Stylish or directly editing from the DOM inspector.

Edit: Unrelated, but have you given your implementation of favicons a selector? Trying to hide them is also an exercise in futility. It looks like they're constantly being reloaded?

traxium commented 8 years ago

Although #tt-sidebar has 0px borders on my system (both Default and Developer Edition themes) I'd recommend you to use:

#tt-sidebar {
  -moz-appearance: none;
}

-moz-appearance: none; also useful for any element if it doesn't accept your CSS.

traxium commented 8 years ago

Edit: Unrelated, but have you given your implementation of favicons a selector? Trying to hide them is also an exercise in futility. It looks like they're constantly being reloaded?

If you are talking about <tree> favicons they are set by JavaScript here https://github.com/traxium/tabtree/blob/v1.4.5/bootstrap.js#L1914. If that function returns "" then ::moz-tree-image is used, e.g.:

.tt-treechildren::-moz-tree-image {
    list-style-image: url(chrome://mozapps/skin/places/defaultFavicon.png);
    padding-right: 2px;
    margin: 0 2px;
    width: 16px;
    height: 16px;
}

If you are talking about pinned tab favicons they are essentially <toolbarbutton class="tt-tab-button"> wrapped in . See https://github.com/traxium/tabtree/blob/v1.4.5/bindings.xml for more details.

mgwio commented 8 years ago

Great. When I was experimenting I found the borders are part of the tree and not the sidebar, and

.tt-tree {
  -moz-appearance: none!important;
}

worked perfectly. I'll mess around with the favicons. Would you be interested in a pull request to make them toggleable?

traxium commented 8 years ago

There is a hack in the code to force the tree to redraw:

let redrawHack = tree.style.borderStyle; // hack to force to redraw <tree>
tree.style.borderStyle = 'none';
tree.style.borderStyle = redrawHack;
tree.treeBoxObject.invalidate();

It's used when extensions.tabtree.tab-height or extensions.tabtree.treelines pref changes.

If you think that someone would want togglable favicons then why not.