Skip to content

Commit

Permalink
1) css fixes
Browse files Browse the repository at this point in the history
2) app name for macOs
3) Mutable types for kotlin
  • Loading branch information
daveight committed Feb 10, 2024
1 parent 32f42fe commit 1443f38
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 11 deletions.
10 changes: 10 additions & 0 deletions build/configure/src/aqt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ fn build_css(build: &mut Build) -> Result<()> {
":ts:reviewer:highlight:atom-one-light.css",
":ts:reviewer:highlight:code-brewer.css",
":ts:reviewer:highlight:dracula.css",
":ts:reviewer:highlight:github.css",
":ts:reviewer:highlight:mono-blue.css",
":ts:reviewer:highlight:monokai-sublime.css",
":ts:reviewer:highlight:railscasts.css",
":ts:reviewer:highlight:rainbow.css",
":ts:reviewer:highlight:solarized-dark.css",
":ts:reviewer:highlight:solarized-light.css",
":ts:reviewer:highlight:tommorow.css",
":ts:reviewer:highlight:vs.css",
":ts:reviewer:highlight:zenburn.css",
],
".css",
);
Expand Down
90 changes: 90 additions & 0 deletions build/configure/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,96 @@ fn build_and_check_reviewer(build: &mut Build) -> Result<()> {
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:highlight:github.css",
CompileSass {
input: inputs!["ts/reviewer/highlight/github.css"],
output: "ts/reviewer/highlight/github.css",
deps: ":sass".into(),
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:highlight:mono-blue.css",
CompileSass {
input: inputs!["ts/reviewer/highlight/mono-blue.css"],
output: "ts/reviewer/highlight/mono-blue.css",
deps: ":sass".into(),
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:highlight:monokai-sublime.css",
CompileSass {
input: inputs!["ts/reviewer/highlight/monokai-sublime.css"],
output: "ts/reviewer/highlight/monokai-sublime.css",
deps: ":sass".into(),
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:highlight:railscasts.css",
CompileSass {
input: inputs!["ts/reviewer/highlight/railscasts.css"],
output: "ts/reviewer/highlight/railscasts.css",
deps: ":sass".into(),
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:highlight:rainbow.css",
CompileSass {
input: inputs!["ts/reviewer/highlight/rainbow.css"],
output: "ts/reviewer/highlight/rainbow.css",
deps: ":sass".into(),
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:highlight:solarized-dark.css",
CompileSass {
input: inputs!["ts/reviewer/highlight/solarized-dark.css"],
output: "ts/reviewer/highlight/solarized-dark.css",
deps: ":sass".into(),
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:highlight:solarized-light.css",
CompileSass {
input: inputs!["ts/reviewer/highlight/solarized-light.css"],
output: "ts/reviewer/highlight/solarized-light.css",
deps: ":sass".into(),
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:highlight:tommorow.css",
CompileSass {
input: inputs!["ts/reviewer/highlight/tommorow.css"],
output: "ts/reviewer/highlight/tommorow.css",
deps: ":sass".into(),
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:highlight:vs.css",
CompileSass {
input: inputs!["ts/reviewer/highlight/vs.css"],
output: "ts/reviewer/highlight/vs.css",
deps: ":sass".into(),
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:highlight:zenburn.css",
CompileSass {
input: inputs!["ts/reviewer/highlight/zenburn.css"],
output: "ts/reviewer/highlight/zenburn.css",
deps: ":sass".into(),
load_paths: vec!["."],
},
)?;
build.add(
"ts:reviewer:reviewer_extras_bundle.js",
EsbuildScript {
Expand Down
4 changes: 2 additions & 2 deletions pylib/anki/testing/framework/kotlin/kotlin_input_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def visit_list(self, node: SyntaxTree, context):
\t\tresult.add({{child.fn_name}}(node))
\t}
\treturn result''', child=child)
return ConverterFn(node.name, src, 'JsonNode', 'List<' + child.ret_type + '>')
return ConverterFn(node.name, src, 'JsonNode', 'MutableList<' + child.ret_type + '>')

def visit_map(self, node: SyntaxTree, context):
"""
Expand All @@ -59,7 +59,7 @@ def visit_map(self, node: SyntaxTree, context):
:return: converter fn
"""
converters = [self.render(child, context) for child in node.nodes]
ret_type = render_template('Map<{{converters[0].ret_type}}, {{converters[1].ret_type}}>', converters=converters)
ret_type = render_template('MutableMap<{{converters[0].ret_type}}, {{converters[1].ret_type}}>', converters=converters)
src = render_template('''
\tval result = mutableMapOf<{{converters[0].ret_type}}, {{converters[1].ret_type}}>()
\tval iterator = value.iterator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def visit_list(self, node: SyntaxTree, context):
\t\tresult.add({{child.fn_name}}(item))
\t}
\treturn result''', child=child)
return ConverterFn(node.name, src, 'List<' + child.arg_type + '>', 'List<' + child.ret_type + '>')
return ConverterFn(node.name, src, 'MutableList<' + child.arg_type + '>', 'List<' + child.ret_type + '>')

def visit_map(self, node: SyntaxTree, context):
"""
Expand All @@ -61,7 +61,7 @@ def visit_map(self, node: SyntaxTree, context):
\t\tresult.add({{converters[1].fn_name}}(entry.value))
\t}
return result''', converters=converters)
arg_type = 'Map<' + converters[0].arg_type + ', ' + converters[1].arg_type + '>'
arg_type = 'MutableMap<' + converters[0].arg_type + ', ' + converters[1].arg_type + '>'
return ConverterFn(node.name, src, arg_type, 'List<Any>')

def visit_int(self, node: SyntaxTree, context):
Expand Down
4 changes: 2 additions & 2 deletions pylib/anki/testing/framework/kotlin/kotlin_type_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def visit_list(self, node: SyntaxTree, context):
:param context: generation context
:return: Kotlin list-type declaration
"""
return 'List<' + self.render(node.first_child(), context) + '>'
return 'MutableList<' + self.render(node.first_child(), context) + '>'

def visit_map(self, node: SyntaxTree, context):
"""
Expand All @@ -42,7 +42,7 @@ def visit_map(self, node: SyntaxTree, context):
:param context: generation context
:return: Kotlin map-type declaration
"""
return 'Map<' + self.render(node.first_child(), context) + ', ' \
return 'MutableMap<' + self.render(node.first_child(), context) + ', ' \
+ self.render(node.second_child(), context) + '>'

def visit_int(self, node: SyntaxTree, context):
Expand Down
10 changes: 8 additions & 2 deletions qt/aqt/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,13 @@ def on_dialog_destroyed() -> None:
# WebView contents
######################################################################
abouttext = "<center><img src='/_anki/imgs/anki-logo-thin.png'></center>"
abouttext += f"<p>{tr.about_anki_is_a_friendly_intelligent_spaced()}"
abouttext += f"<p>{tr.about_anki_is_licensed_under_the_agpl3()}"
abouttext += "<p>" + _(
"AnkiCode is a fork of Anki. It's free and open source."
)
abouttext += "<p>" + _(
"AnkiCode is licensed under the AGPL3 license. Please see "
"the license file in the source distribution for more information."
)
abouttext += f"<p>{tr.about_version(val=version_with_build())}<br>"
abouttext += ("Python %s Qt %s PyQt %s<br>") % (
platform.python_version(),
Expand Down Expand Up @@ -230,6 +235,7 @@ def on_dialog_destroyed() -> None:
"hafatsat anki",
"Carlos Duarte",
"Edgar Benavent Català",
"Daveight (AnkiCode fork)"
)
)

Expand Down
Binary file modified qt/aqt/data/web/imgs/anki-logo-thin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion qt/aqt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ def setupMenus(self) -> None:
m.actionFullScreen.setShortcutContext(Qt.ShortcutContext.ApplicationShortcut)

def updateTitleBar(self) -> None:
self.setWindowTitle("Bobs")
self.setWindowTitle("AnkiCode")

# View
##########################################################################
Expand Down
4 changes: 2 additions & 2 deletions qt/bundle/mac/src/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Anki</string>
<string>AnkiCode</string>
<key>CFBundleShortVersionString</key>
<string>2.1.46</string>
<key>LSMinimumSystemVersion</key>
Expand Down Expand Up @@ -34,7 +34,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Anki</string>
<string>AnkiCode</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>NSHighResolutionCapable</key>
Expand Down

0 comments on commit 1443f38

Please sign in to comment.