Commit Graph

5 Commits

Author SHA1 Message Date
7223ff5458 Add comprehensive settings panel with layout management
New Features:
- Created settings-schema.json with customizable options:
  * Zone appearance (border width, colors, opacity)
  * Show/hide zone numbers
  * Enable/disable Shift+Drag snapping
  * Enable/disable keyboard snapping (Super+Ctrl+1-9)
  * Notification on window snap

- Created settings.js with custom UI:
  * View all saved custom layouts
  * Delete custom layouts with confirmation dialog
  * Export layouts to JSON files
  * Visual list with layout info (name, zone count, ID)
  * Empty state when no custom layouts exist

Extension Integration:
- Integrated Settings API into extension.js
- Zone overlay now respects user-configured colors and opacity
- Border width is customizable
- Zone numbers can be toggled on/off
- Shift-drag and keyboard snap can be disabled via settings
- Optional notifications when windows snap to zones
- Settings properly cleaned up on extension destroy

UI/UX Improvements:
- Professional settings panel accessible from System Settings → Extensions
- Layout management without editing JSON files manually
- Real-time application of visual settings
- Destructive actions (delete) require confirmation
- Export functionality for sharing layouts

Fixes TODO item #12 - Settings Panel
Fixes TODO item #13 - Update Metadata (already done)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 21:13:23 -07:00
19f7c7faec Implement custom layout persistence
Features:
- Custom layouts now saved to ~/.local/share/gridsnap/layouts.json
- Layouts automatically loaded on extension initialization
- Layouts persist across Cinnamon restarts and extension reloads
- Only custom layouts saved to file (default layouts remain in code)
- Added GLib and Gio imports for file operations
- Error handling for file read/write operations

Technical implementation:
- _loadLayouts(): Merges default layouts with saved custom layouts on startup
- _saveLayouts(): Extracts and saves only custom-* layouts to JSON file
- Automatically creates storage directory if it doesn't exist
- Called when user saves a layout in the graphical editor

Fixes TODO item #1 - Custom Layout Persistence

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 21:02:58 -07:00
3d79b0336a Fix critical bugs and improve laptop compatibility
Major fixes:
- Fix keybinding closure bug causing all zones to map to zone 9
- Change keybindings from Super+Numpad to Super+Ctrl+1-9 for laptop compatibility
- Fix shift-drag detection by implementing continuous modifier polling during window drag
- Fix window object reference by using global.display.focus_window
- Fix window API compatibility (use property checks instead of get_maximized())
- Correct grab-op-begin/end signal handler parameters

Technical improvements:
- Add modifier polling (50ms interval) during window drag to detect Shift key press/release
- Use Mainloop.idle_add to defer window resize operations
- Remove debug logging for production use
- Improve error handling and cleanup in destroy() method

The extension now fully supports:
- Shift-drag window snapping with visual zone overlay
- Keyboard shortcuts for direct zone snapping (Super+Ctrl+1-9)
- Zone overlay toggle (Super+Z)
- Layout cycling (Super+Shift+Z)
- Graphical zone editor (Super+Shift+E)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 19:50:23 -07:00
ksmith
1681580bea Add graphical zone editor and update documentation
- Implemented visual zone editor (Super+Shift+E)
- Draw zones with mouse click-and-drag
- Ctrl+S to save, Ctrl+C to cancel, Delete to remove last zone
- Updated README with zone editor documentation
- Added CSS styles for editor interface
- Custom layouts are now created without code editing
2026-01-16 01:49:09 +00:00
ksmith
51b7de23fa Initial commit - GridSnap Cinnamon Extension 2026-01-16 01:34:29 +00:00