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

Fix deck config input's background color in Qt5 #3243

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions ts/lib/components/ConfigInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import { pageTheme } from "$lib/sveltelib/theme";
const rtl: boolean = window.getComputedStyle(document.body).direction == "rtl";
export let grow = true;
Expand All @@ -11,6 +13,7 @@
<div
class="config-input position-relative justify-content-end"
class:flex-grow-1={grow}
class:nightMode={$pageTheme.isDark}
>
<div class="revert" class:rtl>
<slot name="revert" />
Expand Down Expand Up @@ -39,5 +42,9 @@
.revert:hover {
color: var(--fg);
}
&.nightMode :global(input),
&.nightMode :global(textarea) {
background-color: rgb(59, 59, 59);
}
}
</style>
5 changes: 3 additions & 2 deletions ts/routes/deck-options/FsrsOptions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import SpinBoxRow from "./SpinBoxRow.svelte";
import Warning from "./Warning.svelte";
import WeightsInputRow from "./WeightsInputRow.svelte";
import WeightsSearchRow from "./WeightsSearchRow.svelte";
export let state: DeckOptionsState;
export let openHelpModal: (String) => void;
Expand Down Expand Up @@ -281,11 +282,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</SettingTitle>
</WeightsInputRow>

<input
<WeightsSearchRow
bind:value={$config.weightSearch}
placeholder={defaultWeightSearch}
class="w-100 mb-1"
/>

<DateInput bind:date={$config.ignoreRevlogsBeforeDate}>
<SettingTitle on:click={() => openHelpModal("ignoreBefore")}>
{tr.deckConfigIgnoreBefore()}
Expand Down
14 changes: 14 additions & 0 deletions ts/routes/deck-options/WeightsSearchRow.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import ConfigInput from "$lib/components/ConfigInput.svelte";
export let value: string;
export let placeholder: string;
</script>

<ConfigInput>
<input bind:value {placeholder} class="w-100 mb-1" />
</ConfigInput>