From 369553007c4f92f3cbe5d63e0b82db5cec01998a Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Sat, 14 Oct 2023 04:18:27 +0300 Subject: [PATCH] improve style of select buttons --- src/main.rs | 11 +++++++++-- src/styles/global.css | 19 +++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1e15094..92aa214 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,7 @@ mod area_capture; mod config_management; mod ffmpeg_interface; mod timer; +mod wayland_record; use ffmpeg_interface::{Ffmpeg, ProgressWidget}; use gettextrs::{bindtextdomain, gettext, setlocale, textdomain, LocaleCategory}; @@ -22,8 +23,12 @@ use std::path::Path; use std::process::{Command, Stdio}; use std::rc::Rc; use timer::{recording_delay, start_timer, stop_timer}; +use wayland_record::WaylandRecorder; +use futures::executor; -fn main() { + +#[async_std::main] +async fn main() { // Create new application let application = Application::new(Some("sa.sy.blue-recorder"), Default::default()); application.connect_activate(build_ui); @@ -115,7 +120,8 @@ pub fn build_ui(application: &Application) { // Hide window grab button in Wayland if is_wayland() { - window_grab_button.hide(); + area_grab_button.set_can_target(false); + area_grab_button.add_css_class("disabled") } // Entries @@ -469,6 +475,7 @@ pub fn build_ui(application: &Application) { window: main_window.clone(), overwrite: overwrite_switch, record_delay: delay_spin, + record_wayland: executor::block_on(WaylandRecorder::new()) })); // Record Button diff --git a/src/styles/global.css b/src/styles/global.css index 387c753..bb997c1 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -9,19 +9,10 @@ background: @theme_selected_bg_color; } -#area_grab_button:checked { +#area_grab_button:checked, #screen_grab_button:checked, #window_grab_button:checked { color: @theme_selected_fg_color; - background: @theme_selected_bg_color; -} - -#screen_grab_button:checked { - color: @theme_selected_fg_color; - background: @theme_selected_bg_color; -} - -#window_grab_button:checked { - color: @theme_selected_fg_color; - background: @theme_selected_bg_color; + background: alpha(@theme_selected_bg_color, 0.5); + border: 1px solid @theme_selected_bg_color; } #delay_window { @@ -37,3 +28,7 @@ font-size: 120%; font-weight: 50; } + +.disabled { + opacity: 0.5; +} \ No newline at end of file