Skip to content

Commit 342339c

Browse files
coloring buttons line
1 parent ddf83a0 commit 342339c

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

src/createFamily/buttons.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { App, TFile, setTooltip, setIcon, addIcon, MarkdownView, Editor, Platform } from "obsidian";
1+
import { App, TFile, setTooltip, setIcon, addIcon, MarkdownView, Editor, Platform, TFolder } from "obsidian";
22
import familyModal from "./familyModal";
33
import U from '../util/U';
44
import deleteActiveNoteModal from "./deleteActiveNoteModal";
@@ -108,6 +108,19 @@ function appendOrRemoveChild(appObject: App, file: TFile, obsidianContainer: any
108108
//@ts-ignore
109109
buttonsLineContainer.style.backgroundColor = Vars.buttonsLineContainerBG_clusters
110110

111+
// check if the file and folder in same time
112+
const selfName = file.basename
113+
const siblings = file.parent?.children
114+
const isThereChildrenFolder = siblings?.find((item) => item instanceof TFolder && item.name === selfName) as TFolder
115+
if (isThereChildrenFolder) {
116+
if (!file.basename.endsWith("-cluster")) {
117+
buttonsLineContainer.addClasses(["mergeFileFolder"])
118+
}
119+
if (file.basename.endsWith("-cluster")) {
120+
buttonsLineContainer.addClasses(["mergeFileFolderCluster"])
121+
}
122+
}
123+
111124
const extraButtonsContainer = document.createElement('div');
112125
extraButtonsContainer.addClasses(["extraButtonsContainer"])
113126
//@ts-ignore

src/style/parts/buttons.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@
6161

6262

6363
//-BUTTONS-------------------*/
64+
.mergeFileFolder {
65+
background-color: hsl(55deg 50% 30% / 30%) !important;
66+
}
67+
68+
.mergeFileFolderCluster {
69+
background-color: hsl(155deg 50% 30% / 30%) !important;
70+
}
71+
6472
.buttonsLineContainer {
6573
position: relative;
6674
display: flex;

src/style/parts/variables.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
--background-menu-orphan: hsl(303deg 50% 30%/ 40%) !important;
1919
--background-menu-orphan-selected: hsl(303deg 50% 30%/ 80%) !important;
2020
//- buttons container colors
21-
--background-button-container-clusters: hsl(154.99deg 50% 30%/ 30%);
21+
--background-button-container-clusters: hsl(220deg 50% 30% / 30%);
2222
--background-button-container-orphans: hsl(303deg 50% 30%/ 30%);
2323
//- extra buttons container colors
2424
--background-extra-button-container-clusters: hsl(154.99deg 50% 30%/ 30%);
@@ -54,7 +54,7 @@
5454
--background-menu-orphan: hsl(303deg 50% 30%/ 40%) !important;
5555
--background-menu-orphan-selected: hsl(303deg 50% 30%/ 80%) !important;
5656
//- buttons container colors
57-
--background-button-container-clusters: hsl(155 30% 50%);
57+
--background-button-container-clusters: hsl(220deg 30% 50%);
5858
--background-button-container-orphans: hsl(303deg 30% 50%);
5959
//- extra buttons container colors
6060
--background-extra-button-container-clusters: hsl(155 30% 50%);

styles.css

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)