GTK 4
This commit is contained in:
parent
fbfc7acbd5
commit
846526bbe6
98
Cargo.lock
generated
98
Cargo.lock
generated
|
@ -275,11 +275,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cairo-rs"
|
||||
version = "0.17.10"
|
||||
version = "0.18.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ab3603c4028a5e368d09b51c8b624b9a46edcd7c3778284077a6125af73c9f0a"
|
||||
checksum = "1c0466dfa8c0ee78deef390c274ad756801e0a6dbb86c5ef0924a298c5761c4d"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bitflags 2.4.0",
|
||||
"cairo-sys-rs",
|
||||
"glib",
|
||||
"libc",
|
||||
|
@ -289,9 +289,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cairo-sys-rs"
|
||||
version = "0.17.10"
|
||||
version = "0.18.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "691d0c66b1fb4881be80a760cb8fe76ea97218312f9dfe2c9cc0f496ca279cb1"
|
||||
checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
|
@ -1018,11 +1018,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gdk-pixbuf"
|
||||
version = "0.17.10"
|
||||
version = "0.18.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "695d6bc846438c5708b07007537b9274d883373dd30858ca881d7d71b5540717"
|
||||
checksum = "bbc9c2ed73a81d556b65d08879ba4ee58808a6b1927ce915262185d6d547c6f3"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"gdk-pixbuf-sys",
|
||||
"gio",
|
||||
"glib",
|
||||
|
@ -1032,9 +1031,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gdk-pixbuf-sys"
|
||||
version = "0.17.10"
|
||||
version = "0.18.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9285ec3c113c66d7d0ab5676599176f1f42f4944ca1b581852215bf5694870cb"
|
||||
checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7"
|
||||
dependencies = [
|
||||
"gio-sys",
|
||||
"glib-sys",
|
||||
|
@ -1045,11 +1044,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gdk4"
|
||||
version = "0.6.3"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3abf96408a26e3eddf881a7f893a1e111767137136e347745e8ea6ed12731ff"
|
||||
checksum = "6982d9815ed6ac95b0467b189e81f29dea26d08a732926ec113e65744ed3f96c"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cairo-rs",
|
||||
"gdk-pixbuf",
|
||||
"gdk4-sys",
|
||||
|
@ -1061,9 +1059,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gdk4-sys"
|
||||
version = "0.6.3"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bc92aa1608c089c49393d014c38ac0390d01e4841e1fedaa75dbcef77aaed64"
|
||||
checksum = "dbab43f332a3cf1df9974da690b5bb0e26720ed09a228178ce52175372dcfef0"
|
||||
dependencies = [
|
||||
"cairo-sys-rs",
|
||||
"gdk-pixbuf-sys",
|
||||
|
@ -1124,11 +1122,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gio"
|
||||
version = "0.17.10"
|
||||
version = "0.18.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a6973e92937cf98689b6a054a9e56c657ed4ff76de925e36fc331a15f0c5d30a"
|
||||
checksum = "57052f84e8e5999b258e8adf8f5f2af0ac69033864936b8b6838321db2f759b1"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-io",
|
||||
|
@ -1144,9 +1141,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gio-sys"
|
||||
version = "0.17.10"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ccf87c30a12c469b6d958950f6a9c09f2be20b7773f7e70d20b867fdf2628c3"
|
||||
checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
|
@ -1157,11 +1154,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glib"
|
||||
version = "0.17.10"
|
||||
version = "0.18.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3fad45ba8d4d2cea612b432717e834f48031cd8853c8aaf43b2c79fec8d144b"
|
||||
checksum = "1c316afb01ce8067c5eaab1fc4f2cd47dc21ce7b6296358605e2ffab23ccbd19"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bitflags 2.4.0",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-executor",
|
||||
|
@ -1180,24 +1177,23 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glib-macros"
|
||||
version = "0.17.10"
|
||||
version = "0.18.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eca5c79337338391f1ab8058d6698125034ce8ef31b72a442437fa6c8580de26"
|
||||
checksum = "f8da903822b136d42360518653fcf154455defc437d3e7a81475bf9a95ff1e47"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"heck",
|
||||
"proc-macro-crate",
|
||||
"proc-macro-error",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
"syn 2.0.33",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "glib-sys"
|
||||
version = "0.17.10"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d80aa6ea7bba0baac79222204aa786a6293078c210abe69ef1336911d4bdc4f0"
|
||||
checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"system-deps",
|
||||
|
@ -1220,9 +1216,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gobject-sys"
|
||||
version = "0.17.10"
|
||||
version = "0.18.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cd34c3317740a6358ec04572c1bcfd3ac0b5b6529275fae255b237b314bb8062"
|
||||
checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
|
@ -1231,9 +1227,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "graphene-rs"
|
||||
version = "0.17.10"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "def4bb01265b59ed548b05455040d272d989b3012c42d4c1bbd39083cb9b40d9"
|
||||
checksum = "3b2228cda1505613a7a956cca69076892cfbda84fc2b7a62b94a41a272c0c401"
|
||||
dependencies = [
|
||||
"glib",
|
||||
"graphene-sys",
|
||||
|
@ -1242,9 +1238,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "graphene-sys"
|
||||
version = "0.17.10"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1856fc817e6a6675e36cea0bd9a3afe296f5d9709d1e2d3182803ac77f0ab21d"
|
||||
checksum = "cc4144cee8fc8788f2a9b73dc5f1d4e1189d1f95305c4cb7bd9c1af1cfa31f59"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
|
@ -1254,11 +1250,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gsk4"
|
||||
version = "0.6.3"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6f01ef44fa7cac15e2da9978529383e6bee03e570ba5bf7036b4c10a15cc3a3c"
|
||||
checksum = "cc25855255120f294d874acd6eaf4fbed7ce1cdc550e2d8415ea57fafbe816d5"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cairo-rs",
|
||||
"gdk4",
|
||||
"glib",
|
||||
|
@ -1270,9 +1265,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gsk4-sys"
|
||||
version = "0.6.3"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c07a84fb4dcf1323d29435aa85e2f5f58bef564342bef06775ec7bd0da1f01b0"
|
||||
checksum = "e1ecf3a63bf1223d68f80f72cc896c4d8c80482fbce1c9a12c66d3de7290ee46"
|
||||
dependencies = [
|
||||
"cairo-sys-rs",
|
||||
"gdk4-sys",
|
||||
|
@ -1286,11 +1281,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gtk4"
|
||||
version = "0.6.6"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b28a32a04cd75cef14a0983f8b0c669e0fe152a0a7725accdeb594e2c764c88b"
|
||||
checksum = "a3b095b26f2a2df70be1805d3590eeb9d7a05ecb5be9649b82defc72dc56228c"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"cairo-rs",
|
||||
"field-offset",
|
||||
"futures-channel",
|
||||
|
@ -1303,15 +1297,14 @@ dependencies = [
|
|||
"gtk4-macros",
|
||||
"gtk4-sys",
|
||||
"libc",
|
||||
"once_cell",
|
||||
"pango",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gtk4-macros"
|
||||
version = "0.6.6"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6a4d6b61570f76d3ee542d984da443b1cd69b6105264c61afec3abed08c2500f"
|
||||
checksum = "d57ec49cf9b657f69a05bca8027cff0a8dfd0c49e812be026fc7311f2163832f"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"proc-macro-crate",
|
||||
|
@ -1323,9 +1316,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gtk4-sys"
|
||||
version = "0.6.3"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5f8283f707b07e019e76c7f2934bdd4180c277e08aa93f4c0d8dd07b7a34e22f"
|
||||
checksum = "7b0bdde87c50317b4f355bcbb4a9c2c414ece1b7c824fb4ad4ba8f3bdb2c6603"
|
||||
dependencies = [
|
||||
"cairo-sys-rs",
|
||||
"gdk-pixbuf-sys",
|
||||
|
@ -2021,11 +2014,10 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
|||
|
||||
[[package]]
|
||||
name = "pango"
|
||||
version = "0.17.10"
|
||||
version = "0.18.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "35be456fc620e61f62dff7ff70fbd54dcbaf0a4b920c0f16de1107c47d921d48"
|
||||
checksum = "06a9e54b831d033206160096b825f2070cf5fda7e35167b1c01e9e774f9202d1"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"gio",
|
||||
"glib",
|
||||
"libc",
|
||||
|
@ -2035,9 +2027,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pango-sys"
|
||||
version = "0.17.10"
|
||||
version = "0.18.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3da69f9f3850b0d8990d462f8c709561975e95f689c1cdf0fecdebde78b35195"
|
||||
checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
|
|
|
@ -10,8 +10,8 @@ homepage = "https://github.com/qarmin/czkawka"
|
|||
repository = "https://github.com/qarmin/czkawka"
|
||||
|
||||
[dependencies]
|
||||
gdk4 = "0.6"
|
||||
glib = "0.17"
|
||||
gdk4 = "0.7.2"
|
||||
glib = "0.18.2"
|
||||
|
||||
humansize = "2.1"
|
||||
chrono = "0.4.31"
|
||||
|
@ -52,8 +52,9 @@ once_cell = "1.18"
|
|||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = { version = "0.3.9", features = ["combaseapi", "objbase", "shobjidl_core", "windef", "winerror", "wtypesbase", "winuser"] }
|
||||
|
||||
|
||||
[dependencies.gtk4]
|
||||
version = "0.6"
|
||||
version = "0.7"
|
||||
default-features = false
|
||||
features = ["v4_6"]
|
||||
|
||||
|
@ -61,6 +62,8 @@ features = ["v4_6"]
|
|||
path = "../czkawka_core"
|
||||
version = "6.0.0"
|
||||
features = []
|
||||
#gtk4 = { version = "0.7.2", default-features = false, features = ["v4_6"] }
|
||||
#czkawka_core = { path = "../czkawka_core",version = "6.0.0",features = [] }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
|
|
@ -224,7 +224,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
|
|||
}
|
||||
}
|
||||
// Returning false here would close the receiver and have senders fail
|
||||
Continue(true)
|
||||
glib::ControlFlow::Continue
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ pub fn connect_button_compare(gui_data: &GuiData) {
|
|||
*shared_using_for_preview.borrow_mut() = (None, None);
|
||||
image_compare_left.set_from_pixbuf(None);
|
||||
image_compare_right.set_from_pixbuf(None);
|
||||
gtk4::Inhibit(true)
|
||||
glib::Propagation::Stop
|
||||
});
|
||||
|
||||
let button_go_previous_compare_group = gui_data.compare_images.button_go_previous_compare_group.clone();
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use gtk4::prelude::*;
|
||||
use gtk4::Inhibit;
|
||||
|
||||
use crate::gui_structs::gui_data::GuiData;
|
||||
|
||||
|
@ -12,7 +11,7 @@ pub fn connect_button_about(gui_data: &GuiData) {
|
|||
// Prevent from deleting dialog after close
|
||||
about_dialog.connect_close_request(|dialog| {
|
||||
dialog.hide();
|
||||
Inhibit(true)
|
||||
glib::Propagation::Stop
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ pub fn connect_settings(gui_data: &GuiData) {
|
|||
|
||||
window_settings.connect_close_request(move |window| {
|
||||
window.hide();
|
||||
gtk4::Inhibit(true)
|
||||
glib::Propagation::Stop
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ use std::io::BufReader;
|
|||
use std::path::PathBuf;
|
||||
|
||||
use gdk4::gdk_pixbuf::{InterpType, Pixbuf};
|
||||
use glib::signal::Inhibit;
|
||||
use glib::Error;
|
||||
use gtk4::prelude::*;
|
||||
use gtk4::{ListStore, Scale, ScrollType, TextView, TreeView, Widget};
|
||||
|
@ -799,11 +798,11 @@ pub fn scale_set_min_max_values(scale: &Scale, minimum: f64, maximum: f64, curre
|
|||
}
|
||||
}
|
||||
|
||||
pub fn scale_step_function(scale: &Scale, _scroll_type: ScrollType, value: f64) -> Inhibit {
|
||||
pub fn scale_step_function(scale: &Scale, _scroll_type: ScrollType, value: f64) -> glib::Propagation {
|
||||
scale.set_increments(1_f64, 1_f64);
|
||||
scale.set_round_digits(0);
|
||||
scale.set_fill_level(value.round());
|
||||
Inhibit(false)
|
||||
glib::Propagation::Proceed
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -273,7 +273,7 @@ pub fn initialize_gui(gui_data: &GuiData) {
|
|||
|
||||
window_progress.connect_close_request(move |_| {
|
||||
stop_sender.send(()).unwrap();
|
||||
gtk4::Inhibit(true)
|
||||
glib::Propagation::Stop
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,10 @@ use std::ffi::OsString;
|
|||
|
||||
use futures::channel::mpsc;
|
||||
use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender};
|
||||
use glib::Priority;
|
||||
use gtk4::gio::ApplicationFlags;
|
||||
use gtk4::prelude::*;
|
||||
use gtk4::{Application, Inhibit};
|
||||
use gtk4::Application;
|
||||
|
||||
use connect_things::connect_about_buttons::*;
|
||||
use connect_things::connect_button_compare::*;
|
||||
|
@ -80,7 +81,7 @@ fn build_ui(application: &Application, arguments: &[OsString]) {
|
|||
let gui_data: GuiData = GuiData::new_with_application(application);
|
||||
|
||||
// Used for getting data from thread
|
||||
let (glib_stop_sender, glib_stop_receiver) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);
|
||||
let (glib_stop_sender, glib_stop_receiver) = glib::MainContext::channel(Priority::default());
|
||||
|
||||
// Futures progress report
|
||||
let (progress_sender, progress_receiver): (UnboundedSender<ProgressData>, UnboundedReceiver<ProgressData>) = mpsc::unbounded();
|
||||
|
@ -138,6 +139,6 @@ fn build_ui(application: &Application, arguments: &[OsString]) {
|
|||
// Save configuration at exit
|
||||
}
|
||||
taskbar_state.borrow_mut().release();
|
||||
Inhibit(false)
|
||||
glib::Propagation::Proceed
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use gdk4::{Key, ModifierType};
|
||||
use glib::signal::Inhibit;
|
||||
use gtk4::prelude::*;
|
||||
use gtk4::GestureClick;
|
||||
|
||||
|
@ -8,7 +7,12 @@ use crate::notebook_enums::NotebookUpperEnum;
|
|||
|
||||
// TODO add option to open files and folders from context menu activated by pressing ONCE with right mouse button
|
||||
|
||||
pub fn opening_enter_function_ported_upper_directories(event_controller: >k4::EventControllerKey, _key_value: Key, key_code: u32, _modifier_type: ModifierType) -> Inhibit {
|
||||
pub fn opening_enter_function_ported_upper_directories(
|
||||
event_controller: >k4::EventControllerKey,
|
||||
_key_value: Key,
|
||||
key_code: u32,
|
||||
_modifier_type: ModifierType,
|
||||
) -> glib::Propagation {
|
||||
let tree_view = event_controller.widget().downcast::<gtk4::TreeView>().unwrap();
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
|
@ -32,7 +36,7 @@ pub fn opening_enter_function_ported_upper_directories(event_controller: >k4::
|
|||
}
|
||||
}
|
||||
// false // True catches signal, and don't send it to function, e.g. up button is caught and don't move selection
|
||||
Inhibit(false)
|
||||
glib::Propagation::Proceed
|
||||
}
|
||||
|
||||
pub fn opening_middle_mouse_function(gesture_click: &GestureClick, _number_of_clicks: i32, _b: f64, _c: f64) {
|
||||
|
@ -64,7 +68,7 @@ pub fn opening_double_click_function_directories(gesture_click: &GestureClick, n
|
|||
}
|
||||
}
|
||||
|
||||
pub fn opening_enter_function_ported(event_controller: >k4::EventControllerKey, _key: Key, key_code: u32, _modifier_type: ModifierType) -> Inhibit {
|
||||
pub fn opening_enter_function_ported(event_controller: >k4::EventControllerKey, _key: Key, key_code: u32, _modifier_type: ModifierType) -> glib::Propagation {
|
||||
let tree_view = event_controller.widget().downcast::<gtk4::TreeView>().unwrap();
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
|
@ -80,7 +84,7 @@ pub fn opening_enter_function_ported(event_controller: >k4::EventControllerKey
|
|||
nt_object.column_selection,
|
||||
nt_object.column_header,
|
||||
);
|
||||
Inhibit(false) // True catches signal, and don't send it to function, e.g. up button is caught and don't move selection
|
||||
glib::Propagation::Proceed // True catches signal, and don't send it to function, e.g. up button is caught and don't move selection
|
||||
}
|
||||
|
||||
pub fn opening_double_click_function(gesture_click: &GestureClick, number_of_clicks: i32, _b: f64, _c: f64) {
|
||||
|
|
Loading…
Reference in a new issue