Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fksms committed Jan 24, 2025
1 parent 57f024a commit 4c92d38
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/ViewDirectoryFileList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { ref } from "vue";
import { detectOS } from "./DetectOS";
import { detectOS } from "./detectOS";
// 親から渡されたコンポーネントの参照を受け取る
const props = defineProps(["viewSunburstChart"]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ViewHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { invoke } from "@tauri-apps/api/core";
import { listen } from "@tauri-apps/api/event";
import i18n from "./i18n";
import { detectOS } from "./DetectOS";
import { detectOS } from "./detectOS";
import ViewSettings from "./dialog/ViewSettings.vue";
// 親から渡されたコンポーネントの参照を受け取る
Expand Down
13 changes: 8 additions & 5 deletions src/components/ViewSunburstChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ const circleLightOnColorCodes = "#B0BEC5";
// ディレクトリのカラーコード(原色)
const directoryColorCodes = ["#FF0000", "#FF8000", "#FFFF00", "#80FF00", "#00FF00", "#00FF80", "#00FFFF", "#0080FF", "#0000FF", "#8000FF", "#FF00FF", "#FF0080"];
// ファイルのカラーコード(ライトグレー)
// ルートディレクトリのカラーコード
const rootDirectoryColorCode = "#FFFFFF00";
// ファイルのカラーコード
const fileColorCode = "#C6C6C6";
// squashされた部分のカラーコード(ダークグレー)
// squashされた部分のカラーコード
const squashedColorCode = "#777777";
// --------------------パラメータ--------------------
Expand Down Expand Up @@ -151,7 +154,7 @@ function generateSunburst(data) {
if (d.children) {
// depthが0以下の場合
if (d.depth <= 0) {
d.color = "#FFFFFF00"; // 透明
d.color = rootDirectoryColorCode;
}
// depthが1の場合
else if (d.depth == 1) {
Expand All @@ -176,7 +179,7 @@ function generateSunburst(data) {
}
// 子ノードが無い場合
else {
d.color = fileColorCode; // ライトグレー
d.color = fileColorCode;
}
});
Expand Down Expand Up @@ -488,7 +491,7 @@ function updateArc(node, isFirstCalled) {
// d属性(パス)を設定
.attr("d", arc(squashedArcCoordinates))
// fill属性(塗りつぶし)を設定
.attr("fill", squashedColorCode) // ダークグレー
.attr("fill", squashedColorCode)
// カーソルを合わせた時
.on("mouseenter", (event, d) => mouseEntered(event, d, option))
// カーソルを離した時
Expand Down
30 changes: 30 additions & 0 deletions src/components/detectOS.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// OSを判定
//
// returnは("Mac" || "Windows" || "Linux" || null)
function detectOS() {
const ua = navigator.userAgent;

if (!ua) {
return null;
}

if (ua.indexOf("Mac") > -1) {
return "Mac";
}

else if (ua.indexOf("Windows") > -1) {
return "Windows";
}

else if (ua.indexOf("Linux") > -1) {
return "Linux";
}

else {
return null;
}
}


// 外部に公開
export { detectOS }
2 changes: 1 addition & 1 deletion src/components/dialog/ViewSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ref, computed } from "vue";
import i18n from "../i18n";
import { detectOS } from "../DetectOS";
import { detectOS } from "../detectOS";
import ViewSettingsGeneral from "./ViewSettingsGeneral.vue";
import ViewSettingsLanguage from "./ViewSettingsLanguage.vue";
import ViewSettingsPermissions from "./ViewSettingsPermissions.vue";
Expand Down

0 comments on commit 4c92d38

Please sign in to comment.