Skip to content

Commit

Permalink
Project structure and fixed 2 bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
YomoSK committed Nov 1, 2024
1 parent 3867ea4 commit a81cc14
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 35 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ node_modules
out
history.json

src-tauri/target
src-tauri/Cargo.lock
src-tauri/gen
rust-src/target
rust-src/Cargo.lock
rust-src/gen

# Added by cargo

Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Yomea Project
Yomea is currently in development state, at this point only Windows builds are shipped. Of course, you can ship your own builds by cloning this repository on your own machine but i do not guarantee compatibility. Your PRs to this project are welcomed.
Yomea is currently in development state, at this point no builds are shipped by developer.<br>

> [!NOTE]
> But heads up, you can build your own local builds by cloning this repository.<br>
**Also your PRs to this project are welcomed.**

## Steps to build this repository

> [!NOTE]
> Make sure you have installed `git` and `curl`.
**1.** Firstly clone Yomea repository onto your machine.
```bash
git clone https://github.com/YomoSK/yomea
```

[Website](https://yomea.dev)
1 change: 1 addition & 0 deletions public/topbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Yomea Project</h1>
8 changes: 4 additions & 4 deletions src-tauri/Cargo.toml → rust-src/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "app"
name = "yomea"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
description = "Web browser"
authors = ["Yomo"]
license = ""
repository = ""
repository = "https://github.com/YomoSK/yomea"
edition = "2021"
rust-version = "1.77.2"

Expand Down
3 changes: 3 additions & 0 deletions rust-src/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
tauri_build::build();
}
File renamed without changes.
1 change: 1 addition & 0 deletions rust-src/components/topbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>Yomea Project</p>
Binary file added rust-src/icons/icon.ico
Binary file not shown.
Binary file added rust-src/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 12 additions & 8 deletions src-tauri/src/lib.rs → rust-src/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[cfg_attr(mobile, tauri::mobile_entry_point)]
use tauri::{Builder, WindowBuilder, WebviewBuilder, WebviewUrl, LogicalPosition, LogicalSize};
use tauri::{Builder, LogicalPosition, LogicalSize, WebviewBuilder, WebviewUrl, WindowBuilder};
use serde_json::Value;

pub fn run() {
Expand All @@ -8,34 +7,39 @@ pub fn run() {

Builder::default()
.setup(move |app| {
let topbarcomponent = "topbar.html".into();

let width = size.get("width").and_then(Value::as_f64).unwrap();
let height = size.get("height").and_then(Value::as_f64).unwrap();

let window = WindowBuilder::new(app, "main")
.title(title)
.inner_size(size.get("width").and_then(Value::as_f64).unwrap(), size.get("height").and_then(Value::as_f64).unwrap())
.inner_size(width, height)
.build()?;

let topbar = WebviewBuilder::new(
"topbar",
WebviewUrl::External("https://google.com/".parse().unwrap())
WebviewUrl::App(topbarcomponent)
);

let webview = WebviewBuilder::new(
"webview",
WebviewUrl::External("https://yomea.dev/".parse().unwrap())
WebviewUrl::External("https://google.com/".parse().unwrap())
);

window.add_child(
topbar.auto_resize(),
LogicalPosition::new(0.0, 0.0),
LogicalSize::new(size.get("width").and_then(Value::as_f64).unwrap(), 60.0)
LogicalSize::new(width, 60.0)
)?;

window.add_child(
webview.auto_resize(),
LogicalPosition::new(0.0, 60.0),
LogicalSize::new(size.get("width").and_then(Value::as_f64).unwrap(), size.get("height").and_then(Value::as_f64).unwrap() - 60.0)
LogicalSize::new(width, height - 60.0)
)?;

// window.maximize()?;
window.set_size(LogicalSize::new(width, height))?;

Ok(())
})
Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/main.rs → rust-src/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

fn main() {
Expand Down
24 changes: 24 additions & 0 deletions rust-src/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://schema.tauri.app/config/2.0.0-rc",
"productName": "yomea",
"version": "0.1.0",
"identifier": "me.Yomo.Yomea",
"app": {
"withGlobalTauri": true,
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"targets": "all",
"windows": {
"webviewInstallMode": {
"type": "offlineInstaller"
}
}
},
"build": {
"frontendDist": "./components"
}
}
3 changes: 0 additions & 3 deletions src-tauri/build.rs

This file was deleted.

Binary file removed src-tauri/icons/icon.ico
Binary file not shown.
15 changes: 0 additions & 15 deletions src-tauri/tauri.conf.json

This file was deleted.

0 comments on commit a81cc14

Please sign in to comment.