$ show ooflet/Mi-Create
Mi-Create is a desktop GUI application for creating and editing watchfaces for Xiaomi smartwatches. Built with PyQt6, it provides a tabbed interface for managing multiple watchface projects, with dockable panels for project exploration, property editing, and resource management. Users can design watchfaces using widgets (images, text, analog displays, etc.), preview designs, and compile them to binary .face files for device deployment. The application features a plugin system for extensibility, theme management with light/dark modes, internationalization support, and an auto-update mechanism. It handles multiple project formats (Fprj, GMF) and includes tools for format conversion and binary manipulation. The architecture follows a modular design with clear separation of concerns: the main window (WatchfaceEditor) coordinates UI components, while utilities handle plugins, themes, history (undo/redo), and project management. The canvas uses custom QGraphicsView items for rendering watchface elements, and the properties editor dynamically generates input fields based on schema definitions. Platform-specific window effects are implemented for Windows, macOS, and Linux to provide frameless window behavior. The application relies on external dependencies including PyQt6, platform-specific packages (pywin32, pyobjc), and build tools like Wine and a custom compiler for generating watchface binaries. While the codebase demonstrates solid engineering practices with reusable components like the plugin system and theme engine, it shows signs of technical debt including platform-specific conditionals, tight coupling in the main window class (exceeding 2000 lines), and reliance on external tools that may introduce compatibility issues. The presence of TODO comments, commented-out code, and hardcoded values suggests areas for refinement. However, the active maintenance status and structured approach to extensibility indicate a viable project with opportunities for improvement in modularity and dependency management.
The LLM identified 4 files worth highlighting for reuse:
PluginLoader dynamically discovers and loads plugins from ZIP files or directories. Defines a PluginAPI interface for plugins to implement, enabling extensibility without modifying core application. Self-contained with minimal dependencies (Qt, importlib, json), making it easily reusable in other Qt applications for adding plugin functionality.
Theme class loads and applies QSS stylesheets and color schemes from INI and JSON configuration files. Supports live theme switching and encapsulates theme-related logic (palette, stylesheet application). Independent of application-specific code, relying only on Qt and file I/O, allowing extraction for use in any Qt project needing dynamic theming capabilities.
Provides CoreDialog (stacked widget-based multi-step dialog) and MultiFieldForm (dynamic form generation) utilities. These generic UI components decouple dialog logic from application specifics, depending only on Qt. CoreDialog manages navigation between steps, while MultiFieldForm creates input fields from a schema, offering a reusable foundation for complex dialogs in any Qt application.
PropertiesWidget dynamically generates appropriate input controls (text box, spin box, combo box, check box, color picker) based on property definitions. Implements a metadata-driven approach where property types, labels, and constraints are defined externally. Highly decoupled from application logic, depending only on Qt, making it suitable for any scenario requiring runtime property editing of objects.