improve style of select buttons

This commit is contained in:
Salem Yaslem 2023-10-14 04:18:27 +03:00
parent af982bea00
commit 369553007c
2 changed files with 16 additions and 14 deletions

View File

@ -6,6 +6,7 @@ mod area_capture;
mod config_management; mod config_management;
mod ffmpeg_interface; mod ffmpeg_interface;
mod timer; mod timer;
mod wayland_record;
use ffmpeg_interface::{Ffmpeg, ProgressWidget}; use ffmpeg_interface::{Ffmpeg, ProgressWidget};
use gettextrs::{bindtextdomain, gettext, setlocale, textdomain, LocaleCategory}; use gettextrs::{bindtextdomain, gettext, setlocale, textdomain, LocaleCategory};
@ -22,8 +23,12 @@ use std::path::Path;
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use std::rc::Rc; use std::rc::Rc;
use timer::{recording_delay, start_timer, stop_timer}; 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 // Create new application
let application = Application::new(Some("sa.sy.blue-recorder"), Default::default()); let application = Application::new(Some("sa.sy.blue-recorder"), Default::default());
application.connect_activate(build_ui); application.connect_activate(build_ui);
@ -115,7 +120,8 @@ pub fn build_ui(application: &Application) {
// Hide window grab button in Wayland // Hide window grab button in Wayland
if is_wayland() { if is_wayland() {
window_grab_button.hide(); area_grab_button.set_can_target(false);
area_grab_button.add_css_class("disabled")
} }
// Entries // Entries
@ -469,6 +475,7 @@ pub fn build_ui(application: &Application) {
window: main_window.clone(), window: main_window.clone(),
overwrite: overwrite_switch, overwrite: overwrite_switch,
record_delay: delay_spin, record_delay: delay_spin,
record_wayland: executor::block_on(WaylandRecorder::new())
})); }));
// Record Button // Record Button

View File

@ -9,19 +9,10 @@
background: @theme_selected_bg_color; 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; 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;
#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;
} }
#delay_window { #delay_window {
@ -37,3 +28,7 @@
font-size: 120%; font-size: 120%;
font-weight: 50; font-weight: 50;
} }
.disabled {
opacity: 0.5;
}