feat: Set up window size at app start
- Changed wording of load_config logging - Updated docs to mention Windows status
This commit is contained in:
parent
8ff9ce269d
commit
a8aacd1df5
4 changed files with 17 additions and 4 deletions
|
|
@ -16,7 +16,8 @@ By clicking on the timeline in Record mode you can hide controls to make app sma
|
||||||
Review mode may be used to show some activity, tracked on another day:
|
Review mode may be used to show some activity, tracked on another day:
|
||||||

|

|
||||||
|
|
||||||
Aliveline currently supports Linux only, but you can compile it to your platform.
|
Aliveline currently supports Linux only, but Windows executable seems to work.
|
||||||
|
You can also compile Aliveline yourself (see building section).
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
@ -38,7 +39,8 @@ Requirements:
|
||||||
- Slint dependencies (see [Platforms](https://docs.slint.dev/latest/docs/slint/guide/platforms/desktop/) and [Backends & Renderers](https://docs.slint.dev/latest/docs/slint/guide/backends-and-renderers/backends_and_renderers/))
|
- Slint dependencies (see [Platforms](https://docs.slint.dev/latest/docs/slint/guide/platforms/desktop/) and [Backends & Renderers](https://docs.slint.dev/latest/docs/slint/guide/backends-and-renderers/backends_and_renderers/))
|
||||||
|
|
||||||
Instructions:
|
Instructions:
|
||||||
Run `cargo build --release`
|
Just run `cargo build --release` and the resulting binary can be located at `target/release/aliveline[.exe]` if compilation succeeds.
|
||||||
|
If compilation fails, double check that you have all required dependencies. If it still fails, file an issue on [Codeberg](https://codeberg.org/2ndbeam/aliveline/issues), including logs and system info.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
@ -46,6 +48,7 @@ Just run `aliveline` by any preferred way, for example:
|
||||||
```
|
```
|
||||||
$ ./aliveline
|
$ ./aliveline
|
||||||
```
|
```
|
||||||
|
or via file explorer.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
Aliveline tries to find config at:
|
Aliveline tries to find config at:
|
||||||
|
|
@ -62,4 +65,4 @@ If config isn't found, Aliveline uses default values defined in [config.toml](ht
|
||||||
Keep in mind that default paths are relative, and in this case logs will be written to and read from current working directory.
|
Keep in mind that default paths are relative, and in this case logs will be written to and read from current working directory.
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
You can contribute to Aliveline by creating an issue/PR on [Codeberg mirror](https://codeberg.org/2ndbeam/aliveline)
|
You can contribute to Aliveline by creating an issue/PR on [Codeberg mirror](https://codeberg.org/2ndbeam/aliveline/issues)
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ pub fn load_config() -> Config {
|
||||||
}
|
}
|
||||||
println!("Config not found at ${place_var} / {place:?}");
|
println!("Config not found at ${place_var} / {place:?}");
|
||||||
}
|
}
|
||||||
println!("Using last resort config path ./config.toml");
|
println!("Using config path ./config.toml");
|
||||||
Config::new(PathBuf::from("./config.toml"))
|
Config::new(PathBuf::from("./config.toml"))
|
||||||
}
|
}
|
||||||
/// Get random-like color id in range 0..16 by computing string hash
|
/// Get random-like color id in range 0..16 by computing string hash
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ use chrono::{Datelike, Timelike};
|
||||||
use slint::{Color, Model, ModelRc, SharedString, ToSharedString, VecModel, Weak};
|
use slint::{Color, Model, ModelRc, SharedString, ToSharedString, VecModel, Weak};
|
||||||
use toml::value::{Date as TomlDate, Time};
|
use toml::value::{Date as TomlDate, Time};
|
||||||
|
|
||||||
|
const DEFAULT_WINDOW_WIDTH: f32 = 800.;
|
||||||
|
const DEFAULT_WINDOW_HEIGHT: f32 = 600.;
|
||||||
|
|
||||||
slint::include_modules!();
|
slint::include_modules!();
|
||||||
|
|
||||||
impl From<Event> for TimelineEvent {
|
impl From<Event> for TimelineEvent {
|
||||||
|
|
@ -106,6 +109,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
load_colors(ui_weak, config_arc);
|
load_colors(ui_weak, config_arc);
|
||||||
|
|
||||||
ui.invoke_update_record_offset(offset as i32);
|
ui.invoke_update_record_offset(offset as i32);
|
||||||
|
ui.invoke_update_window_size(DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT);
|
||||||
|
|
||||||
ui.on_fetch_log({
|
ui.on_fetch_log({
|
||||||
let config = config.clone();
|
let config = config.clone();
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export component AppWindow inherits Window {
|
||||||
callback new-day-started <=> record.new-day-started;
|
callback new-day-started <=> record.new-day-started;
|
||||||
callback get-previous-event <=> record.get-previous-event;
|
callback get-previous-event <=> record.get-previous-event;
|
||||||
callback update-record-offset(int);
|
callback update-record-offset(int);
|
||||||
|
callback update-window-size(length, length);
|
||||||
callback save-log;
|
callback save-log;
|
||||||
|
|
||||||
callback fetch-log <=> review.fetch-log;
|
callback fetch-log <=> review.fetch-log;
|
||||||
|
|
@ -21,6 +22,11 @@ export component AppWindow inherits Window {
|
||||||
record.offset = new-offset;
|
record.offset = new-offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update-window-size(width, height) => {
|
||||||
|
self.width = width;
|
||||||
|
self.height = height;
|
||||||
|
}
|
||||||
|
|
||||||
in-out property record-events <=> record.events;
|
in-out property record-events <=> record.events;
|
||||||
in-out property record-offset <=> record.offset;
|
in-out property record-offset <=> record.offset;
|
||||||
in-out property record-visible-time <=> record.visible-time;
|
in-out property record-visible-time <=> record.visible-time;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue