Skip to content

Commit

Permalink
increase settings window size
Browse files Browse the repository at this point in the history
  • Loading branch information
0-don committed Dec 25, 2024
1 parent 562108c commit 9e1509a
Show file tree
Hide file tree
Showing 23 changed files with 2,714 additions and 2,606 deletions.
83 changes: 83 additions & 0 deletions project.inlang/clippy.babel
Original file line number Diff line number Diff line change
Expand Up @@ -7706,6 +7706,89 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>DATABASE_INFO</name>
<description/>
<comment/>
<translations>
<translation>
<language>ar-SA</language>
<approved>false</approved>
</translation>
<translation>
<language>bn-IN</language>
<approved>false</approved>
</translation>
<translation>
<language>de-DE</language>
<approved>false</approved>
</translation>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-ES</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-FR</language>
<approved>false</approved>
</translation>
<translation>
<language>hi-IN</language>
<approved>false</approved>
</translation>
<translation>
<language>it-IT</language>
<approved>false</approved>
</translation>
<translation>
<language>ja-JP</language>
<approved>false</approved>
</translation>
<translation>
<language>ko-KR</language>
<approved>false</approved>
</translation>
<translation>
<language>nl-NL</language>
<approved>false</approved>
</translation>
<translation>
<language>pl-PL</language>
<approved>false</approved>
</translation>
<translation>
<language>pt-PT</language>
<approved>false</approved>
</translation>
<translation>
<language>ru-RU</language>
<approved>false</approved>
</translation>
<translation>
<language>th-TH</language>
<approved>false</approved>
</translation>
<translation>
<language>tr-TR</language>
<approved>false</approved>
</translation>
<translation>
<language>ur-PK</language>
<approved>false</approved>
</translation>
<translation>
<language>vi-VN</language>
<approved>false</approved>
</translation>
<translation>
<language>zh-CN</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>SQL_DATABASE_INFO</name>
<description/>
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub static MAIN_WINDOW_Y: i32 = 600;
pub static ABOUT_WINDOW_X: i32 = 375;
pub static ABOUT_WINDOW_Y: i32 = 600;

pub static SETTINGS_WINDOW_X: i32 = 500;
pub static SETTINGS_WINDOW_X: i32 = 580;
pub static SETTINGS_WINDOW_Y: i32 = 580;

pub static MAX_IMAGE_DIMENSIONS: u32 = 1280;
Expand Down
76 changes: 38 additions & 38 deletions src/components/elements/dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
import { VsArrowSwap } from "solid-icons/vs";
import { Component, createSignal } from "solid-js";
import { DictionaryKey } from "../../lib/i18n";

import { useLanguage } from "../provider/language-provider";

interface DropdownProps {
className?: string;
items: { value: string; label: string }[];
value: string;
onChange: (value: string) => void;
}

export const Dropdown: Component<DropdownProps> = (props) => {
const { t } = useLanguage();
const [ref, setRef] = createSignal<HTMLSelectElement>();

return (
<div
onClick={() => ref()?.dispatchEvent(new MouseEvent("mousedown"))}
class={`${props.className ? props.className : ""} group flex items-center justify-between rounded-md border border-gray-300 p-1 px-1.5 text-sm focus:outline-none focus:ring-0 dark:border-dark-light dark:bg-dark-light dark:text-white`}
>
<select
ref={setRef}
value={props.value}
onChange={(e) => props.onChange(e.target.value)}
class="appearance-none bg-transparent text-sm focus:outline-none focus:ring-0"
>
{props.items.map((item) => (
<option value={item.value} selected={item.value === props.value} class="!text-red-500 dark:!text-red-600">
{t(item.label as DictionaryKey) || item.label}
</option>
))}
</select>
<VsArrowSwap class="rotate-90 group-hover:text-indigo-200" />
</div>
);
};
import { VsArrowSwap } from "solid-icons/vs";
import { Component, createSignal } from "solid-js";
import { DictionaryKey } from "../../lib/i18n";

import { useLanguage } from "../provider/language-provider";

interface DropdownProps {
className?: string;
items: { value: string; label: string }[];
value: string;
onChange: (value: string) => void;
}

export const Dropdown: Component<DropdownProps> = (props) => {
const { t } = useLanguage();
const [ref, setRef] = createSignal<HTMLSelectElement>();

return (
<div
onClick={() => ref()?.dispatchEvent(new MouseEvent("mousedown"))}
class={`${props.className ? props.className : ""} group flex items-center justify-between rounded-md border border-gray-300 p-1 px-1.5 text-sm focus:outline-none focus:ring-0 dark:border-dark-light dark:bg-dark-light dark:text-white`}
>
<select
ref={setRef}
value={props.value}
onChange={(e) => props.onChange(e.target.value)}
class="appearance-none bg-transparent text-sm focus:outline-none focus:ring-0"
>
{props.items.map((item) => (
<option value={item.value} selected={item.value === props.value} class="!text-red-500 dark:!text-red-600">
{t(item.label as DictionaryKey) || item.label}
</option>
))}
</select>
<VsArrowSwap class="rotate-90 group-hover:text-indigo-200" />
</div>
);
};
10 changes: 8 additions & 2 deletions src/components/pages/settings/settings-history.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BsDeviceHdd } from "solid-icons/bs";
import { FiTrash2 } from "solid-icons/fi";
import { SiSqlite } from "solid-icons/si";
import { Component, createResource } from "solid-js";
import { Component, createEffect, createResource } from "solid-js";
import { DictionaryKey } from "../../../lib/i18n";
import { invokeCommand } from "../../../lib/tauri";
import { ClipboardType } from "../../../types/enums";
Expand All @@ -28,12 +28,18 @@ export const SettingsHistory: Component = () => {
refetch();
};

createEffect(() => {
console.log(databaseInfo());
});
return (
<>
<TextBlock Icon={SiSqlite} title={t("SETTINGS.HISTORY.SQL_DATABASE_INFO")}>
<ul class="mx-5 list-disc px-5 pb-5">
<li>
{`${databaseInfo()?.records} local items (${formatBytes(databaseInfo()?.size)}) are saved on this computer`}
{t("SETTINGS.HISTORY.DATABASE_INFO", {
records: databaseInfo()?.records || 0,
size: formatBytes(databaseInfo()?.size),
})}
</li>
</ul>
</TextBlock>
Expand Down
Loading

0 comments on commit 9e1509a

Please sign in to comment.