using Gtk 4.0;

template $HistoryEntry: ListBoxRow {
  focus-on-click: false;

  Grid grid {
    margin-start: 12;
    margin-end: 16;
    column-homogeneous: true;

    Label equation_label {
      ellipsize: none;
      xalign: 0.0;
      yalign: 0.5;
      wrap: true;
      wrap-mode: word_char;

      GestureClick {
        pressed => $equation_clicked_cb();
      }

      layout {
        column: "0";
        row: "0";
        column-span: "4";
      }

      styles [
        "equation-label",
      ]
    }

    Label equation_symbol {
      label: "=";
      xalign: 0.5;
      yalign: 0.5;
      max-width-chars: 1;

      layout {
        column: "4";
        row: "0";
      }

      styles [
        "equation-symbol",
        "dimmed",
      ]
    }

    Label answer_label {
      ellipsize: end;
      xalign: 1.0;
      yalign: 0.5;
      max-width-chars: 12;

      GestureClick {
        pressed => $answer_clicked_cb();
      }

      layout {
        column: "5";
        row: "0";
        column-span: "2";
      }

      styles [
        "answer-label",
      ]
    }
  }

  styles [
    "history-entry",
  ]
}
