mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-09-07 10:05:42 +00:00
feat: disable undo in read only textbuffers
This commit is contained in:
parent
c22633c78f
commit
8508a06e2a
4 changed files with 4 additions and 1 deletions
|
@ -204,7 +204,7 @@ impl SimpleComponent for BuildWindow {
|
||||||
title: "".into(),
|
title: "".into(),
|
||||||
content: "".into(),
|
content: "".into(),
|
||||||
can_close: false,
|
can_close: false,
|
||||||
textbuf: gtk::TextBuffer::builder().build(),
|
textbuf: gtk::TextBuffer::builder().enable_undo(false).build(),
|
||||||
textview: None,
|
textview: None,
|
||||||
build_status: BuildStatus::Building,
|
build_status: BuildStatus::Building,
|
||||||
win: None,
|
win: None,
|
||||||
|
|
|
@ -223,6 +223,7 @@ impl SimpleComponent for DebugView {
|
||||||
) -> ComponentParts<Self> {
|
) -> ComponentParts<Self> {
|
||||||
let textbuf = sourceview5::Buffer::builder()
|
let textbuf = sourceview5::Buffer::builder()
|
||||||
.highlight_syntax(false)
|
.highlight_syntax(false)
|
||||||
|
.enable_undo(false)
|
||||||
.build();
|
.build();
|
||||||
if let Some(scheme) = &sourceview5::StyleSchemeManager::new().scheme("Adwaita-dark") {
|
if let Some(scheme) = &sourceview5::StyleSchemeManager::new().scheme("Adwaita-dark") {
|
||||||
textbuf.set_style_scheme(Some(scheme));
|
textbuf.set_style_scheme(Some(scheme));
|
||||||
|
|
|
@ -296,6 +296,7 @@ impl SimpleComponent for MainView {
|
||||||
}
|
}
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
set_enable_undo: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -70,6 +70,7 @@ impl SimpleComponent for SteamLaunchOptionsBox {
|
||||||
set_buffer: cmdbuf = >k::TextBuffer {
|
set_buffer: cmdbuf = >k::TextBuffer {
|
||||||
#[track = "model.changed(Self::launch_options())"]
|
#[track = "model.changed(Self::launch_options())"]
|
||||||
set_text: model.launch_options.as_str(),
|
set_text: model.launch_options.as_str(),
|
||||||
|
set_enable_undo: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue