Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a6de71ff6 | ||
|
|
a5969cf28f | ||
|
|
eed0646237 | ||
|
|
9a7480cd68 |
No files matched your search
@@ -49,7 +49,7 @@ app.*.map.json
|
|||||||
*.deb
|
*.deb
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
*.exe
|
*.exe
|
||||||
!dist/imajviewer_1.7.2_amd64.deb
|
!dist/imajviewer_1.9.0_amd64.deb
|
||||||
!dist/imajviewer_setup_1.1.0.exe
|
!dist/imajviewer_setup_1.1.0.exe
|
||||||
deb/usr/lib/imajviewer/
|
deb/usr/lib/imajviewer/
|
||||||
release/
|
release/
|
||||||
|
|||||||
@@ -4,6 +4,31 @@ All notable changes to imajViewer are documented in this file.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.9.0] - 2026-10-31
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Taskbar/alt-tab title now shows the opened image's file name (falls back to
|
||||||
|
"imajViewer" when no image is open).
|
||||||
|
- Full hicolor icon size set (16–256 px) instead of only 64 px, so small-icon
|
||||||
|
contexts (Thunar "Open With", Xfce app menu) keep the symbol visible.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- `install.sh` generates the full icon size set and rewrites the hicolor
|
||||||
|
index; uninstall hint updated.
|
||||||
|
- Settings size grid is now a fixed 4-column layout (the wide/narrow
|
||||||
|
transposition introduced in this release was removed).
|
||||||
|
|
||||||
|
## [1.8.0] - 2026-10-31
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Window size presets: 4×8 screen-ratio grid in settings; clicking a preset
|
||||||
|
resizes the window to that fraction of the screen work area (taskbar
|
||||||
|
excluded). Minimum window size lowered to 160×100.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Settings file-properties rows were centered under the longest row (path);
|
||||||
|
now left-aligned.
|
||||||
|
|
||||||
## [1.7.2] - 2026-10-25
|
## [1.7.2] - 2026-10-25
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 796 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 7.0 KiB |
@@ -11,8 +11,8 @@ fi
|
|||||||
INSTALL_DIR="${HOME}/.local/lib/${APP}"
|
INSTALL_DIR="${HOME}/.local/lib/${APP}"
|
||||||
BIN_LINK="${HOME}/.local/bin/${APP}"
|
BIN_LINK="${HOME}/.local/bin/${APP}"
|
||||||
DESKTOP_FILE="${HOME}/.local/share/applications/${APP}.desktop"
|
DESKTOP_FILE="${HOME}/.local/share/applications/${APP}.desktop"
|
||||||
ICON_DIR="${HOME}/.local/share/icons/hicolor/64x64/apps"
|
ICON_BASE="${HOME}/.local/share/icons/hicolor"
|
||||||
ICON_FILE="${ICON_DIR}/${APP}.png"
|
ICON_SIZES="16 22 24 32 48 64 128 256"
|
||||||
|
|
||||||
# ── Renkler ──
|
# ── Renkler ──
|
||||||
RED='\033[0;31m'; GREEN='\033[0;32m'; CYAN='\033[0;36m'; NC='\033[0m'
|
RED='\033[0;31m'; GREEN='\033[0;32m'; CYAN='\033[0;36m'; NC='\033[0m'
|
||||||
@@ -36,7 +36,7 @@ if [ ! -f "$BUNDLE_DIR/${APP}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# ── Kurulum dizinleri ──
|
# ── Kurulum dizinleri ──
|
||||||
mkdir -p "$INSTALL_DIR" "$(dirname "$BIN_LINK")" "$(dirname "$DESKTOP_FILE")" "$ICON_DIR"
|
mkdir -p "$INSTALL_DIR" "$(dirname "$BIN_LINK")" "$(dirname "$DESKTOP_FILE")"
|
||||||
|
|
||||||
# ── Binary + kütüphaneler ──
|
# ── Binary + kütüphaneler ──
|
||||||
info "Binary ve kütüphaneler kopyalanıyor…"
|
info "Binary ve kütüphaneler kopyalanıyor…"
|
||||||
@@ -47,37 +47,39 @@ chmod +x "$INSTALL_DIR/${APP}"
|
|||||||
ln -sf "$INSTALL_DIR/${APP}" "$BIN_LINK"
|
ln -sf "$INSTALL_DIR/${APP}" "$BIN_LINK"
|
||||||
ok "Symlink: $BIN_LINK → $INSTALL_DIR/${APP}"
|
ok "Symlink: $BIN_LINK → $INSTALL_DIR/${APP}"
|
||||||
|
|
||||||
# ── İkon (64×64 PNG) ──
|
# ── İkon (hicolor boyut seti: 16–256) ──
|
||||||
if [ ! -f "$ICON_FILE" ]; then
|
if [ -f "$SCRIPT_DIR/imajviewericon.png" ]; then
|
||||||
if [ -f "$SCRIPT_DIR/imajviewericon.png" ]; then
|
info "İkon boyutları üretiliyor (16–256)…"
|
||||||
info "İkon kopyalanıyor (64x64)…"
|
for s in $ICON_SIZES; do
|
||||||
|
d="${ICON_BASE}/${s}x${s}/apps"
|
||||||
|
mkdir -p "$d"
|
||||||
python3 -c "
|
python3 -c "
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
im = Image.open('$SCRIPT_DIR/imajviewericon.png')
|
im = Image.open('$SCRIPT_DIR/imajviewericon.png')
|
||||||
im.resize((64,64), Image.LANCZOS).save('$ICON_FILE')
|
(im if $s == 256 else im.resize(($s, $s), Image.LANCZOS)).save('$d/${APP}.png')
|
||||||
" && ok "İkon: $ICON_FILE" || err "İkon dönüştürme başarısız!"
|
" || err "İkon dönüştürme başarısız! ($s)"
|
||||||
else
|
done
|
||||||
err "imajviewericon.png bulunamadı!"
|
ok "İkon: ${ICON_BASE} (${ICON_SIZES} px)"
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
ok "İkon zaten mevcut"
|
err "imajviewericon.png bulunamadı!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── Hicolor tema indeksi (GTK ikon temasını tanısın) ──
|
# ── Hicolor tema indeksi (GTK ikon temasını tanısın) ──
|
||||||
if [ ! -f "${HOME}/.local/share/icons/hicolor/index.theme" ]; then
|
{
|
||||||
mkdir -p "${HOME}/.local/share/icons/hicolor/64x64/apps"
|
echo "[Icon Theme]"
|
||||||
cat > "${HOME}/.local/share/icons/hicolor/index.theme" << 'EOF'
|
echo "Name=Hicolor"
|
||||||
[Icon Theme]
|
echo "Comment=Fallback icon theme"
|
||||||
Name=Hicolor
|
dirs=""
|
||||||
Comment=Fallback icon theme
|
for s in $ICON_SIZES; do dirs="${dirs:+$dirs,}${s}x${s}/apps"; done
|
||||||
Directories=64x64/apps
|
echo "Directories=$dirs"
|
||||||
|
for s in $ICON_SIZES; do
|
||||||
[64x64/apps]
|
echo ""
|
||||||
Size=64
|
echo "[${s}x${s}/apps]"
|
||||||
Context=Applications
|
echo "Size=$s"
|
||||||
Type=Fixed
|
echo "Context=Applications"
|
||||||
EOF
|
echo "Type=Fixed"
|
||||||
fi
|
done
|
||||||
|
} > "${ICON_BASE}/index.theme"
|
||||||
|
|
||||||
# ── .desktop dosyası ──
|
# ── .desktop dosyası ──
|
||||||
info ".desktop dosyası oluşturuluyor…"
|
info ".desktop dosyası oluşturuluyor…"
|
||||||
@@ -113,4 +115,4 @@ echo -e "${GREEN} Bir PNG/JPG/WebP dosyasına çift tıklayın${NC}"
|
|||||||
echo -e "${GREEN} veya 'xdg-open <dosya>' ile test edin${NC}"
|
echo -e "${GREEN} veya 'xdg-open <dosya>' ile test edin${NC}"
|
||||||
echo -e "${GREEN}══════════════════════════════════════════${NC}"
|
echo -e "${GREEN}══════════════════════════════════════════${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Kaldırmak için: rm -rf ${INSTALL_DIR} ${BIN_LINK} ${DESKTOP_FILE} ${ICON_FILE}"
|
echo "Kaldırmak için: rm -rf \"$INSTALL_DIR\" \"$BIN_LINK\" \"$DESKTOP_FILE\" && rm -f ${ICON_BASE}/*x*/apps/${APP}.png"
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
"sortBy": "Sort by",
|
"sortBy": "Sort by",
|
||||||
"sortByTime": "By time",
|
"sortByTime": "By time",
|
||||||
"sortByName": "By name",
|
"sortByName": "By name",
|
||||||
|
"sizeSection": "Size",
|
||||||
"appDescription": "Ultra-lightweight and fast image viewer. Open images and use arrows or keyboard keys to navigate.",
|
"appDescription": "Ultra-lightweight and fast image viewer. Open images and use arrows or keyboard keys to navigate.",
|
||||||
"shortcuts": "Shortcuts",
|
"shortcuts": "Shortcuts",
|
||||||
"shortcutsList": "• Left/Right arrow — previous/next image\n• Ctrl+O — open file\n• Ctrl+S — save visible area (JPEG 95)\n• Ctrl+R — flip horizontally (clears effects, press again to undo)\n• Ctrl+Q — close window\n• Ctrl+Shift+Q — close all windows\n• F11 — toggle fullscreen\n• Esc — exit fullscreen\n• Scroll — zoom (10% per step)\n• Ctrl+scroll — fine zoom (1% per step)\n• Left-drag — pan\n• Double click — toggle fill/fit\n• Right double click — reset effects\n• Right-drag — contrast\n• Shift+right-drag — rotate\n• Ctrl+right-drag — saturation\n• Ctrl+Shift+right-drag — brightness",
|
"shortcutsList": "• Left/Right arrow — previous/next image\n• Ctrl+O — open file\n• Ctrl+S — save visible area (JPEG 95)\n• Ctrl+R — flip horizontally (clears effects, press again to undo)\n• Ctrl+Q — close window\n• Ctrl+Shift+Q — close all windows\n• F11 — toggle fullscreen\n• Esc — exit fullscreen\n• Scroll — zoom (10% per step)\n• Ctrl+scroll — fine zoom (1% per step)\n• Left-drag — pan\n• Double click — toggle fill/fit\n• Right double click — reset effects\n• Right-drag — contrast\n• Shift+right-drag — rotate\n• Ctrl+right-drag — saturation\n• Ctrl+Shift+right-drag — brightness",
|
||||||
|
|||||||
@@ -122,6 +122,12 @@ abstract class AppLocalizations {
|
|||||||
/// **'By name'**
|
/// **'By name'**
|
||||||
String get sortByName;
|
String get sortByName;
|
||||||
|
|
||||||
|
/// No description provided for @sizeSection.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Size'**
|
||||||
|
String get sizeSection;
|
||||||
|
|
||||||
/// No description provided for @appDescription.
|
/// No description provided for @appDescription.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get sortByName => 'By name';
|
String get sortByName => 'By name';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get sizeSection => 'Size';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get appDescription =>
|
String get appDescription =>
|
||||||
'Ultra-lightweight and fast image viewer. Open images and use arrows or keyboard keys to navigate.';
|
'Ultra-lightweight and fast image viewer. Open images and use arrows or keyboard keys to navigate.';
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ class AppLocalizationsTr extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get sortByName => 'İsme göre';
|
String get sortByName => 'İsme göre';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get sizeSection => 'Boyut';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get appDescription =>
|
String get appDescription =>
|
||||||
'Ultra hafif ve hızlı resim görüntüleyici. Görselleri açın, gezinti için okları veya klavye tuşlarını kullanın.';
|
'Ultra hafif ve hızlı resim görüntüleyici. Görselleri açın, gezinti için okları veya klavye tuşlarını kullanın.';
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"sortBy": "Sıralama",
|
"sortBy": "Sıralama",
|
||||||
"sortByTime": "Zamana göre",
|
"sortByTime": "Zamana göre",
|
||||||
"sortByName": "İsme göre",
|
"sortByName": "İsme göre",
|
||||||
|
"sizeSection": "Boyut",
|
||||||
"appDescription": "Ultra hafif ve hızlı resim görüntüleyici. Görselleri açın, gezinti için okları veya klavye tuşlarını kullanın.",
|
"appDescription": "Ultra hafif ve hızlı resim görüntüleyici. Görselleri açın, gezinti için okları veya klavye tuşlarını kullanın.",
|
||||||
"shortcuts": "Kısayollar",
|
"shortcuts": "Kısayollar",
|
||||||
"shortcutsList": "• Sol/Sağ ok — önceki/sonraki resim\n• Ctrl+O — dosya aç\n• Ctrl+S — görünen alanı kaydet (JPEG 95)\n• Ctrl+R — yatay aynala (efektleri sıfırlar, tekrar basınca geri alır)\n• Ctrl+Q — pencereyi kapat\n• Ctrl+Shift+Q — tüm pencereleri kapat\n• F11 — tam ekran / normal geçişi\n• Esc — tam ekrandan çık\n• Kaydırma — yakınlaştır (tık başına %10)\n• Ctrl+kaydırma — ince yakınlaştırma (tık başına %1)\n• Sol tık sürükle — kaydır\n• Çift tık — doldur/sığdır geçişi\n• Sağ çift tık — efektleri sıfırla\n• Sağ tık sürükle — kontrast\n• Shift+sağ tık — döndür\n• Ctrl+sağ tık — doygunluk\n• Ctrl+Shift+sağ tık — parlaklık",
|
"shortcutsList": "• Sol/Sağ ok — önceki/sonraki resim\n• Ctrl+O — dosya aç\n• Ctrl+S — görünen alanı kaydet (JPEG 95)\n• Ctrl+R — yatay aynala (efektleri sıfırlar, tekrar basınca geri alır)\n• Ctrl+Q — pencereyi kapat\n• Ctrl+Shift+Q — tüm pencereleri kapat\n• F11 — tam ekran / normal geçişi\n• Esc — tam ekrandan çık\n• Kaydırma — yakınlaştır (tık başına %10)\n• Ctrl+kaydırma — ince yakınlaştırma (tık başına %1)\n• Sol tık sürükle — kaydır\n• Çift tık — doldur/sığdır geçişi\n• Sağ çift tık — efektleri sıfırla\n• Sağ tık sürükle — kontrast\n• Shift+sağ tık — döndür\n• Ctrl+sağ tık — doygunluk\n• Ctrl+Shift+sağ tık — parlaklık",
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ void main(List<String> args) async {
|
|||||||
|
|
||||||
final windowOptions = WindowOptions(
|
final windowOptions = WindowOptions(
|
||||||
size: saved?.size ?? defaultSize,
|
size: saved?.size ?? defaultSize,
|
||||||
minimumSize: const Size(400, 300),
|
minimumSize: const Size(160, 100),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
titleBarStyle: TitleBarStyle.hidden,
|
titleBarStyle: TitleBarStyle.hidden,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:window_manager/window_manager.dart';
|
import 'package:window_manager/window_manager.dart';
|
||||||
import 'package:desktop_drop/desktop_drop.dart';
|
import 'package:desktop_drop/desktop_drop.dart';
|
||||||
import 'package:pdf/pdf.dart';
|
import 'package:pdf/pdf.dart';
|
||||||
@@ -13,11 +14,12 @@ import '../services/crop_save_service.dart';
|
|||||||
import '../widgets/custom_title_bar.dart';
|
import '../widgets/custom_title_bar.dart';
|
||||||
import '../widgets/image_canvas.dart';
|
import '../widgets/image_canvas.dart';
|
||||||
import '../widgets/window_resize_zones.dart';
|
import '../widgets/window_resize_zones.dart';
|
||||||
|
import '../widgets/window_size_selector.dart';
|
||||||
import '../shortcuts/app_shortcuts.dart';
|
import '../shortcuts/app_shortcuts.dart';
|
||||||
import '../services/window_persistence.dart';
|
import '../services/window_persistence.dart';
|
||||||
import '../l10n/app_localizations.dart';
|
import '../l10n/app_localizations.dart';
|
||||||
|
|
||||||
const appVersion = '1.7.2';
|
const appVersion = '1.9.0';
|
||||||
|
|
||||||
class ViewerScreen extends StatefulWidget {
|
class ViewerScreen extends StatefulWidget {
|
||||||
final List<String> initialFiles;
|
final List<String> initialFiles;
|
||||||
@@ -44,7 +46,10 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
|||||||
if (widget.initialFiles.isNotEmpty) {
|
if (widget.initialFiles.isNotEmpty) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
FileHandler.loadImagesFromPaths(widget.initialFiles);
|
FileHandler.loadImagesFromPaths(widget.initialFiles);
|
||||||
|
_updateTitle();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) => _updateTitle());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,6 +89,18 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
|||||||
|
|
||||||
void _onImageManagerChanged() {
|
void _onImageManagerChanged() {
|
||||||
setState(() => _hasImages = ImageManager.instance.images.isNotEmpty);
|
setState(() => _hasImages = ImageManager.instance.images.isNotEmpty);
|
||||||
|
_updateTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Taskbar/alt-tab başlığı = açılan dosyanın adı (görsel yoksa uygulama adı).
|
||||||
|
Future<void> _updateTitle() async {
|
||||||
|
final image = ImageManager.instance.currentImagePath;
|
||||||
|
final name = image.isEmpty ? 'imajViewer' : p.basename(image);
|
||||||
|
try {
|
||||||
|
await windowManager.setTitle(name);
|
||||||
|
} catch (_) {
|
||||||
|
// Başlık güncellenemezse sessizce geç.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _doSave() async {
|
Future<void> _doSave() async {
|
||||||
@@ -110,6 +127,36 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
if (_hasImages) ...[
|
||||||
|
Text(AppLocalizations.of(context)!.fileProperties,
|
||||||
|
style: const TextStyle(color: Colors.white70, fontSize: 13)),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
FutureBuilder<List<(String, String)>>(
|
||||||
|
future: _fileProperties(ImageManager.instance.currentImagePath),
|
||||||
|
builder: (context, snap) {
|
||||||
|
if (!snap.hasData) return const SizedBox(height: 20);
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: snap.data!.map((r) => Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 2),
|
||||||
|
child: Text.rich(
|
||||||
|
TextSpan(children: [
|
||||||
|
TextSpan(text: '${r.$1}: ', style: const TextStyle(color: Colors.white70, fontSize: 13)),
|
||||||
|
TextSpan(text: r.$2, style: const TextStyle(color: Colors.white, fontSize: 13)),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
)).toList(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
const Divider(color: Colors.white24, height: 24),
|
||||||
|
],
|
||||||
|
WindowSizeSelector(
|
||||||
|
workArea: _workArea,
|
||||||
|
onPick: _applyWindowSize,
|
||||||
|
),
|
||||||
|
const Divider(color: Colors.white24, height: 24),
|
||||||
Text(AppLocalizations.of(context)!.sortBy,
|
Text(AppLocalizations.of(context)!.sortBy,
|
||||||
style: const TextStyle(color: Colors.white70, fontSize: 13)),
|
style: const TextStyle(color: Colors.white70, fontSize: 13)),
|
||||||
RadioListTile<bool>(
|
RadioListTile<bool>(
|
||||||
@@ -136,30 +183,6 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
|||||||
setDialogState(() {});
|
setDialogState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const Divider(color: Colors.white24, height: 24),
|
|
||||||
if (_hasImages) ...[
|
|
||||||
Text(AppLocalizations.of(context)!.fileProperties,
|
|
||||||
style: const TextStyle(color: Colors.white70, fontSize: 13)),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
FutureBuilder<List<(String, String)>>(
|
|
||||||
future: _fileProperties(ImageManager.instance.currentImagePath),
|
|
||||||
builder: (context, snap) {
|
|
||||||
if (!snap.hasData) return const SizedBox(height: 20);
|
|
||||||
return Column(
|
|
||||||
children: snap.data!.map((r) => Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 2),
|
|
||||||
child: Text.rich(
|
|
||||||
TextSpan(children: [
|
|
||||||
TextSpan(text: '${r.$1}: ', style: const TextStyle(color: Colors.white70, fontSize: 13)),
|
|
||||||
TextSpan(text: r.$2, style: const TextStyle(color: Colors.white, fontSize: 13)),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
)).toList(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 12),
|
|
||||||
],
|
|
||||||
Text('imajViewer $appVersion',
|
Text('imajViewer $appVersion',
|
||||||
style: const TextStyle(color: Colors.white, fontSize: 15)),
|
style: const TextStyle(color: Colors.white, fontSize: 15)),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
@@ -259,6 +282,19 @@ class _ViewerScreenState extends State<ViewerScreen> with WindowListener {
|
|||||||
|
|
||||||
void _flipHorizontal() => _canvasKey.currentState?.toggleFlipH();
|
void _flipHorizontal() => _canvasKey.currentState?.toggleFlipH();
|
||||||
|
|
||||||
|
Future<Size?> _workArea() async {
|
||||||
|
final pos = await windowManager.getPosition();
|
||||||
|
return WindowPersistence.workAreaSize(windowPosition: pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _applyWindowSize(int rows, int cols, Size work) async {
|
||||||
|
try {
|
||||||
|
await windowManager.setSize(Size(work.width / cols, work.height / rows));
|
||||||
|
} catch (_) {
|
||||||
|
// Boyutlandırma başarısız olursa sessizce geç (buton saf eylem).
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _cropSave() async {
|
Future<void> _cropSave() async {
|
||||||
final path = ImageManager.instance.currentImagePath;
|
final path = ImageManager.instance.currentImagePath;
|
||||||
final state = _canvasKey.currentState;
|
final state = _canvasKey.currentState;
|
||||||
|
|||||||
@@ -84,6 +84,36 @@ class WindowPersistence {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Work area (taskbar excluded) of the display containing the window,
|
||||||
|
/// in logical px. Returns null if screen info is unavailable.
|
||||||
|
static Future<Size?> workAreaSize({
|
||||||
|
required Offset windowPosition,
|
||||||
|
}) async {
|
||||||
|
try {
|
||||||
|
final displays = await screenRetriever.getAllDisplays();
|
||||||
|
|
||||||
|
// Pencerenin bulunduğu monitörü bul (çoklu monitör desteği)
|
||||||
|
Display display = await screenRetriever.getPrimaryDisplay();
|
||||||
|
for (final d in displays) {
|
||||||
|
final pos = d.visiblePosition;
|
||||||
|
final size = d.visibleSize ?? d.size;
|
||||||
|
if (pos != null &&
|
||||||
|
windowPosition.dx >= pos.dx &&
|
||||||
|
windowPosition.dx < pos.dx + size.width &&
|
||||||
|
windowPosition.dy >= pos.dy &&
|
||||||
|
windowPosition.dy < pos.dy + size.height) {
|
||||||
|
display = d;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return display.visibleSize ?? display.size;
|
||||||
|
} catch (_) {
|
||||||
|
// Fallback: screen info unavailable → caller silently no-ops.
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Cascade: place new window to the right of the previous one.
|
/// Cascade: place new window to the right of the previous one.
|
||||||
/// Falls to the next row (row start) when it would overflow the screen,
|
/// 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.
|
/// and wraps to the top-left if the next row also overflows.
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../l10n/app_localizations.dart';
|
||||||
|
|
||||||
|
/// Ekran oranı buton ızgarası: 31 buton `a:b` (a dikeyi, b yatayı böler;
|
||||||
|
/// hedef boyut `W/b × H/a`). Sol-üst hücre (1:1) boş placeholder — 1:1 yok
|
||||||
|
/// (title bar çift tık zaten tam ekran).
|
||||||
|
///
|
||||||
|
/// Yerleşim: sabit 8 satır × 4 sütun (31-10: geniş/dar transpozesi
|
||||||
|
/// kaldırıldı — kullanıcı kararı).
|
||||||
|
class WindowSizeSelector extends StatelessWidget {
|
||||||
|
final Future<Size?> Function() workArea;
|
||||||
|
final void Function(int rows, int cols, Size work) onPick;
|
||||||
|
|
||||||
|
const WindowSizeSelector({
|
||||||
|
super.key,
|
||||||
|
required this.workArea,
|
||||||
|
required this.onPick,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(AppLocalizations.of(context)!.sizeSection,
|
||||||
|
style: const TextStyle(color: Colors.white70, fontSize: 13)),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [for (var b = 1; b <= 8; b++) _row(b)],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Satır = `b` (1..8, yatay bölün); satır içinde `a` (1..4, dikey bölün).
|
||||||
|
Widget _row(int b) {
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
for (var a = 1; a <= 4; a++) _cell(a, b),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _cell(int a, int b) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 4, bottom: 4),
|
||||||
|
child: a == 1 && b == 1
|
||||||
|
? const SizedBox(width: 46, height: 26)
|
||||||
|
: GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
final work = await workArea();
|
||||||
|
if (work != null) onPick(a, b, work);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 46,
|
||||||
|
height: 26,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white10,
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
'$a:$b',
|
||||||
|
style: const TextStyle(color: Colors.white, fontSize: 11),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
name: imajviewer
|
name: imajviewer
|
||||||
description: "Ultra-lightweight image viewer for Linux and Windows."
|
description: "Ultra-lightweight image viewer for Linux and Windows."
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
version: 1.7.2+18
|
version: 1.9.0+20
|
||||||
|
|
||||||
msix_config:
|
msix_config:
|
||||||
display_name: ImajViewer
|
display_name: ImajViewer
|
||||||
|
|||||||