generated from PlexSheep/baserepo
some ui?
This commit is contained in:
parent
ea64c755e9
commit
ed96ea20ca
|
@ -6,4 +6,6 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.75"
|
||||
gstreamer = "0.21.2"
|
||||
gtk = { version = "0.7.3", package = "gtk4", features = ["v4_8"] }
|
||||
|
|
48
src/main.rs
48
src/main.rs
|
@ -1,5 +1,6 @@
|
|||
use gtk::prelude::*;
|
||||
use gtk::{glib, Application, ApplicationWindow};
|
||||
use gtk::{prelude::*,ListBox, glib, Application, ApplicationWindow, Button, Video, Box, LayoutManager, ffi::gtk_layout_manager_allocate};
|
||||
|
||||
mod video;
|
||||
|
||||
const APP_ID: &str = "de.cscherr.vshot";
|
||||
|
||||
|
@ -15,10 +16,53 @@ fn main() -> glib::ExitCode {
|
|||
}
|
||||
|
||||
fn build_ui(app: &Application) {
|
||||
let select_button = Button::builder()
|
||||
.label("select video")
|
||||
.margin_top(12)
|
||||
.margin_bottom(12)
|
||||
.margin_start(12)
|
||||
.margin_end(12)
|
||||
.build();
|
||||
select_button.connect_clicked(|button| {
|
||||
println!("TODO");
|
||||
});
|
||||
let save_image_button = Button::builder()
|
||||
.label("save")
|
||||
.margin_top(12)
|
||||
.margin_bottom(12)
|
||||
.margin_start(12)
|
||||
.margin_end(12)
|
||||
.build();
|
||||
save_image_button.connect_clicked(|button| {
|
||||
println!("TODO");
|
||||
});
|
||||
|
||||
let video_play = Video::builder()
|
||||
.build();
|
||||
// Create a `ListBox` and add labels with integers from 0 to 100
|
||||
let meta_box = Box::builder()
|
||||
.build();
|
||||
meta_box.append(&save_image_button);
|
||||
meta_box.append(&select_button);
|
||||
let video_box = Box::builder()
|
||||
.height_request(550)
|
||||
.width_request(750)
|
||||
.orientation(gtk::Orientation::Vertical)
|
||||
.build();
|
||||
video_box.append(&video_play);
|
||||
|
||||
let list = ListBox::builder()
|
||||
.build();
|
||||
list.append(&video_box);
|
||||
list.append(&meta_box);
|
||||
|
||||
// Create a window and set the title
|
||||
let window = ApplicationWindow::builder()
|
||||
.application(app)
|
||||
.title("vshot")
|
||||
.child(&list)
|
||||
.default_height(600)
|
||||
.default_width(800)
|
||||
.build();
|
||||
|
||||
// Present window
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
use std::{
|
||||
env,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
use anyhow::Error;
|
||||
use gstreamer::prelude::*;
|
||||
|
||||
|
||||
fn try_play_video(uri: &str) -> Result<(), Error> {
|
||||
print!("hello world!");
|
||||
return Ok(())
|
||||
}
|
Loading…
Reference in New Issue