mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 21:40:19 +00:00
Add tabular-features set-inner-lines and fix set-all-lines behavior
Patch by Daniel Ramöller (racoon) Fixes: #11382
This commit is contained in:
parent
2927179499
commit
cb84f752f2
@ -569,6 +569,7 @@ dist_images_DATA1X = \
|
||||
images/tabular-feature_set-longtabular.svgz \
|
||||
images/tabular-feature_set-rotate-cell.svgz \
|
||||
images/tabular-feature_set-border-lines.svgz \
|
||||
images/tabular-feature_set-inner-lines.svgz \
|
||||
images/tabular-feature_set-rotate-tabular.svgz \
|
||||
images/tabular-feature_toggle-line-bottom.svgz \
|
||||
images/tabular-feature_toggle-line-left.svgz \
|
||||
@ -1848,6 +1849,7 @@ dist_imagesoxygen_DATA1X = \
|
||||
images/oxygen/tabular-feature_multirow.svgz \
|
||||
images/oxygen/tabular-feature_set-all-lines.svgz \
|
||||
images/oxygen/tabular-feature_set-border-lines.svgz \
|
||||
images/oxygen/tabular-feature_set-inner-lines.svgz \
|
||||
images/oxygen/tabular-feature_set-longtabular.svgz \
|
||||
images/oxygen/tabular-feature_toggle-line-bottom.svgz \
|
||||
images/oxygen/tabular-feature_toggle-line-left.svgz \
|
||||
@ -2045,6 +2047,7 @@ dist_imagesclassic_DATA = \
|
||||
images/classic/tabular-feature_multirow.png \
|
||||
images/classic/tabular-feature_set-all-lines.png \
|
||||
images/classic/tabular-feature_set-border-lines.png \
|
||||
images/classic/tabular-feature_set-inner-lines.png \
|
||||
images/classic/tabular-feature_set-longtabular.png \
|
||||
images/classic/tabular-feature_set-rotate-cell.png \
|
||||
images/classic/tabular-feature_set-rotate-tabular.png \
|
||||
|
BIN
lib/images/classic/tabular-feature_set-inner-lines.png
Normal file
BIN
lib/images/classic/tabular-feature_set-inner-lines.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 6.5 KiB |
BIN
lib/images/oxygen/tabular-feature_set-inner-lines.svgz
Normal file
BIN
lib/images/oxygen/tabular-feature_set-inner-lines.svgz
Normal file
Binary file not shown.
BIN
lib/images/tabular-feature_set-inner-lines.svgz
Normal file
BIN
lib/images/tabular-feature_set-inner-lines.svgz
Normal file
Binary file not shown.
@ -159,6 +159,7 @@ ToolbarSet
|
||||
Item "Set right line" "tabular-feature toggle-line-right"
|
||||
Item "Set border lines" "tabular-feature set-border-lines"
|
||||
Item "Set all lines" "tabular-feature set-all-lines"
|
||||
Item "Set inner lines" "tabular-feature set-inner-lines"
|
||||
Item "Unset all lines" "tabular-feature unset-all-lines"
|
||||
Separator
|
||||
Item "Align left" "command-alternatives tabular-feature m-align-left;tabular-feature align-left"
|
||||
|
@ -199,6 +199,7 @@ TabularFeature tabularFeature[] =
|
||||
{ Tabular::LONGTABULAR_ALIGN_RIGHT, "longtabular-align-right", false },
|
||||
{ Tabular::SET_DECIMAL_POINT, "set-decimal-point", true },
|
||||
{ Tabular::SET_TABULAR_WIDTH, "set-tabular-width", true },
|
||||
{ Tabular::SET_INNER_LINES, "set-inner-lines", false },
|
||||
{ Tabular::LAST_ACTION, "", false }
|
||||
};
|
||||
|
||||
@ -4969,6 +4970,7 @@ bool InsetTabular::getFeatureStatus(Cursor & cur, string const & s,
|
||||
|
||||
case Tabular::SET_ALL_LINES:
|
||||
case Tabular::UNSET_ALL_LINES:
|
||||
case Tabular::SET_INNER_LINES:
|
||||
case Tabular::SET_BORDER_LINES:
|
||||
status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
|
||||
break;
|
||||
@ -5779,6 +5781,7 @@ void InsetTabular::tabularFeatures(Cursor & cur,
|
||||
row_type sel_row_start;
|
||||
row_type sel_row_end;
|
||||
bool setLines = false;
|
||||
bool setLinesInnerOnly = false;
|
||||
LyXAlignment setAlign = LYX_ALIGN_LEFT;
|
||||
Tabular::VAlignment setVAlign = Tabular::LYX_VALIGN_TOP;
|
||||
|
||||
@ -6131,6 +6134,9 @@ void InsetTabular::tabularFeatures(Cursor & cur,
|
||||
break;
|
||||
}
|
||||
|
||||
case Tabular::SET_INNER_LINES:
|
||||
setLinesInnerOnly = true;
|
||||
// fall through
|
||||
case Tabular::SET_ALL_LINES:
|
||||
setLines = true;
|
||||
// fall through
|
||||
@ -6138,10 +6144,16 @@ void InsetTabular::tabularFeatures(Cursor & cur,
|
||||
for (row_type r = sel_row_start; r <= sel_row_end; ++r)
|
||||
for (col_type c = sel_col_start; c <= sel_col_end; ++c) {
|
||||
idx_type const cell = tabular.cellIndex(r, c);
|
||||
tabular.setTopLine(cell, setLines);
|
||||
tabular.setBottomLine(cell, setLines);
|
||||
tabular.setRightLine(cell, setLines);
|
||||
tabular.setLeftLine(cell, setLines);
|
||||
if (!setLinesInnerOnly || r != sel_row_start)
|
||||
tabular.setTopLine(cell, setLines);
|
||||
if ((!setLinesInnerOnly || r != sel_row_end)
|
||||
&& (!setLines || r == sel_row_end))
|
||||
tabular.setBottomLine(cell, setLines);
|
||||
if ((!setLinesInnerOnly || c != sel_col_end)
|
||||
&& (!setLines || c == sel_col_end))
|
||||
tabular.setRightLine(cell, setLines);
|
||||
if ((!setLinesInnerOnly || c != sel_col_start))
|
||||
tabular.setLeftLine(cell, setLines);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -306,6 +306,8 @@ public:
|
||||
///
|
||||
SET_TABULAR_WIDTH,
|
||||
///
|
||||
SET_INNER_LINES,
|
||||
///
|
||||
LAST_ACTION
|
||||
};
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user