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

Collapsing Sidebery #158

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions chrome/tweaks/collapse-sidebery.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
@media (-moz-bool-pref: "uc.tweak.collapse-sidebery") {
:root:not([customizing]):has(#sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"]:not([hidden])) {
--uc-sidebar-width: 256px;
--uc-sidebar-collapsed-width: 48px;

& #sidebar-box {
position: relative;
min-width: var(--uc-sidebar-collapsed-width) !important;
width: var(--uc-sidebar-collapsed-width) !important;
max-width: var(--uc-sidebar-width) !important;
z-index: calc(var(--browser-area-z-index-tabbox, 0) + 1) !important;
}

& #sidebar-box[positionend] {
direction: rtl;
}
& #sidebar-box[positionend] > * {
direction: ltr;
}

& #sidebar-box[positionend]:-moz-locale-dir(rtl) {
direction: ltr;
}
& #sidebar-box[positionend]:-moz-locale-dir(rtl) > * {
direction: rtl;
}

& #sidebar-box[positionend] {
& #sidebar {
border-left: 1px solid var(--sidebar-border-color);
}
}
& #sidebar-box:not([positionend]) {
& #sidebar {
border-right: 1px solid var(--sidebar-border-color);
}
}

& #sidebar-header {
display: none;
}

& #sidebar {
background-color: inherit;
overflow: hidden;
padding-inline: 4px;
width: var(--uc-sidebar-width) !important;
}

& #sidebar-splitter {
display: none;
}
}

:root:not([customizing]):has(#sidebar-title[value="Sidebery"]:not([hidden])),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be best to change this to use the same selector as above, #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] as the panel name can be arbitrary based on user settings.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

:root:not([customizing]):has(#sidebar-title[value="Tabs"]:not([hidden])) {
--uc-sidebar-collapse-duration: 0ms;
--uc-sidebar-collapse-delay: 0ms;
--uc-sidebar-expand-duration: 100ms;
--uc-sidebar-expand-delay: 400ms;

& #sidebar {
width: var(--uc-sidebar-collapsed-width) !important;
transition-property: width;
transition-duration: var(--uc-sidebar-collapse-duration);
transition-delay: var(--uc-sidebar-collapse-delay);
}

& #sidebar-box:hover {
& #sidebar-header, & #sidebar {
width: var(--uc-sidebar-width) !important;
transition-duration: var(--uc-sidebar-expand-duration);
transition-delay: var(--uc-sidebar-expand-delay);
}
}
}
}
58 changes: 30 additions & 28 deletions chrome/tweaks/hide-tabs-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -189,38 +189,40 @@
}
}

#sidebar-header {
border-bottom: 0 !important;
padding: 10px 4px 0 !important;
overflow: hidden;
position: relative;

#sidebar-switcher-target,
#sidebar-close {
width: auto !important;
height: 28px !important;
padding: 0 8px !important;
border: none !important;
margin-inline: 0 !important;
}
@media not (-moz-bool-pref: "uc.tweak.collapse-sidebery") {
#sidebar-header {
border-bottom: 0 !important;
padding: 10px 4px 0 !important;
overflow: hidden;
position: relative;

#sidebar-switcher-target,
#sidebar-close {
width: auto !important;
height: 28px !important;
padding: 0 8px !important;
border: none !important;
margin-inline: 0 !important;
}

#sidebar-spacer {
min-width: 8px !important;
#sidebar-spacer {
min-width: 8px !important;
}
}
}

/* Sidebar positioned on the left. */
&:not([positionend]) {
border-inline-end: 1px solid var(--sidebar-border-color);
/* Use less padding on the side with the border. */
padding-inline: 4px 3px;
}
/* Sidebar positioned on the left. */
&:not([positionend]) {
border-inline-end: 1px solid var(--sidebar-border-color);
/* Use less padding on the side with the border. */
padding-inline: 4px 3px;
}

/* Sidebar positioned on the right. */
&[positionend] {
border-inline-start: 1px solid var(--sidebar-border-color);
/* Use less padding on the side with the border. */
padding-inline: 3px 4px;
/* Sidebar positioned on the right. */
&[positionend] {
border-inline-start: 1px solid var(--sidebar-border-color);
/* Use less padding on the side with the border. */
padding-inline: 3px 4px;
}
}

