Skip to content

Commit

Permalink
reduced indent in dense mode, check tabgrouping before acting on tab …
Browse files Browse the repository at this point in the history
…changes in browser
  • Loading branch information
tconfrey committed May 6, 2024
1 parent 0673bc4 commit 7e9e78f
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 10 deletions.
8 changes: 8 additions & 0 deletions app/bt.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
--btFootnoteFontWeight: 400;
--btFootnoteLineHeight: 12px;

--btWenkBottom: 8px;
--btWenkPadding: 0.2rem 0.5rem 0.2rem 0.5rem;
--btIndentStepSize: 30px;

--btSettingsSubtextFontSize: 10px;
--btSettingsSubtextFontWeight: 400;
--btSettingsSubtextLineHeight: 12px;
Expand Down Expand Up @@ -155,6 +159,10 @@
--btIndenterTopOffset: -4px;
--btFaviconPadding: 1px;
--btTabgroupPadding: 3px 7px 3px 7px !important;

--btWenkBottom: 3px;
--btWenkPadding: 0.1rem 0.5rem 0.1rem 0.5rem;
--btIndentStepSize: 20px;
}

[data-size="LARGE"] {
Expand Down
8 changes: 6 additions & 2 deletions app/bt.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ function handleInitialTabs(tabs, tgs) {
node.tabGroupId = tab.groupId;
const tg = tgs.find(tg => tg.id == tab.groupId);
if (tg) node.setTGColor(tg.color);
} else {
node.putInGroup(); // not grouped currently, handle creating/assigning as needed on startup
node.groupAndPosition();
}
if (node.parentId && AllNodes[node.parentId]) {
AllNodes[node.parentId].windowId = node.windowId;
Expand Down Expand Up @@ -971,7 +974,7 @@ function tabJoinedTG(data) {
const tgId = data.groupId;
let tabNode = BTAppNode.findFromTab(tabId);
const topicNode = BTAppNode.findFromGroup(tgId);
if (tabNode || !topicNode) return; // n/a || don't care
if (tabNode || !topicNode || (GroupingMode != 'TABGROUP')) return; // n/a || don't care
const tab = data.tab;
const index = data.tabIndex;
const indices = data.tabIndices;
Expand All @@ -994,7 +997,8 @@ function tabLeftTG(data) {

const tabId = data.tabId;
const tabNode = BTAppNode.findFromTab(tabId);
if (tabNode) deleteNode(tabNode.id);
if (!tabNode || (GroupingMode != 'TABGROUP')) return;
deleteNode(tabNode.id);
}

function tabMoved(data) {
Expand Down
3 changes: 2 additions & 1 deletion app/jquery.treetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@
// Tony Edit: shift siblings of parents left so all a parents children are equal,
// also, remove indenter if no longer applicible
//if (this.isBranchNode())
this.indenter[0].style.paddingLeft = "" + (this.level() * settings.indent) + "px";
//this.indenter[0].style.paddingLeft = "" + (this.level() * settings.indent) + "px";
this.indenter[0].style.paddingLeft = "calc(var(--btIndentStepSize) * " + this.level() + ")";
//else {
// this.indenter[0].style.paddingLeft = "" + ((this.level() - 1) * settings.indent) + "px";
//$(this.indenter[0]).empty();
Expand Down
4 changes: 2 additions & 2 deletions app/wenk.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
font-size: var(--btTopicFontSize);
border-radius: .2rem;
content: attr(data-wenk);
padding: .4rem;
padding: var(--btWenkPadding);
background-color: var(--btTooltipBackground);
color: var(--btTooltipForeground);
line-height: 1.25rem;
Expand Down Expand Up @@ -82,7 +82,7 @@

/* used for the ttree expand/collapse buttons */
[data-wenk].wenk--bottom:after {
bottom: 5px;
bottom: var(--btWenkBottom);
left: 100%;
top: auto;
right: auto;
Expand Down
8 changes: 8 additions & 0 deletions versions/Release-Candidate/app/bt.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
--btFootnoteFontWeight: 400;
--btFootnoteLineHeight: 12px;

--btWenkBottom: 8px;
--btWenkPadding: 0.2rem 0.5rem 0.2rem 0.5rem;
--btIndentStepSize: 30px;

--btSettingsSubtextFontSize: 10px;
--btSettingsSubtextFontWeight: 400;
--btSettingsSubtextLineHeight: 12px;
Expand Down Expand Up @@ -155,6 +159,10 @@
--btIndenterTopOffset: -4px;
--btFaviconPadding: 1px;
--btTabgroupPadding: 3px 7px 3px 7px !important;

--btWenkBottom: 3px;
--btWenkPadding: 0.1rem 0.5rem 0.1rem 0.5rem;
--btIndentStepSize: 20px;
}

[data-size="LARGE"] {
Expand Down
8 changes: 6 additions & 2 deletions versions/Release-Candidate/app/bt.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ function handleInitialTabs(tabs, tgs) {
node.tabGroupId = tab.groupId;
const tg = tgs.find(tg => tg.id == tab.groupId);
if (tg) node.setTGColor(tg.color);
} else {
node.putInGroup(); // not grouped currently, handle creating/assigning as needed on startup
node.groupAndPosition();
}
if (node.parentId && AllNodes[node.parentId]) {
AllNodes[node.parentId].windowId = node.windowId;
Expand Down Expand Up @@ -971,7 +974,7 @@ function tabJoinedTG(data) {
const tgId = data.groupId;
let tabNode = BTAppNode.findFromTab(tabId);
const topicNode = BTAppNode.findFromGroup(tgId);
if (tabNode || !topicNode) return; // n/a || don't care
if (tabNode || !topicNode || (GroupingMode != 'TABGROUP')) return; // n/a || don't care
const tab = data.tab;
const index = data.tabIndex;
const indices = data.tabIndices;
Expand All @@ -994,7 +997,8 @@ function tabLeftTG(data) {

const tabId = data.tabId;
const tabNode = BTAppNode.findFromTab(tabId);
if (tabNode) deleteNode(tabNode.id);
if (!tabNode || (GroupingMode != 'TABGROUP')) return;
deleteNode(tabNode.id);
}

function tabMoved(data) {
Expand Down
3 changes: 2 additions & 1 deletion versions/Release-Candidate/app/jquery.treetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@
// Tony Edit: shift siblings of parents left so all a parents children are equal,
// also, remove indenter if no longer applicible
//if (this.isBranchNode())
this.indenter[0].style.paddingLeft = "" + (this.level() * settings.indent) + "px";
//this.indenter[0].style.paddingLeft = "" + (this.level() * settings.indent) + "px";
this.indenter[0].style.paddingLeft = "calc(var(--btIndentStepSize) * " + this.level() + ")";
//else {
// this.indenter[0].style.paddingLeft = "" + ((this.level() - 1) * settings.indent) + "px";
//$(this.indenter[0]).empty();
Expand Down
4 changes: 2 additions & 2 deletions versions/Release-Candidate/app/wenk.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
font-size: var(--btTopicFontSize);
border-radius: .2rem;
content: attr(data-wenk);
padding: .4rem;
padding: var(--btWenkPadding);
background-color: var(--btTooltipBackground);
color: var(--btTooltipForeground);
line-height: 1.25rem;
Expand Down Expand Up @@ -82,7 +82,7 @@

/* used for the ttree expand/collapse buttons */
[data-wenk].wenk--bottom:after {
bottom: 5px;
bottom: var(--btWenkBottom);
left: 100%;
top: auto;
right: auto;
Expand Down

0 comments on commit 7e9e78f

Please sign in to comment.