Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

[Idea] TST close button on the left #39

Open
benneti opened this issue Feb 11, 2021 · 8 comments
Open

[Idea] TST close button on the left #39

benneti opened this issue Feb 11, 2021 · 8 comments
Labels
enhancement New feature or request firefox css Related to firefox CSS

Comments

@benneti
Copy link
Contributor

benneti commented Feb 11, 2021

When using autohide it one has to move the cursor to the left to open slide it open but when it is expanded one needs to go to the far right to close a tab.
A simple solution to minimize travel distances for the tabs would be to move the close button to the left of the tab name.

@akshat46 akshat46 added enhancement New feature or request firefox css Related to firefox CSS labels Feb 13, 2021
@akshat46
Copy link
Owner

akshat46 commented Mar 4, 2021

Finally getting around this.

Having close button on left just for expanded tab group would be a little off-pattern and add inconsistency to the design. I could include this as a configuration in the web-app, but things have come up and I've decided to shrink the scope of this project for now so I doubt it'll be added anytime soon.

That said, adding following snippet should move the close button next to collapse-expand button on left side, but only when the group is expanded. This only works with config-hover.css. TST CSS for static sidebar needs to be fixed a little (mainly the positioning of tabs counter, which would also change animations for favicon and labels). I'll update this reply with a separate snippet for static-sidebar once that's done.

/* CONFIG-HOVER.CSS ONLY*/

/*** if has children & is collapsed ***/

/* move favicon off the tab on hover*/
:root.left tab-item[data-child-ids]:not(.pinned):not(.subtree-collapsed):hover tab-favicon {
    transform: scale(120%) translateX(30px) !important;
}

/* shift label right on hover */
:root.left tab-item[data-child-ids]:not(.subtree-collapsed):hover .label {
    transform: translateX(25px);
}

/* replace default closebox position. */
/* overwrite right rule, add new left rule */
tab-item[data-child-ids]:not(pinned):not(.subtree-collapsed) tab-closebox{
    right: 0 !important;
    left: -20px !important;
}

/** shift closebox on hover */
tab-item[data-child-ids]:hover:not(pinned):not(.subtree-collapsed) tab-closebox{
    left: 22px !important;
}

@benneti
Copy link
Contributor Author

benneti commented Mar 4, 2021

thank you, I'll try it out!

@benneti
Copy link
Contributor Author

benneti commented Mar 4, 2021

Do I need to delete something for this to work, or should it work after simply adding it in my TST config?

@akshat46
Copy link
Owner

akshat46 commented Mar 4, 2021

Should work on its own as long as it's added to the very bottom, and rest of the css is from config-hover.css

@benneti
Copy link
Contributor Author

benneti commented Mar 4, 2021

Actually it only works for the top level tabs of trees, the toplevel tabs without trees and non-toplevel tabs do not change the close button position.

@akshat46
Copy link
Owner

akshat46 commented Mar 4, 2021

Oh, I thought that's what you were asking about. To have close button on left just for tabs with children so that it's right next to the expand-collapse button.

It'll be a bit of work to shift close buttons to left, I'll get around to it in a bit. Alternatively, instead of moving closebuttons to left, it's easier to move the expand-collapse button to right. Which can be done with this:

tab-item[data-child-ids]:not(pinned) .twisty{
   order: 2 !important;
   transform: translateX(-10px) !important;
}

:root.left tab-item[data-child-ids]:not(.pinned):hover tab-favicon {
    transform: scale(120%) translateX(25px) !important;
}

I've only tested this on config-hover. Just the first rule alone should give desired styles if used with static-sidebar css.

@benneti
Copy link
Contributor Author

benneti commented Mar 4, 2021

ah it wasn't related to the expand button; it is more that sometimes I move my mouse to fast to the close button and the intellihide doch hides before I can close the tab.
Therefore I thought it might be nice to have the close of all tabs on the very left to not accidently hide the tab side bar.

Don't feel pressure how it is just fine, too.

@akshat46
Copy link
Owner

akshat46 commented Mar 6, 2021

oh I see. Will try to do something about it in next few days.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request firefox css Related to firefox CSS
Projects
None yet
Development

No branches or pull requests

2 participants