Порівняти коміти
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
89f68aa404 | ||
|
|
86f390f2a9 | ||
|
|
78784837d1 |
No files matched your search
@@ -395,10 +395,6 @@ fn canonical_path(path: &Path) -> IdeResult<PathBuf> {
|
||||
let mut resolved = PathBuf::new();
|
||||
for component in std::path::absolute(path)?.components() {
|
||||
match component {
|
||||
std::path::Component::Prefix(_) => {
|
||||
resolved.push(component);
|
||||
continue;
|
||||
}
|
||||
std::path::Component::ParentDir => {
|
||||
resolved.pop();
|
||||
}
|
||||
|
||||
@@ -112,9 +112,10 @@ for (const theme of ["dark", "light"] as const) {
|
||||
});
|
||||
expect(geometry.scroll).toBe(geometry.client);
|
||||
expect(geometry.contained).toBe(true);
|
||||
expect(geometry.promptRadius).toBeLessThanOrEqual(4);
|
||||
expect(geometry.replyBackground).not.toBe("rgba(0, 0, 0, 0)");
|
||||
expect(geometry.replyBorder).toBe("1px");
|
||||
expect(geometry.promptRadius).toBeLessThanOrEqual(6);
|
||||
// Replies read as plain text on the panel.
|
||||
expect(geometry.replyBackground).toBe("rgba(0, 0, 0, 0)");
|
||||
expect(geometry.replyBorder).toBe("0px");
|
||||
expect(geometry.userOnRight).toBe(true);
|
||||
expect(geometry.approvalAligned).toBe(true);
|
||||
expect(geometry.authorBeforeWork).toBe(true);
|
||||
|
||||
|
До Ширина: | Висота: | Розмір: 2.3 KiB Після Ширина: | Висота: | Розмір: 2.6 KiB |
|
До Ширина: | Висота: | Розмір: 4.4 KiB Після Ширина: | Висота: | Розмір: 4.9 KiB |
|
До Ширина: | Висота: | Розмір: 677 B Після Ширина: | Висота: | Розмір: 718 B |
|
До Ширина: | Висота: | Розмір: 2.2 KiB Після Ширина: | Висота: | Розмір: 2.6 KiB |
|
До Ширина: | Висота: | Розмір: 3.0 KiB Після Ширина: | Висота: | Розмір: 3.5 KiB |
|
До Ширина: | Висота: | Розмір: 3.1 KiB Після Ширина: | Висота: | Розмір: 3.6 KiB |
|
До Ширина: | Висота: | Розмір: 5.7 KiB Після Ширина: | Висота: | Розмір: 6.7 KiB |
|
До Ширина: | Висота: | Розмір: 802 B Після Ширина: | Висота: | Розмір: 876 B |
|
До Ширина: | Висота: | Розмір: 6.2 KiB Після Ширина: | Висота: | Розмір: 7.2 KiB |
|
До Ширина: | Висота: | Розмір: 1.1 KiB Після Ширина: | Висота: | Розмір: 1.2 KiB |
|
До Ширина: | Висота: | Розмір: 1.5 KiB Після Ширина: | Висота: | Розмір: 1.8 KiB |
|
До Ширина: | Висота: | Розмір: 1.9 KiB Після Ширина: | Висота: | Розмір: 2.2 KiB |
|
До Ширина: | Висота: | Розмір: 1.2 KiB Після Ширина: | Висота: | Розмір: 1.3 KiB |
|
До Ширина: | Висота: | Розмір: 11 KiB Після Ширина: | Висота: | Розмір: 13 KiB |
|
До Ширина: | Висота: | Розмір: 8.8 KiB Після Ширина: | Висота: | Розмір: 9.9 KiB |
@@ -1 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 100 100" role="img" aria-label="OpenIDEA"><g transform="translate(50 50) scale(1.8) translate(-50 -52)"><rect x="22" y="26" width="56" height="52" rx="12" fill="#D9582C"/><rect x="27" y="26" width="46" height="42" rx="9" fill="#1B1A1A"/><g transform="translate(50 46) scale(1.35) translate(-50 -46)"><circle cx="44" cy="47.4" r="4.1" fill="none" stroke="#EAE7E0" stroke-width="2.7"/><rect x="54.3" y="42" width="2.8" height="10.5" fill="#EAE7E0"/><rect x="51.2" y="42" width="5.9" height="2.5" fill="#EAE7E0"/><rect x="51.2" y="50" width="9.4" height="2.5" fill="#EAE7E0"/><circle cx="55.7" cy="38.4" r="1.8" fill="#EAE7E0"/></g></g></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 100 100" role="img" aria-label="OpenIDEA">
|
||||
<rect x="2" y="2" width="96" height="96" rx="22" fill="#EAE7E0"/>
|
||||
<g transform="translate(50 50) scale(1.5) translate(-50 -52)">
|
||||
<rect x="22" y="26" width="56" height="52" rx="12" fill="#D9582C"/>
|
||||
<rect x="27" y="26" width="46" height="42" rx="9" fill="#1B1A1A"/>
|
||||
<g transform="translate(50 46) scale(1.35) translate(-50 -46)">
|
||||
<circle cx="44" cy="47.4" r="4.1" fill="none" stroke="#EAE7E0" stroke-width="2.7"/>
|
||||
<rect x="54.3" y="42" width="2.8" height="10.5" fill="#EAE7E0"/>
|
||||
<rect x="51.2" y="42" width="5.9" height="2.5" fill="#EAE7E0"/>
|
||||
<rect x="51.2" y="50" width="9.4" height="2.5" fill="#EAE7E0"/>
|
||||
<circle cx="55.7" cy="38.4" r="1.8" fill="#EAE7E0"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
До Ширина: | Висота: | Розмір: 720 B Після Ширина: | Висота: | Розмір: 850 B |
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 100 100" role="img" aria-label="OpenIDEA"><g transform="translate(50 50) scale(1.55) translate(-50 -52)"><rect x="22" y="26" width="56" height="52" rx="12" fill="#D9582C"/><rect x="27" y="26" width="46" height="42" rx="9" fill="#1B1A1A"/><circle cx="44" cy="47.4" r="4.1" fill="none" stroke="#EAE7E0" stroke-width="2.7"/><rect x="54.3" y="42" width="2.8" height="10.5" fill="#EAE7E0"/><rect x="51.2" y="42" width="5.9" height="2.5" fill="#EAE7E0"/><rect x="51.2" y="50" width="9.4" height="2.5" fill="#EAE7E0"/><circle cx="55.7" cy="38.4" r="1.8" fill="#EAE7E0"/></g></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 100 100" role="img" aria-label="OpenIDEA"><rect x="10" y="10" width="80" height="80" rx="18" fill="#EAE7E0"/><g transform="translate(50 50) scale(1.25) translate(-50 -52)"><rect x="22" y="26" width="56" height="52" rx="12" fill="#D9582C"/><rect x="27" y="26" width="46" height="42" rx="9" fill="#1B1A1A"/><circle cx="44" cy="47.4" r="4.1" fill="none" stroke="#EAE7E0" stroke-width="2.7"/><rect x="54.3" y="42" width="2.8" height="10.5" fill="#EAE7E0"/><rect x="51.2" y="42" width="5.9" height="2.5" fill="#EAE7E0"/><rect x="51.2" y="50" width="9.4" height="2.5" fill="#EAE7E0"/><circle cx="55.7" cy="38.4" r="1.8" fill="#EAE7E0"/></g></svg>
|
||||
|
До Ширина: | Висота: | Розмір: 654 B Після Ширина: | Висота: | Розмір: 721 B |
@@ -9,7 +9,7 @@ use specta::Type;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use tauri::ipc::Channel;
|
||||
use tauri::{AppHandle, State, WebviewWindow};
|
||||
use tauri::{AppHandle, State, WebviewWindow, Window};
|
||||
|
||||
/// Opens `path` in a new window (`new_window`) or tells the caller to open it
|
||||
/// itself (`current`). A project already open in some window is focused instead.
|
||||
@@ -211,8 +211,18 @@ pub struct CloseContext {
|
||||
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub fn window_close_context(app: AppHandle, windows: State<'_, WindowsState>) -> CloseContext {
|
||||
CloseContext { quitting: windows.quitting(), windows: windows::project_window_labels(&app).len() as u32 }
|
||||
pub fn window_close_context(app: AppHandle, window: Window, windows: State<'_, WindowsState>) -> CloseContext {
|
||||
let all = windows::project_window_labels(&app);
|
||||
let pending: Vec<String> = windows::sorted_labels(
|
||||
windows.pending_closes().iter().map(String::as_str).filter(|l| all.iter().any(|a| a == l)),
|
||||
);
|
||||
// Members of a tab group asking to close together are one window closing: the first of them
|
||||
// is the last window left (it returns to the welcome screen); the others just close.
|
||||
let count = match pending.first() {
|
||||
Some(keeper) if pending.len() > 1 && keeper == window.label() => all.len() - pending.len() + 1,
|
||||
_ => all.len(),
|
||||
};
|
||||
CloseContext { quitting: windows.quitting(), windows: count as u32 }
|
||||
}
|
||||
|
||||
/// Quits: closes every window, each of which runs its own unsaved-changes check.
|
||||
|
||||
@@ -205,8 +205,13 @@ pub fn run() {
|
||||
Ok(())
|
||||
})
|
||||
.on_window_event(|window, event| match event {
|
||||
#[cfg(target_os = "linux")]
|
||||
tauri::WindowEvent::CloseRequested { .. } => linux_window_state::save_before_close(window.app_handle()),
|
||||
tauri::WindowEvent::CloseRequested { .. } => {
|
||||
#[cfg(target_os = "linux")]
|
||||
linux_window_state::save_before_close(window.app_handle());
|
||||
if let Some(w) = window.try_state::<WindowsState>() {
|
||||
w.close_requested(window.label());
|
||||
}
|
||||
}
|
||||
tauri::WindowEvent::Focused(true) => {
|
||||
application_focus::changed(window.app_handle(), true);
|
||||
if let Some(w) = window.try_state::<WindowsState>() {
|
||||
|
||||
@@ -214,6 +214,7 @@ pub fn close_tabs(app: &AppHandle, caller: &str, keep: &str, labels: Vec<String>
|
||||
/// The closing tab's project vetoed (its unsaved-changes prompt was cancelled): leave the rest open.
|
||||
pub fn cancel_close(app: &AppHandle, caller: &str) {
|
||||
let state = app.state::<WindowsState>();
|
||||
state.close_settled(caller);
|
||||
let mut batch = state.tab_closes.lock();
|
||||
if batch.as_ref().is_some_and(|b| b.pending.front().is_some_and(|l| l == caller)) {
|
||||
*batch = None;
|
||||
|
||||
@@ -140,6 +140,9 @@ pub struct WindowsState {
|
||||
last_focused: Mutex<Option<String>>,
|
||||
/// Set by Quit while windows close one by one.
|
||||
quitting: AtomicBool,
|
||||
/// Windows asked to close whose guards have not finished. AppKit closes a whole tab group at
|
||||
/// once, so its members ask together.
|
||||
close_requests: Mutex<Vec<String>>,
|
||||
/// Project tabs closing one by one (Close Other Tabs and friends).
|
||||
pub tab_closes: Mutex<Option<crate::window_groups::TabCloses>>,
|
||||
/// Relaunch once the quit completes (after installing an update).
|
||||
@@ -149,6 +152,21 @@ pub struct WindowsState {
|
||||
}
|
||||
|
||||
impl WindowsState {
|
||||
pub fn close_requested(&self, label: &str) {
|
||||
let mut requests = self.close_requests.lock();
|
||||
if !requests.iter().any(|l| l == label) {
|
||||
requests.push(label.to_owned());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn close_settled(&self, label: &str) {
|
||||
self.close_requests.lock().retain(|l| l != label);
|
||||
}
|
||||
|
||||
pub fn pending_closes(&self) -> Vec<String> {
|
||||
self.close_requests.lock().clone()
|
||||
}
|
||||
|
||||
pub fn set_launch(&self, label: &str, launch: Launch) {
|
||||
self.launches.lock().insert(label.to_owned(), launch);
|
||||
}
|
||||
@@ -187,6 +205,7 @@ impl WindowsState {
|
||||
}
|
||||
|
||||
pub fn forget(&self, label: &str) {
|
||||
self.close_settled(label);
|
||||
self.launches.lock().remove(label);
|
||||
let mut last = self.last_focused.lock();
|
||||
if last.as_deref() == Some(label) {
|
||||
|
||||
@@ -189,6 +189,7 @@ async function onCloseRequested(deps: CloseDeps): Promise<boolean> {
|
||||
// screen (to open another one); closing the welcome screen, or quitting, closes the window.
|
||||
if (!ctx.quitting && ctx.windows <= 1 && (s.project || s.lightEdit)) {
|
||||
if (await confirmLeave(deps)) await closeProject();
|
||||
await commands.windowGroupCancelClose();
|
||||
return false;
|
||||
}
|
||||
const confirmTerminate = workflowSettings().run.confirmTerminate;
|
||||
|
||||