mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Compare commits
No commits in common. "main" and "25.09.1" have entirely different histories.
8 changed files with 3 additions and 43 deletions
2
.version
2
.version
|
@ -1 +1 @@
|
|||
25.09.2
|
||||
25.09.1
|
||||
|
|
|
@ -27,9 +27,6 @@ service FrontendService {
|
|||
rpc deckOptionsRequireClose(generic.Empty) returns (generic.Empty);
|
||||
// Warns python that the deck option web view is ready to receive requests.
|
||||
rpc deckOptionsReady(generic.Empty) returns (generic.Empty);
|
||||
|
||||
// Save colour picker's custom colour palette
|
||||
rpc SaveCustomColours(generic.Empty) returns (generic.Empty);
|
||||
}
|
||||
|
||||
service BackendFrontendService {}
|
||||
|
|
|
@ -151,7 +151,6 @@ class Editor:
|
|||
self.add_webview()
|
||||
self.setupWeb()
|
||||
self.setupShortcuts()
|
||||
self.setupColourPalette()
|
||||
gui_hooks.editor_did_init(self)
|
||||
|
||||
# Initial setup
|
||||
|
@ -350,14 +349,6 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
|
|||
keys, fn, _ = row
|
||||
QShortcut(QKeySequence(keys), self.widget, activated=fn) # type: ignore
|
||||
|
||||
def setupColourPalette(self) -> None:
|
||||
if not (colors := self.mw.col.get_config("customColorPickerPalette")):
|
||||
return
|
||||
for i, colour in enumerate(colors[: QColorDialog.customCount()]):
|
||||
if not QColor.isValidColorName(colour):
|
||||
continue
|
||||
QColorDialog.setCustomColor(i, QColor.fromString(colour))
|
||||
|
||||
def _addFocusCheck(self, fn: Callable) -> Callable:
|
||||
def checkFocus() -> None:
|
||||
if self.currentField is None:
|
||||
|
|
|
@ -599,15 +599,6 @@ def deck_options_ready() -> bytes:
|
|||
return b""
|
||||
|
||||
|
||||
def save_custom_colours() -> bytes:
|
||||
colors = [
|
||||
QColorDialog.customColor(i).name(QColor.NameFormat.HexArgb)
|
||||
for i in range(QColorDialog.customCount())
|
||||
]
|
||||
aqt.mw.col.set_config("customColorPickerPalette", colors)
|
||||
return b""
|
||||
|
||||
|
||||
post_handler_list = [
|
||||
congrats_info,
|
||||
get_deck_configs_for_update,
|
||||
|
@ -623,7 +614,6 @@ post_handler_list = [
|
|||
search_in_browser,
|
||||
deck_options_require_close,
|
||||
deck_options_ready,
|
||||
save_custom_colours,
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
-->
|
||||
<script lang="ts">
|
||||
import Shortcut from "$lib/components/Shortcut.svelte";
|
||||
import { saveCustomColours } from "@generated/backend";
|
||||
|
||||
export let keyCombination: string | null = null;
|
||||
export let value: string;
|
||||
|
@ -12,15 +11,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
let inputRef: HTMLInputElement;
|
||||
</script>
|
||||
|
||||
<input
|
||||
bind:this={inputRef}
|
||||
tabindex="-1"
|
||||
type="color"
|
||||
bind:value
|
||||
on:input
|
||||
on:change
|
||||
on:click={() => saveCustomColours({})}
|
||||
/>
|
||||
<input bind:this={inputRef} tabindex="-1" type="color" bind:value on:input on:change />
|
||||
|
||||
{#if keyCombination}
|
||||
<Shortcut {keyCombination} on:action={() => inputRef.click()} />
|
||||
|
|
|
@ -19,7 +19,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
import ColorPicker from "./ColorPicker.svelte";
|
||||
import { context as editorToolbarContext } from "./EditorToolbar.svelte";
|
||||
import WithColorHelper from "./WithColorHelper.svelte";
|
||||
import { saveCustomColours } from "@generated/backend";
|
||||
|
||||
export let color: string;
|
||||
|
||||
|
@ -135,10 +134,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
color = setColor(event);
|
||||
bridgeCommand(`lastHighlightColor:${color}`);
|
||||
}}
|
||||
on:change={() => {
|
||||
setTextColor();
|
||||
saveCustomColours({});
|
||||
}}
|
||||
on:change={() => setTextColor()}
|
||||
/>
|
||||
</IconButton>
|
||||
</WithColorHelper>
|
||||
|
|
|
@ -22,7 +22,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
import ColorPicker from "./ColorPicker.svelte";
|
||||
import { context as editorToolbarContext } from "./EditorToolbar.svelte";
|
||||
import WithColorHelper from "./WithColorHelper.svelte";
|
||||
import { saveCustomColours } from "@generated/backend";
|
||||
|
||||
export let color: string;
|
||||
|
||||
|
@ -159,7 +158,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
setTimeout(() => {
|
||||
setTextColor();
|
||||
}, 200);
|
||||
saveCustomColours({});
|
||||
}}
|
||||
/>
|
||||
</IconButton>
|
||||
|
|
|
@ -10,9 +10,6 @@ export function allImagesLoaded(): Promise<void[]> {
|
|||
}
|
||||
|
||||
function imageLoaded(img: HTMLImageElement): Promise<void> {
|
||||
if (!img.getAttribute("decoding")) {
|
||||
img.decoding = "async";
|
||||
}
|
||||
return img.complete
|
||||
? Promise.resolve()
|
||||
: new Promise((resolve) => {
|
||||
|
|
Loading…
Reference in a new issue