Skip to content

Refactor: Split Custom Cairo Drawing Area and Use GtkBox for Layout #13

@Jo3Zhou

Description

@Jo3Zhou

Description:

Currently, GtkChart combines immediate-mode Cairo drawing and retain-mode GTK layout within a single widget. This makes layout fragile, leads to overlapping issues (e.g., title and axis labels overlapping the chart area), and complicates widget management, especially during redraws or resizes.

To improve layout reliability, code clarity, and maintainability, the Cairo drawing logic should be moved into a dedicated sub-widget, and a GtkBox should be used to manage overall layout, separating the title, chart area, and any future elements.

Benefits:

  • Clean separation between layout management (retain mode) and drawing (immediate mode).
  • Prevents overlap of title and chart area.
  • Makes it easier to extend with additional widgets (e.g., legend, buttons) in the future.
  • New feature to put title layout (top, bottom, left or right)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions