Compare commits

...

3 Commits

Author SHA1 Message Date
6835b6d69d Update DONE.md with Real-ESRGAN setup and window resize fix 2025-12-21 14:20:14 -05:00
0f24b786c2 Fix window auto-resizing when content changes
Resolved issue where window would resize itself based on dynamic content
like progress bars and queue updates. Window now maintains the size that
the user sets, regardless of content changes.

**Problem:**
- When progress bars updated or queue content changed, the window would
  automatically resize to fit the new content MinSize
- This caused the window to get larger or smaller unexpectedly
- User-set window size was not being preserved

**Solution:**
- Modified setContent() to capture current window size before setting new content
- Restore the window size after SetContent() completes
- This prevents Fyne from auto-resizing based on content MinSize changes
- Window only resizes when user manually drags edges or maximizes

**Impact:**
- Window maintains stable size through all content changes
- Progress bars, queue updates, and module switches no longer trigger resize
- User retains full control of window size via manual resize/maximize
- Improves professional appearance and user experience

Reported by: Jake

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 14:19:50 -05:00
58ad59a0c7 Add automated Real-ESRGAN setup script for Linux
Created setup-realesrgan-linux.sh for easy one-command installation:
- Downloads Real-ESRGAN ncnn Vulkan binary from GitHub releases
- Installs to ~/.local/bin/realesrgan-ncnn-vulkan
- Installs all AI models to ~/.local/share/realesrgan/models/
- Sets proper permissions
- Provides PATH setup instructions

Installation:
  ./scripts/setup-realesrgan-linux.sh

Models included (45MB):
- realesr-animevideov3 (x2, x3, x4) - Anime/illustration upscaling
- realesrgan-x4plus - General photo/video upscaling
- realesrgan-x4plus-anime - Anime-specific upscaling

Tested and working on Fedora 43. Makes AI upscaling fully automated
for Linux users - no manual downloads or configuration needed.

Next step: Add in-app "Install AI Upscaling" button to VideoTools UI
for even easier setup without using terminal.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 14:10:46 -05:00
3 changed files with 81 additions and 1 deletions

19
DONE.md
View File

@ -129,6 +129,25 @@ This file tracks completed features, fixes, and milestones.
- Added author module state fields to appState
- Foundation for complete disc production workflow
- ✅ **Real-ESRGAN Automated Setup** (2025-12-20 continuation)
- Created automated setup script for Linux (setup-realesrgan-linux.sh)
- One-command installation: downloads, installs, configures
- Installs binary to ~/.local/bin/realesrgan-ncnn-vulkan
- Installs all AI models to ~/.local/share/realesrgan/models/ (45MB)
- Includes 5 model sets: animevideov3, x4plus, x4plus-anime
- Sets proper permissions and provides PATH setup instructions
- Makes AI upscaling fully automated for users
- No manual downloads or configuration needed
- ✅ **Window Auto-Resize Fix** (2025-12-20 continuation)
- Fixed window resizing itself when content changes
- Window now maintains user-set size through all content updates
- Progress bars and queue updates no longer trigger window resize
- Preserved window size before/after SetContent() calls
- User retains full control via manual resize or maximize
- Improves professional appearance and stability
- Reported by: Jake
### Features (2025-12-18 Session)
- ✅ **History Sidebar Enhancements**
- Delete button ("×") on each history entry

10
main.go
View File

@ -1384,15 +1384,23 @@ func (r *mouseButtonRenderer) BackgroundColor() color.Color {
func (s *appState) setContent(body fyne.CanvasObject) {
update := func() {
// Preserve current window size to prevent auto-resizing when content changes
// This ensures the window maintains the size the user set, even when content
// like progress bars or queue items change dynamically
currentSize := s.window.Canvas().Size()
bg := canvas.NewRectangle(backgroundColor)
// Don't set a minimum size - let content determine layout naturally
if body == nil {
s.window.SetContent(bg)
// Restore window size after setting content
s.window.Resize(currentSize)
return
}
// Wrap content with mouse button handler
wrapped := newMouseButtonHandler(container.NewMax(bg, body), s)
s.window.SetContent(wrapped)
// Restore window size after setting content
s.window.Resize(currentSize)
}
// Use async Do() instead of DoAndWait() to avoid deadlock when called from main goroutine

View File

@ -0,0 +1,53 @@
#!/bin/bash
# Quick Real-ESRGAN setup for Linux
set -e
INSTALL_DIR="$HOME/.local/bin"
MODELS_DIR="$HOME/.local/share/realesrgan/models"
mkdir -p "$INSTALL_DIR"
mkdir -p "$MODELS_DIR"
echo "════════════════════════════════════════════════════════════════"
echo " Real-ESRGAN ncnn Setup for Linux"
echo "════════════════════════════════════════════════════════════════"
echo ""
cd /tmp
echo "📥 Downloading Real-ESRGAN ncnn Vulkan..."
if ! wget -q --show-progress -O realesrgan-ncnn-vulkan.zip \
https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-ubuntu.zip; then
echo "❌ Download failed. Please check your internet connection."
exit 1
fi
echo ""
echo "📦 Extracting..."
unzip -o realesrgan-ncnn-vulkan.zip > /dev/null
echo "📂 Installing to $INSTALL_DIR..."
cp realesrgan-ncnn-vulkan "$INSTALL_DIR/"
chmod +x "$INSTALL_DIR/realesrgan-ncnn-vulkan"
echo "📂 Installing models to $MODELS_DIR..."
cp -r models/* "$MODELS_DIR/"
echo "🧹 Cleaning up..."
rm -rf realesrgan-ncnn-vulkan.zip realesrgan-ncnn-vulkan models/ input.jpg input2.jpg onepiece_demo.mp4 README_ubuntu.md
echo ""
echo "════════════════════════════════════════════════════════════════"
echo "✅ Real-ESRGAN Successfully Installed!"
echo "════════════════════════════════════════════════════════════════"
echo ""
echo "Binary: $INSTALL_DIR/realesrgan-ncnn-vulkan"
echo "Models: $MODELS_DIR"
echo ""
echo "Test it:"
echo " realesrgan-ncnn-vulkan -v"
echo ""
echo "Note: Make sure $INSTALL_DIR is in your PATH"
echo "Add this to your ~/.bashrc if needed:"
echo ' export PATH="$HOME/.local/bin:$PATH"'
echo ""