now that we can set arbitrary lines in tabular it is convenient to be able to easily set the border around a selection

the attached patch does this

i will also add a new icon for on the toolbar (and i updated the other icons so that they all match in size, see attached image)

line setting was never so easy! ;-)

ok to go in trunk?

ed.
Index: lib/images/tabular-feature_set-all-lines.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: lib/images/tabular-feature_set-border-lines.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: lib\images\tabular-feature_set-border-lines.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: lib/images/tabular-feature_toggle-line-bottom.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: lib/images/tabular-feature_toggle-line-left.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: lib/images/tabular-feature_toggle-line-right.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: lib/images/tabular-feature_toggle-line-top.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: lib/images/tabular-feature_unset-all-lines.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: lib/ui/stdtoolbars.inc
===================================================================
--- lib/ui/stdtoolbars.inc	(revision 23836)
+++ lib/ui/stdtoolbars.inc	(working copy)
@@ -122,6 +122,7 @@
 		Item "Set bottom line" "tabular-feature toggle-line-bottom"
 		Item "Set left line" "tabular-feature toggle-line-left"
 		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 "Unset all lines" "tabular-feature unset-all-lines"
 		Separator
Index: src/insets/InsetTabular.cpp
===================================================================
--- src/insets/InsetTabular.cpp	(revision 23836)
+++ src/insets/InsetTabular.cpp	(working copy)
@@ -157,6 +157,7 @@
 	{ Tabular::SET_TOP_SPACE, "set-top-space" },
 	{ Tabular::SET_BOTTOM_SPACE, "set-bottom-space" },
 	{ Tabular::SET_INTERLINE_SPACE, "set-interline-space" },
+	{ Tabular::SET_BORDER_LINES, "set-border-lines" },
 	{ Tabular::LAST_ACTION, "" }
 };
 
@@ -3607,6 +3608,7 @@
 		case Tabular::SET_TOP_SPACE:
 		case Tabular::SET_BOTTOM_SPACE:
 		case Tabular::SET_INTERLINE_SPACE:
+		case Tabular::SET_BORDER_LINES:
 			status.clear();
 			return true;
 
@@ -4343,6 +4345,17 @@
 					tabular.cellIndex(i,j), setLines);
 		break;
 
+	case Tabular::SET_BORDER_LINES:
+		for (row_type i = sel_row_start; i <= sel_row_end; ++i) {
+			tabular.setLeftLine(tabular.cellIndex(i, sel_col_start), true);
+			tabular.setRightLine(tabular.cellIndex(i, sel_col_end), true);
+		}
+		for (col_type j = sel_col_start; j <= sel_col_end; ++j) {
+			tabular.setTopLine(tabular.cellIndex(sel_row_start, j), true);
+			tabular.setBottomLine(tabular.cellIndex(sel_row_end, j), true);
+		}
+		break;
+
 	case Tabular::SET_LONGTABULAR:
 		tabular.setLongTabular(true);
 		break;
Index: src/insets/InsetTabular.h
===================================================================
--- src/insets/InsetTabular.h	(revision 23836)
+++ src/insets/InsetTabular.h	(working copy)
@@ -175,6 +175,8 @@
 		///
 		SET_INTERLINE_SPACE,
 		///
+		SET_BORDER_LINES,
+		///
 		LAST_ACTION
 	};
 	///

<<inline: tablines.png>>

Reply via email to