feat: gezinme oklari (hover), ayarlar penceresi (zaman/isme gore siralama), yazdirma (printing paketi), title hover saydamligi; .deb guncellendi
This commit is contained in:
1 parent
185653f34e
commit
f3a5aeb604
12 files changed
+431
-38
No files matched your search
@@ -12,10 +12,12 @@ class ImageManager extends ChangeNotifier {
|
||||
|
||||
final List<String> _images = [];
|
||||
int _currentIndex = 0;
|
||||
bool _sortByName = false;
|
||||
|
||||
List<String> get images => List.unmodifiable(_images);
|
||||
int get currentIndex => _currentIndex;
|
||||
int get imageCount => _images.length;
|
||||
bool get sortByName => _sortByName;
|
||||
|
||||
String get currentImagePath {
|
||||
if (_images.isEmpty) return '';
|
||||
@@ -48,6 +50,9 @@ class ImageManager extends ChangeNotifier {
|
||||
} catch (_) {}
|
||||
}
|
||||
entries.sort((a, b) {
|
||||
if (_sortByName) {
|
||||
return a.$1.toLowerCase().compareTo(b.$1.toLowerCase());
|
||||
}
|
||||
final byDate = b.$2.compareTo(a.$2);
|
||||
return byDate != 0 ? byDate : a.$1.compareTo(b.$1);
|
||||
});
|
||||
@@ -69,6 +74,16 @@ class ImageManager extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setSortByName(bool value) {
|
||||
if (_sortByName == value) return;
|
||||
_sortByName = value;
|
||||
if (_images.isNotEmpty) {
|
||||
setGalleryFromPaths([_images[_currentIndex]]);
|
||||
} else {
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
void setCurrentIndex(int index) {
|
||||
if (index < 0 || index >= _images.length) return;
|
||||
_currentIndex = index;
|
||||
|
||||
Reference in new issue
Block a user