feat: jfif/jpe/wbmp format destegi, pencere cascade yerlesimi, konum kaydi duzeltmesi
- file_handler/image_manager: jfif, jpe, wbmp uzantilari - .desktop + install.sh MimeType: image/vnd.wap.wbmp eklendi - main.dart: yeni pencere oncekinin saginda acilir (screen_retriever ile ekran tespiti) - viewer_screen: 2sn polling kaldirildi, konum kaydi tek akisa oturtuldu (acilis + move/resize debounce + close senkron) - dist/rebuild-deb.sh: .desktop kaynaktan kopyalanir (MimeType/StartupWMClass guncel kalir) - .deb guncellendi, docs: session-2026-08-03 + plan dokumanlari
This commit is contained in:
1 parent
d09351feef
commit
a65bdc152c
17 files changed
+272
-38
No files matched your search
@@ -6,7 +6,7 @@ class FileHandler {
|
||||
static Future<void> openFileDialog() async {
|
||||
final result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['png', 'jpg', 'jpeg', 'webp', 'bmp', 'gif'],
|
||||
allowedExtensions: ['png', 'jpg', 'jpeg', 'jfif', 'jpe', 'webp', 'bmp', 'gif', 'wbmp'],
|
||||
allowMultiple: true,
|
||||
);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class ImageManager extends ChangeNotifier {
|
||||
void addImages(List<String> paths) {
|
||||
final validPaths = paths.where((p) {
|
||||
final ext = p.toLowerCase().split('.').last;
|
||||
const supported = ['png', 'jpg', 'jpeg', 'webp', 'bmp', 'gif'];
|
||||
const supported = ['png', 'jpg', 'jpeg', 'jfif', 'jpe', 'webp', 'bmp', 'gif', 'wbmp'];
|
||||
return supported.contains(ext) && File(p).existsSync();
|
||||
}).toList();
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:screen_retriever/screen_retriever.dart';
|
||||
|
||||
/// Persists and restores window position and size.
|
||||
class WindowPersistence {
|
||||
@@ -51,4 +52,38 @@ class WindowPersistence {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// Cascade: place new window to the right of the previous one.
|
||||
/// Falls to the next row (row start) when it would overflow the screen,
|
||||
/// and wraps to the top-left if the next row also overflows.
|
||||
static Future<Offset> cascadePosition({
|
||||
required Offset previousPosition,
|
||||
required Size previousSize,
|
||||
}) async {
|
||||
try {
|
||||
final display = await screenRetriever.getPrimaryDisplay();
|
||||
final workLeft = display.visiblePosition?.dx ?? 0;
|
||||
final workTop = display.visiblePosition?.dy ?? 0;
|
||||
final workWidth = display.visibleSize?.width ?? display.size.width;
|
||||
final workHeight = display.visibleSize?.height ?? display.size.height;
|
||||
|
||||
var x = previousPosition.dx + previousSize.width;
|
||||
var y = previousPosition.dy;
|
||||
|
||||
if (x + previousSize.width > workLeft + workWidth) {
|
||||
x = workLeft;
|
||||
y = previousPosition.dy + previousSize.height;
|
||||
}
|
||||
|
||||
if (y + previousSize.height > workTop + workHeight) {
|
||||
x = workLeft;
|
||||
y = workTop;
|
||||
}
|
||||
|
||||
return Offset(x, y);
|
||||
} catch (_) {
|
||||
// Fallback: keep previous position if screen info is unavailable.
|
||||
return previousPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user