Disable valign widget in tabularx tables

See https://marc.info/?l=lyx-users&m=172363857509065&w=2

(cherry picked from commit c993485782)
This commit is contained in:
Juergen Spitzmueller 2024-08-14 16:28:15 +02:00
parent 7d309d08fd
commit 092911880a
3 changed files with 11 additions and 3 deletions

View File

@ -267,7 +267,8 @@ void GuiTabular::enableWidgets() const
bool const enable_valign = bool const enable_valign =
!multirowCB->isChecked() !multirowCB->isChecked()
&& !widgetsToLength(columnWidthED, columnWidthUnitLC).empty() && !widgetsToLength(columnWidthED, columnWidthUnitLC).empty()
&& specialAlignmentED->text().isEmpty(); && specialAlignmentED->text().isEmpty()
&& funcEnabled(Tabular::VALIGN_BOTTOM);
vAlignCO->setEnabled(enable_valign); vAlignCO->setEnabled(enable_valign);
vAlignLA->setEnabled(enable_valign); vAlignLA->setEnabled(enable_valign);

View File

@ -5675,6 +5675,7 @@ bool InsetTabular::getFeatureStatus(Cursor & cur, string const & s,
col_type sel_col_end = 0; col_type sel_col_end = 0;
Tabular::ltType dummyltt; Tabular::ltType dummyltt;
bool flag = true; bool flag = true;
bool const tabularx = tabular.hasVarwidthColumn();
getSelection(cur, sel_row_start, sel_row_end, sel_col_start, sel_col_end); 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; flag = false;
// fall through // fall through
case Tabular::VALIGN_BOTTOM: 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)); || tabular.getUsebox(cur.idx()) == Tabular::BOX_VARWIDTH));
status.setOnOff( status.setOnOff(
tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_BOTTOM); tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_BOTTOM);
@ -5960,7 +5962,8 @@ bool InsetTabular::getFeatureStatus(Cursor & cur, string const & s,
flag = false; flag = false;
// fall through // fall through
case Tabular::VALIGN_MIDDLE: 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)); || tabular.getUsebox(cur.idx()) == Tabular::BOX_VARWIDTH));
status.setOnOff( status.setOnOff(
tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_MIDDLE); tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_MIDDLE);

View File

@ -94,6 +94,10 @@ What's new
- Display values of cross-references in tooltips for forward references. - 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 * INTERNALS