aboutsummaryrefslogtreecommitdiff
path: root/src/file_registry.rs
diff options
context:
space:
mode:
authorRuben Beltran del Rio <jj@r.bdr.sh>2026-03-23 20:52:55 +0100
committerRubén Beltrán del Río <jj@r.bdr.sh>2026-03-26 18:07:20 +0100
commit8ce55652306908bf24ee351caad60bd21b0bef72 (patch)
treec4710c2be73bcfc5afb172dd76284735ee6924f0 /src/file_registry.rs
parent34a4ddeb3ad4c2b4e317648f58db5a460f4a14bb (diff)
Use breakpoints to disable horizontal layout at smaller sizes
Diffstat (limited to 'src/file_registry.rs')
-rw-r--r--src/file_registry.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/file_registry.rs b/src/file_registry.rs
index 749697d..188e1fe 100644
--- a/src/file_registry.rs
+++ b/src/file_registry.rs
@@ -21,7 +21,7 @@ use std::cell::RefCell;
use std::path::PathBuf;
use relm4::component::Controller;
-use relm4::gtk;
+use relm4::{adw};
use crate::AppModel;
use crate::actions::Action;
@@ -31,7 +31,7 @@ thread_local! {
static WINDOW_CONTROLLERS: RefCell<Vec<Controller<AppModel>>> = const { RefCell::new(Vec::new()) };
/// Tracks which files are currently open to prevent duplicate windows.
- static OPEN_FILES: RefCell<Vec<(PathBuf, gtk::Window)>> = const { RefCell::new(Vec::new()) };
+ static OPEN_FILES: RefCell<Vec<(PathBuf, adw::Window)>> = const { RefCell::new(Vec::new()) };
/// Stores senders for all windows (including main window) to enable broadcasting.
static WINDOW_SENDERS: RefCell<Vec<relm4::Sender<Action>>> = const { RefCell::new(Vec::new()) };
@@ -45,7 +45,7 @@ pub fn store_controller(controller: Controller<AppModel>) {
}
/// Returns the window that has the given file open, if any.
-pub fn find_window_for_file(path: &PathBuf) -> Option<gtk::Window> {
+pub fn find_window_for_file(path: &PathBuf) -> Option<adw::Window> {
OPEN_FILES.with_borrow(|files| {
files
.iter()
@@ -55,7 +55,7 @@ pub fn find_window_for_file(path: &PathBuf) -> Option<gtk::Window> {
}
/// Registers a file as being open in the given window.
-pub fn register_file(path: &PathBuf, window: &gtk::Window) {
+pub fn register_file(path: &PathBuf, window: &adw::Window) {
OPEN_FILES.with_borrow_mut(|files| {
if !files.iter().any(|(file_path, _)| file_path == path) {
files.push((path.clone(), window.clone()));