mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
internal cleanup: Rename Property::set_dirty() to mark_dirty()
This commit is contained in:
parent
a494eafa9c
commit
d420d5efd7
4 changed files with 7 additions and 7 deletions
|
@ -470,13 +470,13 @@ protected:
|
||||||
/// Notify the views that rows were added
|
/// Notify the views that rows were added
|
||||||
void row_added(int index, int count)
|
void row_added(int index, int count)
|
||||||
{
|
{
|
||||||
model_dirty_property.set_dirty();
|
model_dirty_property.mark_dirty();
|
||||||
for_each_peers([=](auto peer) { peer->row_added(index, count); });
|
for_each_peers([=](auto peer) { peer->row_added(index, count); });
|
||||||
}
|
}
|
||||||
/// Notify the views that rows were removed
|
/// Notify the views that rows were removed
|
||||||
void row_removed(int index, int count)
|
void row_removed(int index, int count)
|
||||||
{
|
{
|
||||||
model_dirty_property.set_dirty();
|
model_dirty_property.mark_dirty();
|
||||||
for_each_peers([=](auto peer) { peer->row_removed(index, count); });
|
for_each_peers([=](auto peer) { peer->row_removed(index, count); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ struct Property
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_dirty() const { return cbindgen_private::sixtyfps_property_is_dirty(&inner); }
|
bool is_dirty() const { return cbindgen_private::sixtyfps_property_is_dirty(&inner); }
|
||||||
void set_dirty() const { cbindgen_private::sixtyfps_property_set_dirty(&inner); }
|
void mark_dirty() const { cbindgen_private::sixtyfps_property_mark_dirty(&inner); }
|
||||||
|
|
||||||
static void link_two_way(const Property<T> *p1, const Property<T> *p2)
|
static void link_two_way(const Property<T> *p1, const Property<T> *p2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,7 +66,7 @@ impl ModelNotify {
|
||||||
/// Notify the peers that rows were added
|
/// Notify the peers that rows were added
|
||||||
pub fn row_added(&self, index: usize, count: usize) {
|
pub fn row_added(&self, index: usize, count: usize) {
|
||||||
if let Some(model_dirty_tracker) = self.model_dirty_property.borrow().as_ref() {
|
if let Some(model_dirty_tracker) = self.model_dirty_property.borrow().as_ref() {
|
||||||
model_dirty_tracker.set_dirty()
|
model_dirty_tracker.mark_dirty()
|
||||||
}
|
}
|
||||||
for peer in self.inner.borrow().iter() {
|
for peer in self.inner.borrow().iter() {
|
||||||
peer.borrow_mut().row_added(index, count)
|
peer.borrow_mut().row_added(index, count)
|
||||||
|
@ -75,7 +75,7 @@ impl ModelNotify {
|
||||||
/// Notify the peers that rows were removed
|
/// Notify the peers that rows were removed
|
||||||
pub fn row_removed(&self, index: usize, count: usize) {
|
pub fn row_removed(&self, index: usize, count: usize) {
|
||||||
if let Some(model_dirty_tracker) = self.model_dirty_property.borrow().as_ref() {
|
if let Some(model_dirty_tracker) = self.model_dirty_property.borrow().as_ref() {
|
||||||
model_dirty_tracker.set_dirty()
|
model_dirty_tracker.mark_dirty()
|
||||||
}
|
}
|
||||||
for peer in self.inner.borrow().iter() {
|
for peer in self.inner.borrow().iter() {
|
||||||
peer.borrow_mut().row_removed(index, count)
|
peer.borrow_mut().row_removed(index, count)
|
||||||
|
|
|
@ -678,7 +678,7 @@ impl<T: Clone> Property<T> {
|
||||||
|
|
||||||
/// Internal function to mark the property as dirty and notify dependencies, regardless of
|
/// Internal function to mark the property as dirty and notify dependencies, regardless of
|
||||||
/// whether the property value has actually changed or not.
|
/// whether the property value has actually changed or not.
|
||||||
pub fn set_dirty(&self) {
|
pub fn mark_dirty(&self) {
|
||||||
self.handle.mark_dirty()
|
self.handle.mark_dirty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1817,7 +1817,7 @@ pub(crate) mod ffi {
|
||||||
|
|
||||||
/// Marks the property as dirty and notifies dependencies.
|
/// Marks the property as dirty and notifies dependencies.
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn sixtyfps_property_set_dirty(handle: &PropertyHandleOpaque) {
|
pub extern "C" fn sixtyfps_property_mark_dirty(handle: &PropertyHandleOpaque) {
|
||||||
handle.0.mark_dirty()
|
handle.0.mark_dirty()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue