snapResizer(!$tagsCollapsed)}
+ on:release={() => {
+ snapResizer(snapTags);
+ }}
+ >
{
@@ -564,36 +592,28 @@ the AddCards dialog) should be implemented in the user of this component.
{@html tagAmount > 0 ? `${tagAmount} Tags` : ""}
- {/if}
-
- {
- if ($tagsCollapsed) {
- expandTags();
- bridgeCommand("expandTags");
- $tagsCollapsed = false;
- } else {
- collapseTags();
- bridgeCommand("collapseTags");
- $tagsCollapsed = true;
- }
- }}
- />
+
{
tagsPane.height = e.detail.height;
- $tagsCollapsed = tagsPane.height == 0;
+ if (tagsPane.maxHeight > 0) {
+ snapTags = tagsPane.height < tagsPane.maxHeight / 2;
+ }
}}
+ --opacity={(() => {
+ if (!$tagsCollapsed) {
+ return 1;
+ } else {
+ return snapTags ? tagsPane.height / tagsPane.maxHeight : 1;
+ }
+ })()}
>
{
@@ -617,7 +637,4 @@ the AddCards dialog) should be implemented in the user of this component.
flex-direction: column;
height: 100%;
}
- .tags-expander {
- margin-top: 0.5rem;
- }
diff --git a/ts/tag-editor/tag-options-button/TagOptionsButton.svelte b/ts/tag-editor/tag-options-button/TagOptionsButton.svelte
index b6f39040b..69ad34ee6 100644
--- a/ts/tag-editor/tag-options-button/TagOptionsButton.svelte
+++ b/ts/tag-editor/tag-options-button/TagOptionsButton.svelte
@@ -25,6 +25,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
From e0e45c55b51982796ae0947c8af90f0d0b4786e7 Mon Sep 17 00:00:00 2001
From: Hikaru Y
Date: Fri, 14 Oct 2022 09:19:20 +0900
Subject: [PATCH 08/11] Fix maximized browser window not being restored (#2132)
---
qt/aqt/browser/browser.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/qt/aqt/browser/browser.py b/qt/aqt/browser/browser.py
index 22a354747..1afe0ae67 100644
--- a/qt/aqt/browser/browser.py
+++ b/qt/aqt/browser/browser.py
@@ -126,19 +126,22 @@ class Browser(QMainWindow):
self._closeEventHasCleanedUp = False
self.form = aqt.forms.browser.Ui_Dialog()
self.form.setupUi(self)
- restoreGeom(self, "editor", 0)
- restoreSplitter(self.form.splitter, "editor3")
self.form.splitter.setChildrenCollapsible(False)
# set if exactly 1 row is selected; used by the previewer
self.card: Card | None = None
self.current_card: Card | None = None
self.setupSidebar()
- # make sure to call restoreState() after QDockWidget is attached to QMainWindow
- restoreState(self, "editor")
self.setup_table()
self.setupMenus()
self.setupHooks()
self.setupEditor()
+
+ # restoreXXX() should be called after all child widgets have been created
+ # and attached to QMainWindow
+ restoreGeom(self, "editor", 0)
+ restoreSplitter(self.form.splitter, "editor3")
+ restoreState(self, "editor")
+
# responsive layout
self.aspect_ratio = self.width() / self.height()
self.set_layout(self.mw.pm.browser_layout(), True)
From c22f6022fc59182d89079e4772c9083714969778 Mon Sep 17 00:00:00 2001
From: Damien Elmes
Date: Sat, 15 Oct 2022 10:58:43 +1000
Subject: [PATCH 09/11] Add Christos to about
---
qt/aqt/about.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/qt/aqt/about.py b/qt/aqt/about.py
index 9197d7caa..643317304 100644
--- a/qt/aqt/about.py
+++ b/qt/aqt/about.py
@@ -226,6 +226,7 @@ def show(mw: aqt.AnkiQt) -> QDialog:
"Nicholas Flint",
"Daniel Vieira Memoria10X",
"Luka Warren",
+ "Christos Longros",
)
)
From fb9c934ef2009572526f9e25d8497af5125aae16 Mon Sep 17 00:00:00 2001
From: Damien Elmes
Date: Mon, 17 Oct 2022 09:57:36 +1000
Subject: [PATCH 10/11] Use protoc from Bazel if missing from path
Closes #2134
---
Cargo.lock | 1 +
cargo/BUILD.bazel | 9 +++++++++
pylib/rsbridge/cargo/BUILD.bazel | 9 +++++++++
rslib/BUILD.bazel | 1 +
rslib/Cargo.toml | 1 +
rslib/build/protobuf.rs | 28 +++++++++++++++++++++++++++-
rslib/cargo/BUILD.bazel | 9 +++++++++
rslib/i18n/cargo/BUILD.bazel | 9 +++++++++
rslib/i18n_helpers/cargo/BUILD.bazel | 9 +++++++++
rslib/linkchecker/cargo/BUILD.bazel | 9 +++++++++
10 files changed, 84 insertions(+), 1 deletion(-)
diff --git a/Cargo.lock b/Cargo.lock
index 068f85711..da19d3704 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -118,6 +118,7 @@ dependencies = [
"unicase",
"unicode-normalization",
"utime",
+ "which",
"zip",
"zstd",
]
diff --git a/cargo/BUILD.bazel b/cargo/BUILD.bazel
index 2b529535e..42a561ba5 100644
--- a/cargo/BUILD.bazel
+++ b/cargo/BUILD.bazel
@@ -579,6 +579,15 @@ alias(
],
)
+alias(
+ name = "which",
+ actual = "@raze__which__4_3_0//:which",
+ tags = [
+ "cargo-raze",
+ "manual",
+ ],
+)
+
alias(
name = "zip",
actual = "@raze__zip__0_6_2//:zip",
diff --git a/pylib/rsbridge/cargo/BUILD.bazel b/pylib/rsbridge/cargo/BUILD.bazel
index 5104f9b3e..cf09ad565 100644
--- a/pylib/rsbridge/cargo/BUILD.bazel
+++ b/pylib/rsbridge/cargo/BUILD.bazel
@@ -579,6 +579,15 @@ alias(
],
)
+alias(
+ name = "which",
+ actual = "@raze__which__4_3_0//:which",
+ tags = [
+ "cargo-raze",
+ "manual",
+ ],
+)
+
alias(
name = "zip",
actual = "@raze__zip__0_6_2//:zip",
diff --git a/rslib/BUILD.bazel b/rslib/BUILD.bazel
index 2c027a0b8..7dfb7abfb 100644
--- a/rslib/BUILD.bazel
+++ b/rslib/BUILD.bazel
@@ -31,6 +31,7 @@ cargo_build_script(
],
deps = [
"//rslib/cargo:prost_build",
+ "//rslib/cargo:which",
],
)
diff --git a/rslib/Cargo.toml b/rslib/Cargo.toml
index 3bc06a78c..efc87b693 100644
--- a/rslib/Cargo.toml
+++ b/rslib/Cargo.toml
@@ -23,6 +23,7 @@ required-features = ["bench"]
[build-dependencies]
prost-build = "0.11.1"
+which = "4.3.0"
[dev-dependencies]
env_logger = "0.9.1"
diff --git a/rslib/build/protobuf.rs b/rslib/build/protobuf.rs
index 4535be3e1..a51dfd097 100644
--- a/rslib/build/protobuf.rs
+++ b/rslib/build/protobuf.rs
@@ -1,7 +1,11 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-use std::{env, fmt::Write, path::PathBuf};
+use std::{
+ env,
+ fmt::Write,
+ path::{Path, PathBuf},
+};
struct CustomGenerator {}
@@ -71,6 +75,7 @@ fn service_generator() -> Box {
}
pub fn write_backend_proto_rs() {
+ maybe_add_protobuf_to_path();
let proto_dir = if let Ok(proto) = env::var("PROTO_TOP") {
PathBuf::from(proto).parent().unwrap().to_owned()
} else {
@@ -122,3 +127,24 @@ pub fn write_backend_proto_rs() {
.compile_protos(paths.as_slice(), &[proto_dir])
.unwrap();
}
+
+/// If PROTOC is not defined, and protoc is not on path, use the protoc
+/// fetched by Bazel so that Rust Analyzer does not fail.
+fn maybe_add_protobuf_to_path() {
+ if std::env::var("PROTOC").is_ok() {
+ return;
+ }
+ if which::which("protoc").is_ok() {
+ return;
+ }
+ let base = Path::new("../.bazel/out/../external");
+ let subpath = if cfg!(target_os = "windows") {
+ "protoc_bin_windows/bin/protoc.exe"
+ } else if cfg!(target_os = "macos") {
+ "protoc_bin_macos/bin/protoc"
+ } else {
+ "protoc_bin_linux_x86_64/bin/protoc"
+ };
+ let path = base.join(subpath);
+ std::env::set_var("PROTOC", path.to_str().unwrap());
+}
diff --git a/rslib/cargo/BUILD.bazel b/rslib/cargo/BUILD.bazel
index 5104f9b3e..cf09ad565 100644
--- a/rslib/cargo/BUILD.bazel
+++ b/rslib/cargo/BUILD.bazel
@@ -579,6 +579,15 @@ alias(
],
)
+alias(
+ name = "which",
+ actual = "@raze__which__4_3_0//:which",
+ tags = [
+ "cargo-raze",
+ "manual",
+ ],
+)
+
alias(
name = "zip",
actual = "@raze__zip__0_6_2//:zip",
diff --git a/rslib/i18n/cargo/BUILD.bazel b/rslib/i18n/cargo/BUILD.bazel
index 5104f9b3e..cf09ad565 100644
--- a/rslib/i18n/cargo/BUILD.bazel
+++ b/rslib/i18n/cargo/BUILD.bazel
@@ -579,6 +579,15 @@ alias(
],
)
+alias(
+ name = "which",
+ actual = "@raze__which__4_3_0//:which",
+ tags = [
+ "cargo-raze",
+ "manual",
+ ],
+)
+
alias(
name = "zip",
actual = "@raze__zip__0_6_2//:zip",
diff --git a/rslib/i18n_helpers/cargo/BUILD.bazel b/rslib/i18n_helpers/cargo/BUILD.bazel
index 5104f9b3e..cf09ad565 100644
--- a/rslib/i18n_helpers/cargo/BUILD.bazel
+++ b/rslib/i18n_helpers/cargo/BUILD.bazel
@@ -579,6 +579,15 @@ alias(
],
)
+alias(
+ name = "which",
+ actual = "@raze__which__4_3_0//:which",
+ tags = [
+ "cargo-raze",
+ "manual",
+ ],
+)
+
alias(
name = "zip",
actual = "@raze__zip__0_6_2//:zip",
diff --git a/rslib/linkchecker/cargo/BUILD.bazel b/rslib/linkchecker/cargo/BUILD.bazel
index 5104f9b3e..cf09ad565 100644
--- a/rslib/linkchecker/cargo/BUILD.bazel
+++ b/rslib/linkchecker/cargo/BUILD.bazel
@@ -579,6 +579,15 @@ alias(
],
)
+alias(
+ name = "which",
+ actual = "@raze__which__4_3_0//:which",
+ tags = [
+ "cargo-raze",
+ "manual",
+ ],
+)
+
alias(
name = "zip",
actual = "@raze__zip__0_6_2//:zip",
From b8c294bf4d1e3f0ac1de3abeb7cf4b54c02011a2 Mon Sep 17 00:00:00 2001
From: RumovZ
Date: Wed, 19 Oct 2022 12:08:58 +0200
Subject: [PATCH 11/11] Explicitly evaluate symlink on Windows (#2135)
---
rslib/build/protobuf.rs | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/rslib/build/protobuf.rs b/rslib/build/protobuf.rs
index a51dfd097..c8f85b131 100644
--- a/rslib/build/protobuf.rs
+++ b/rslib/build/protobuf.rs
@@ -137,14 +137,17 @@ fn maybe_add_protobuf_to_path() {
if which::which("protoc").is_ok() {
return;
}
- let base = Path::new("../.bazel/out/../external");
- let subpath = if cfg!(target_os = "windows") {
- "protoc_bin_windows/bin/protoc.exe"
- } else if cfg!(target_os = "macos") {
- "protoc_bin_macos/bin/protoc"
+ let path = if cfg!(target_os = "windows") {
+ let base = std::fs::read_link("../.bazel/out").unwrap();
+ base.join("../external/protoc_bin_windows/bin/protoc.exe")
} else {
- "protoc_bin_linux_x86_64/bin/protoc"
+ let base = Path::new("../.bazel/out/../external");
+ let subpath = if cfg!(target_os = "macos") {
+ "protoc_bin_macos/bin/protoc"
+ } else {
+ "protoc_bin_linux_x86_64/bin/protoc"
+ };
+ base.join(subpath)
};
- let path = base.join(subpath);
std::env::set_var("PROTOC", path.to_str().unwrap());
}