From 264e3a2c1b5dade0f152476679bab9eace82df4e Mon Sep 17 00:00:00 2001 From: Prashant27-07 Date: Thu, 12 Mar 2026 17:58:41 +0530 Subject: [PATCH] [222_54] fix: override tooltip to Toggle cell alignment in tabular context only --- TeXmacs/progs/table/table-menu.scm | 16 ++++++++++++++++ devel/222_54.md | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 devel/222_54.md diff --git a/TeXmacs/progs/table/table-menu.scm b/TeXmacs/progs/table/table-menu.scm index fea8df86c0..b06962e521 100644 --- a/TeXmacs/progs/table/table-menu.scm +++ b/TeXmacs/progs/table/table-menu.scm @@ -668,3 +668,19 @@ ((balloon (icon "tm_cell_join.xpm") "Join selected cells") (cell-set-span-selection))))) + +(tm-define (alternate-first-icon t) + (:require (table-markup-context? t)) + "tm_cell_left.xpm") + +(tm-define (alternate-second-icon t) + (:require (table-markup-context? t)) + "tm_cell_center.xpm") + +(tm-define (alternate-first-name t) + (:require (table-markup-context? t)) + "Toggle cell alignment") + +(tm-define (alternate-second-name t) + (:require (table-markup-context? t)) + "Toggle cell alignment") diff --git a/devel/222_54.md b/devel/222_54.md new file mode 100644 index 0000000000..f5792e0388 --- /dev/null +++ b/devel/222_54.md @@ -0,0 +1,14 @@ +# 222_54 fix: override tooltip to Toggle cell alignment in tabular context only + +## How to test +Open a tabular table in Mogan. Place cursor inside a cell. Check the focus toolbar - the toggle button should now show the correct cell alignment icon (tm_cell_left or tm_cell_center) and tooltip "Toggle cell alignment" instead of the misleading "Toggle numbering". + +## 2026/03/12 fix: override alternate icons and names in tabular context +### What +Override `alternate-first-icon`, `alternate-second-icon`, `alternate-first-name` and `alternate-second-name` in `table-menu.scm` to show correct cell alignment icons and tooltip when inside a tabular context. + +### Why +The button was using `tm_numbered.xpm` with tooltip "Toggle numbering" but it actually toggles cell alignment (tabular vs tabular*). This was misleading to users. + +### How +Used `tm-define` with `(:require (table-markup-context? t))` to override the icon and name functions only inside tabular context in `table-menu.scm`. \ No newline at end of file