]> git.lyx.org Git - lyx.git/commitdiff
Disable valign widget in tabularx tables
authorJuergen Spitzmueller <spitz@lyx.org>
Wed, 14 Aug 2024 14:28:15 +0000 (16:28 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 15 Aug 2024 05:32:04 +0000 (07:32 +0200)
See https://marc.info/?l=lyx-users&m=172363857509065&w=2

(cherry picked from commit c993485782a1f47c6eafc9335c8905b3def7e083)

src/frontends/qt/GuiTabular.cpp
src/insets/InsetTabular.cpp
status.24x

index 5c32edc7d4c4fe55fe957b7515546c9ce467d0d0..26f3f6debb2ecf5778c72e612c7c65641d5343a1 100644 (file)
@@ -267,7 +267,8 @@ void GuiTabular::enableWidgets() const
        bool const enable_valign =
                !multirowCB->isChecked()
                && !widgetsToLength(columnWidthED, columnWidthUnitLC).empty()
-               && specialAlignmentED->text().isEmpty();
+               && specialAlignmentED->text().isEmpty()
+               && funcEnabled(Tabular::VALIGN_BOTTOM);
        vAlignCO->setEnabled(enable_valign);
        vAlignLA->setEnabled(enable_valign);
 
index 2365d2e1bee801b301e0a086995674e9586acf71..758400f7c260120a1c1e88ce1b814fb706a58bc1 100644 (file)
@@ -5675,6 +5675,7 @@ bool InsetTabular::getFeatureStatus(Cursor & cur, string const & s,
                col_type sel_col_end = 0;
                Tabular::ltType dummyltt;
                bool flag = true;
+               bool const tabularx = tabular.hasVarwidthColumn();
 
                getSelection(cur, sel_row_start, sel_row_end, sel_col_start, sel_col_end);
 
@@ -5950,7 +5951,8 @@ bool InsetTabular::getFeatureStatus(Cursor & cur, string const & s,
                        flag = false;
                        // fall through
                case Tabular::VALIGN_BOTTOM:
-                       status.setEnabled((!tabular.getPWidth(cur.idx()).zero()
+                       status.setEnabled(!tabularx
+                                         && (!tabular.getPWidth(cur.idx()).zero()
                                           || tabular.getUsebox(cur.idx()) == Tabular::BOX_VARWIDTH));
                        status.setOnOff(
                                tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_BOTTOM);
@@ -5960,7 +5962,8 @@ bool InsetTabular::getFeatureStatus(Cursor & cur, string const & s,
                        flag = false;
                        // fall through
                case Tabular::VALIGN_MIDDLE:
-                       status.setEnabled((!tabular.getPWidth(cur.idx()).zero()
+                       status.setEnabled(!tabularx
+                                         && (!tabular.getPWidth(cur.idx()).zero()
                                           || tabular.getUsebox(cur.idx()) == Tabular::BOX_VARWIDTH));
                        status.setOnOff(
                                tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_MIDDLE);
index b0a7e1d40bf31422395c9e96e90228c1ea24f380..1df3c6b7a78dc4094cbe824f301e03f4f20fa561 100644 (file)
@@ -94,6 +94,10 @@ What's new
 
 - Display values of cross-references in tooltips for forward references.
 
+- Disable vertical alignment in tables with variable width columns (tabularx
+  and xltable), as this is not supported by the packages. Also fix the
+  disabling mechanism in the table dialog.
+
 
 * INTERNALS