Skip to content

PR: GTK4 Migration & Standalone Support for Calculate Activity#89

Draft
DeepaliSingh-git wants to merge 1 commit intosugarlabs:masterfrom
DeepaliSingh-git:gtk4-migration
Draft

PR: GTK4 Migration & Standalone Support for Calculate Activity#89
DeepaliSingh-git wants to merge 1 commit intosugarlabs:masterfrom
DeepaliSingh-git:gtk4-migration

Conversation

@DeepaliSingh-git
Copy link
Copy Markdown

Migrated the Calculate activity from GTK3/Sugar3 to GTK4/Sugar4, adding full standalone execution support. Core functionality is preserved, the UI is modernized, and the activity now runs both inside and outside Sugar seamlessly.

What’s Changed

Core Migration

  • Migrated to GTK4 with Sugar4 imports and fallback support.
  • Introduced append_toolbar() for cleaner toolbar management.
  • Introduced minimal fallback components to simulate sugar4 APIs
  • Added GTK4 compatibility shims for:
    • Toolbars, separators, and event boxes
    • Entry text insertion
    • Box packing/reordering

Compatibility

  • Works standalone
  • Runs inside Sugar4 if available
  • GTK4 required and fully functional

Known Limitations

  • Not compatible with current Sugar (GTK3-based)
  • Fallback widgets are minimal and do not fully replicate Sugar behavior
  • Visual differences may exist due to absence of Sugar theme

Testing

Tested on Fedora Linux 42 (WSL) with GTK4:

GDK_BACKEND=x11 python3 main.py
calculate-activity.mp4

…ies; add standalone GTK4 execution with fallback Sugar4-compatible components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant