Skip to content

Commit 0141081

Browse files
Merge pull request #4 from Patitotective/devel
v2.0.0
2 parents f401106 + d2bb6a0 commit 0141081

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Using the information from the config object, ImTemplate creates a simple about
129129
![image](https://github.com/Patitotective/ImTemplate/assets/79225325/bd018f26-4d8f-4dd4-a7ea-cfece401a3b5)
130130

131131
## Prefs
132-
The preferences are data can change during runtime and data that you want to store for the future like the position and size of the window, this includes the settings like the language and theme.
132+
The preferences is the data that can change during runtime and that data that you want to store for the future like the position and size of the window, this includes the settings the user can change like the language and theme.
133133
The preferences are saved in a KDL file (using [kdl/prefs](https://patitotective.github.io/kdl-nim/kdl/prefs.html)).
134134
You just have to provide an object including all the data you want to store as fields:
135135
```nim
@@ -215,7 +215,7 @@ If you included `ghRepo` in the config, it will also generate an `AppImage.zsync
215215
If you included `appstreamPath`, it will get copied to `AppDir/usr/share/shareinfo/{config.name}.appdata.xml` (see https://docs.appimage.org/packaging-guide/optional/appstream.html).
216216

217217
### Creating a release
218-
ImTemplate has a [`build.yml` workflow](https://github.com/Patitotective/ImTemplate/blob/main/.github/workflows/build.yml) that automatically when you publish a release, builds an AppImage and an `.exe` file to then upload them as assets to the release.
218+
ImTemplate has a [`release.yml` workflow](https://github.com/Patitotective/ImTemplate/blob/main/.github/workflows/release.yml) that automatically when you publish a release, builds an AppImage and an `.exe` file to then upload them as assets to the release.
219219
This can take several minutes.
220220

221221
## Generated from ImTemplate

main.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ proc initApp(): App =
227227
else:
228228
raise
229229

230+
result.updatePrefs()
231+
230232
template initFonts(app: var App) =
231233
# Merge ForkAwesome icon font
232234
let config = utils.newImFontConfig(mergeMode = true)
@@ -291,7 +293,6 @@ proc main() =
291293
app.initFonts()
292294

293295
# Main loop
294-
# discard app.win.setWindowCloseCallback(closeCallback(, app.config.name))
295296
while not app.win.windowShouldClose:
296297
app.render()
297298

src/utils.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ proc cleanString*(str: string): string =
3939
str.strip()
4040
4141
proc updatePrefs*(app: var App) =
42-
# Update the values depending on the preferences here
42+
# Update values depending on the preferences here
43+
# This procedure is also called at the start of the app
4344
echo "Updating preferences..."
4445
4546
proc res*(app: App, path: string): string =

0 commit comments

Comments
 (0)