/* Rounded corners tweak optimisations. */
Expand Down
57 changes: 57 additions & 0 deletions chrome/tweaks/sidebery-collapsed.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@-moz-document regexp("^moz-extension://.*?/sidebar/sidebar.html") {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The contents of the collapsed file could probably just be added to the end of the sidebery.css file instead of having two separate files.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged into sidebery.css

@media (max-width: 50px) {
#root {
--tabs-indent: unset !important;
--tabs-lvl-opacity: 0 !important;
}

.CtxMenu[data-active="true"] {
display: none;
}

.NavigationBar[data-layout="inline"] {
& .static-btns {
display: none !important;
}
& .nav-item[data-active="true"] {
background-color: unset !important;
box-shadow: unset !important;
margin: auto;
opacity: unset !important;
position: relative !important;
transform: unset !important;
}
}

.SearchBar[data-showed="true"] {
& .search-icon > svg {
margin: unset !important;
}
& .placeholder, & .input, & .clear-btn {
display: none !important;
}
}

.ScrollBox > .scroll-container {
scrollbar-width: none !important;
}

.Tab .fav {
margin: auto !important;
}

.Tab .audio {
top: unset !important;
left: unset !important;
bottom: 0;
right: 0;
width: 14px !important;
height: 14px !important;
}

.Tab .t-box,
.Tab .close {
display: none;
}
}
}
1 change: 1 addition & 0 deletions chrome/userChrome.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/* Edge-Frfox tweaks */
@import url("global/tweaks.css");
@import url("tweaks/hide-tabs-bar.css");
@import url("tweaks/collapse-sidebery.css");

/* Import custom stylesheet instead of modifying Edge-Frfox theme files. */
@import url("custom.css");
1 change: 1 addition & 0 deletions chrome/userContent.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
@import url("content/common.css");
@import url("content/newtab.css");
@import url("tweaks/sidebery.css") (-moz-bool-pref: "uc.tweak.theme.sidebery");
@import url("tweaks/sidebery-collapsed.css") (-moz-bool-pref: "uc.tweak.collapse-sidebery");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you move the collapsed Sidebery code to the sidebery.css file then the import should be removed.

52 changes: 47 additions & 5 deletions sidebery.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,61 @@
"settings": {
"nativeScrollbars": true,
"nativeScrollbarsThin": true,
"ctxMenuNative": true,
"navBarLayout": "hidden",
"updateSidebarTitle": true,
"ctxMenuNative": false,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there any specific reason to use the non-native context menu by default? I think the default option should probably be to use the native menu as it seemed to work better most of the time.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue with the way I use Sidebery. In any case, I have removed settings that may be specific to the way I use Sidebery.

"navBarLayout": "horizontal",
"navBarInline": true,
"subPanelRecentlyClosedBar": false,
"subPanelBookmarks": false,
"subPanelHistory": false,
"showNewTabBtns": true,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably leave the new tab button enabled by default, as that is what Edge displays.

"searchBarMode": "dynamic",
"tabRmBtn": "always",
"tabsRmUndoNote": false,
"showNewTabBtns": true,
"newTabBarPosition": "after_tabs",
"moveNewTabParent": "default",
"pinnedTabsPosition": "panel",
"pinnedTabsList": true,
"bookmarksRmUndoNote": false,
"theme": "proton",
"colorScheme": "ff"
},
"ver": "5.1.1"
}
"sidebar": {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for adding these panels? As far as I know most of these are there by default?

"nav": [
"bookmarks",
"history",
"tabs",
"search"
],
"panels": {
"bookmarks": {
"type": 1,
"id": "bookmarks",
"name": "Bookmarks",
"iconSVG": "icon_bookmarks",
"tempMode": true,
"skipOnSwitching": true,
"viewMode": "tree"
},
"history": {
"type": 4,
"id": "history",
"name": "History",
"color": "toolbar",
"iconSVG": "icon_clock",
"tempMode": true,
"skipOnSwitching": true,
"viewMode": "history"
},
"tabs": {
"type": 2,
"id": "tabs",
"name": "Tabs",
"color": "toolbar",
"iconSVG": "icon_tabs",
"skipOnSwitching": false
}
}
},
"ver": "5.2.0"
}