Skip to content

Commit

Permalink
Remove remains of sixtyfps Futsch1#27
Browse files Browse the repository at this point in the history
  • Loading branch information
Futsch1 committed Feb 11, 2022
1 parent 230c431 commit bd2103c
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 181 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.

### Changed

-
- Renamed all sixtyfps instances to slint

### Added

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Note that the similarity calculation takes some time and will not be available r
## Misc
ImageSieve is published under [GPL-3.0](https://github.com/Futsch1/image-sieve/blob/main/LICENSE).

If you want to help, clone and pull-request. The tool uses the [sixtyfps](https://github.com/sixtyfpsui/sixtyfps) GUI framework and a few of the great [bootstrap icons](https://icons.getbootstrap.com/). For previewing video files, [FFmpeg](https://ffmpeg.org) is used.
If you want to help, clone and pull-request. The tool uses the [slint](https://github.com/slint-ui/slint) GUI framework and a few of the great [bootstrap icons](https://icons.getbootstrap.com/). For previewing video files, [FFmpeg](https://ffmpeg.org) is used.

## Disclaimer
This tool is free software. The author does not take any responsibility or liability for data lost due to bugs or faulty use of the software. Note that the software is in constant development and may contain bugs. Use at your own risk!
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate winres;

fn main() {
println!("sixtyfps build");
println!("slint build");
slint_build::compile("ui/image_sieve.slint").unwrap();
if cfg!(target_os = "windows") {
let mut res = winres::WindowsResource::new();
Expand Down
2 changes: 1 addition & 1 deletion src/controller/events_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl EventsController {
self.events_model.remove(index as usize);
}

/// Returns the contained sixtyfps VecModel
/// Returns the contained slint VecModel
pub fn get_model(&self) -> Rc<slint::VecModel<main_window::Event>> {
self.events_model.clone()
}
Expand Down
10 changes: 5 additions & 5 deletions src/controller/items_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ impl ItemsController {
}
}

/// Gets the sixtyfps vec model for the item list
/// Gets the slint vec model for the item list
pub fn get_list_model(&self) -> Rc<slint::VecModel<main_window::ListItem>> {
self.list_model.clone()
}

/// Gets the sixtyfps vec model for the similar items
/// Gets the slint vec model for the similar items
pub fn get_similar_items_model(&self) -> Rc<slint::VecModel<main_window::SortItem>> {
self.similar_items_model.clone()
}
Expand Down Expand Up @@ -149,7 +149,7 @@ impl ItemsController {
!item_list.items.is_empty()
}

/// Fills the list of found items from the internal data structure to the sixtyfps VecModel
/// Fills the list of found items from the internal data structure to the slint VecModel
pub fn populate_list_model(&mut self, filters: &main_window::Filters) -> usize {
self.clear_list();

Expand Down Expand Up @@ -196,7 +196,7 @@ impl ItemsController {
.row_data(model_index)
.unwrap();
if has_similars {
row_data.image = crate::misc::images::get_sixtyfps_image(&image_buffer);
row_data.image = crate::misc::images::get_slint_image(&image_buffer);
handle
.get_similar_images_model()
.set_row_data(model_index, row_data);
Expand All @@ -205,7 +205,7 @@ impl ItemsController {
if is_current_image {
let mut current_image = handle.get_current_image();
current_image.image =
crate::misc::images::get_sixtyfps_image(&image_buffer);
crate::misc::images::get_slint_image(&image_buffer);
handle.set_current_image(current_image);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mod generated_code {
}
pub use generated_code::*;

/// Main window container of the image sorter, contains the sixtyfps window, models and internal data structures
/// Main window container of the image sorter, contains the slint window, models and internal data structures
pub struct MainWindow {
window: ImageSieve,
item_list: Arc<Mutex<ItemList>>,
Expand Down Expand Up @@ -148,7 +148,7 @@ impl MainWindow {
}
}

/// Setup sixtyfps GUI callbacks
/// Setup slint GUI callbacks
fn setup_callbacks(&self) {
self.window.on_item_selected({
// New item selected on the list of images or next/previous clicked
Expand Down
4 changes: 2 additions & 2 deletions src/misc/image_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl ImageCache {
/// Gets the hourglass image to indicate waiting
/// The image is compiled into the binary
fn get_hourglass() -> Image {
crate::misc::images::get_sixtyfps_image(
crate::misc::images::get_slint_image(
&crate::misc::images::image_from_buffer(HOURGLASS_PNG).unwrap(),
)
}
Expand All @@ -125,7 +125,7 @@ impl ImageCache {
let item_path = item.path.to_str().unwrap();
let mut map = self.images.lock().unwrap();
map.get(String::from(item_path))
.map(|image| crate::misc::images::get_sixtyfps_image(image))
.map(|image| crate::misc::images::get_slint_image(image))
}

/// Gets the waiting image
Expand Down
4 changes: 2 additions & 2 deletions src/misc/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ pub fn get_empty_image() -> slint::Image {
slint::Image::from_rgba8(buffer)
}

/// Convert an image buffer to an image suitable for the sixtyfps library
pub fn get_sixtyfps_image(buffer: &ImageBuffer) -> slint::Image {
/// Convert an image buffer to an image suitable for the slint library
pub fn get_slint_image(buffer: &ImageBuffer) -> slint::Image {
if buffer.width() > 0 && buffer.height() > 0 {
let buffer = slint::SharedPixelBuffer::<slint::Rgba8Pixel>::clone_from_slice(
buffer.as_raw(),
Expand Down
4 changes: 2 additions & 2 deletions src/persistence/model_to_enum.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use num_traits::{FromPrimitive, ToPrimitive};
use slint::{Model, ModelRc, SharedString};

/// Convert a value from a sixtyfps SharedString model to an enum by mapping the model index to the enum value.
/// Convert a value from a slint SharedString model to an enum by mapping the model index to the enum value.
pub fn model_to_enum<Enum>(model: &ModelRc<SharedString>, value: &SharedString) -> Enum
where
Enum: FromPrimitive,
Expand All @@ -15,7 +15,7 @@ where
enum_value
}

/// Convert an enum to a value from a sixtyfps SharedString modelby mapping the enum value to the model index.
/// Convert an enum to a value from a slint SharedString modelby mapping the enum value to the model index.
pub fn enum_to_model<Enum>(model: &ModelRc<SharedString>, value: &Enum) -> SharedString
where
Enum: ToPrimitive,
Expand Down
161 changes: 0 additions & 161 deletions ui/image_sieve.60

This file was deleted.

6 changes: 3 additions & 3 deletions ui/settings.slint
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, CheckBox, GroupBox, LineEdit, VerticalBox, ComboBox, HorizontalBox, AboutSixtyFPS } from "std-widgets.slint";
import { Button, CheckBox, GroupBox, LineEdit, VerticalBox, ComboBox, HorizontalBox, AboutSlint } from "std-widgets.slint";

export SettingsView := VerticalBox {
property use-timestamps <=> use-timestamps-checkbox.checked;
Expand Down Expand Up @@ -81,9 +81,9 @@ export SettingsView := VerticalBox {
TouchArea {
width: 256px;
height: 128px;
AboutSixtyFPS { }
AboutSlint { }
clicked => {
open-url("https://www.github.com/sixtyfpsui/sixtyfps");
open-url("https://github.com/slint-ui/slint");
}
}
}
Expand Down

0 comments on commit bd2103c

Please sign in to comment.