diff --git a/src/gstreamer/mod.rs b/src/gstreamer/mod.rs index 46d8747..5f00a64 100644 --- a/src/gstreamer/mod.rs +++ b/src/gstreamer/mod.rs @@ -8,6 +8,7 @@ use cosmic::{ iced::{ event::{self, Event}, keyboard::{Event as KeyEvent, Key, Modifiers}, + mouse::Event as MouseEvent, subscription::{self, Subscription}, window, Alignment, Color, Length, Limits, Size, }, @@ -19,7 +20,11 @@ use iced_video_player::{ gst::{self, prelude::*}, gst_pbutils, Video, VideoPlayer, }; -use std::{any::TypeId, collections::HashMap, time::Duration}; +use std::{ + any::TypeId, + collections::HashMap, + time::{Duration, Instant}, +}; use crate::{ config::{Config, CONFIG_VERSION}, @@ -27,6 +32,8 @@ use crate::{ localize, }; +static CONTROLS_TIMEOUT: Duration = Duration::new(2, 0); + /// Runs application with these settings #[rustfmt::skip] pub fn main() -> Result<(), Box> { @@ -110,6 +117,7 @@ pub enum Message { MissingPlugin(gst::Message), NewFrame, Reload, + ShowControls, SystemThemeModeChange(cosmic_theme::ThemeMode), } @@ -117,6 +125,8 @@ pub enum Message { pub struct App { core: Core, flags: Flags, + controls: bool, + controls_time: Instant, fullscreen: bool, key_binds: HashMap, video_opt: Option