Browse Source

Merge branch 'main' of github.com:Tim-Paik/neutauri

main
Tim-Paik 2 months ago
parent
commit
ed45c5dcd5
Signed by: Tim-Paik
GPG Key ID: DC36A050DB42566D
  1. 24
      .drone.yml
  2. 15
      neutauri_bundler/src/dev.rs
  3. 7
      neutauri_runtime/src/main.rs

24
.drone.yml

@ -1,6 +1,6 @@
kind: pipeline
type: docker
name: default
name: build
steps:
- name: build
@ -27,4 +27,24 @@ steps:
- sha256
when:
event:
- tag
- tag
---
kind: pipeline
type: docker
name: clippy
steps:
- name: clippy
image: ubuntu:latest
commands:
- echo '========Install the necessary environment========'
- apt update && apt install -y curl gcc git libwebkit2gtk-4.0-dev libappindicator3-dev
- echo '========Install the Rust toolchain========'
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -c clippy -y
- echo '========Compile the Neutauri binary========'
- $HOME/.cargo/bin/cargo build --release --bin neutauri_runtime
- $HOME/.cargo/bin/cargo build --release --bin neutauri_bundler
- echo '========Run Cargo Clippy========'
- $HOME/.cargo/bin/cargo clippy

15
neutauri_bundler/src/dev.rs

@ -57,15 +57,12 @@ pub fn dev(config_path: String) -> wry::Result<()> {
)?)),
None => window_builder,
};
let monitor_size = event_loop
.primary_monitor()
.unwrap_or_else(|| {
event_loop
.available_monitors()
.next()
.expect("no monitor found")
})
.size();
let monitor_size = event_loop.primary_monitor().unwrap_or_else(|| {
event_loop
.available_monitors()
.next()
.expect("no monitor found")
}).size();
let window_builder = match config.window_attr()?.inner_size {
Some(size) => window_builder.with_inner_size(get_size(size, monitor_size)),
None => window_builder,

7
neutauri_runtime/src/main.rs

@ -58,14 +58,12 @@ fn main() -> wry::Result<()> {
)?)),
None => window_builder,
};
let monitor = event_loop.primary_monitor().unwrap_or_else(|| {
let monitor_size = event_loop.primary_monitor().unwrap_or_else(|| {
event_loop
.available_monitors()
.next()
.expect("no monitor found")
});
let monitor_size = monitor.size();
let monitor_scale_factor = monitor.scale_factor();
}).size();
let window_builder = match res.window_attr.inner_size {
Some(size) => window_builder.with_inner_size(get_size(size, monitor_size)),
None => window_builder,
@ -169,7 +167,6 @@ fn main() -> wry::Result<()> {
})
.with_devtools(false)
.build()?;
webview.zoom(monitor_scale_factor);
event_loop.run(move |event, _, control_flow| {
*control_flow = ControlFlow::Wait;

Loading…
Cancel
Save