images/tabular-feature_move-row-up.svgz \
images/tabular-feature_multicolumn.svgz \
images/tabular-feature_multirow.svgz \
+ images/tabular-feature_reset-formal-default.svgz \
images/tabular-feature_set-all-lines.svgz \
images/tabular-feature_set-longtabular.svgz \
images/tabular-feature_set-rotate-cell.svgz \
images/oxygen/tabular-feature_move-row-up.svgz \
images/oxygen/tabular-feature_multicolumn.svgz \
images/oxygen/tabular-feature_multirow.svgz \
+ images/oxygen/tabular-feature_reset-formal-default.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/classic/tabular-feature_m-valign-top.png \
images/classic/tabular-feature_multicolumn.png \
images/classic/tabular-feature_multirow.png \
+ images/classic/tabular-feature_reset-formal-default.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 \
Item "Bottom|B" "tabular-feature toggle-line-bottom"
Item "Left|L" "tabular-feature toggle-line-left"
Item "Right|R" "tabular-feature toggle-line-right"
+ OptItem "Reset Formal Defaults|F" "tabular-feature reset-formal-default"
End
Menu "table-alignment"
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"
+ Item "Reset formal default lines" "tabular-feature reset-formal-default"
Separator
Item "Align left" "command-alternatives tabular-feature m-align-left;tabular-feature align-left"
Item "Align center" "command-alternatives tabular-feature m-align-center;tabular-feature align-center"
valign-top|valign-bottom|valign-middle|longtabular-align-left|\n
longtabular-align-center|longtabular-align-right|m-align-left|m-align-right|\n
m-align-center|m-valign-top|m-valign-bottom|m-valign-middle|multicolumn|\n
- set-all-lines|unset-all-lines|toggle-longtabular|set-longtabular|unset-longtabular|set-pwidth|\n
+ reset-formal-default|set-all-lines|unset-all-lines|toggle-longtabular|\n
+ set-longtabular|unset-longtabular|set-pwidth|\n
set-mpwidth|set-rotate-tabular|unset-rotate-tabular|toggle-rotate-tabular|\n
set-rotate-cell|unset-rotate-cell|toggle-rotate-cell|set-usebox|set-lthead|\n
unset-lthead|set-ltfirsthead|unset-ltfirsthead|set-ltfoot|unset-ltfoot|\n
this, SLOT(borderSet_clicked()));
connect(borderUnsetPB, SIGNAL(clicked()),
this, SLOT(borderUnset_clicked()));
+ connect(resetFormalCB, SIGNAL(clicked()),
+ this, SLOT(checkEnabled()));
connect(hAlignCO, SIGNAL(activated(int)),
this, SLOT(checkEnabled()));
connect(vAlignCO, SIGNAL(activated(int)),
hAlignCO->itemData(hAlignCO->currentIndex()).toString() == QString("decimal");
decimalPointED->setEnabled(dalign);
decimalLA->setEnabled(dalign);
+ resetFormalCB->setEnabled(booktabsRB->isChecked());
bool const setwidth = TableAlignCO->currentText() == qt_("Middle");
tabularWidthLA->setEnabled(setwidth);
}
//
- if (borders->topLineSet() && borders->bottomLineSet() && borders->leftLineSet()
+ if (resetFormalCB->isChecked())
+ setParam(param_str, Tabular::RESET_FORMAL_DEFAULT);
+ else if (borders->topLineSet() && borders->bottomLineSet() && borders->leftLineSet()
&& borders->rightLineSet())
setParam(param_str, Tabular::SET_ALL_LINES);
else if (borders->topLineUnset() && borders->bottomLineUnset() && borders->leftLineUnset()
</color>
</brush>
</colorrole>
+ <colorrole role="PlaceholderText">
+ <brush brushstyle="NoBrush">
+ <color alpha="128">
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
</active>
<inactive>
<colorrole role="WindowText">
</color>
</brush>
</colorrole>
+ <colorrole role="PlaceholderText">
+ <brush brushstyle="NoBrush">
+ <color alpha="128">
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
</color>
</brush>
</colorrole>
+ <colorrole role="PlaceholderText">
+ <brush brushstyle="NoBrush">
+ <color alpha="128">
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
</disabled>
</palette>
</property>
<bool>true</bool>
</property>
<layout class="QGridLayout">
- <item row="1" column="0">
- <widget class="QRadioButton" name="booktabsRB">
+ <item row="0" column="0">
+ <widget class="QRadioButton" name="borderDefaultRB">
<property name="toolTip">
- <string>Use formal (a.k.a. booktabs) border style (no vertical borders)</string>
+ <string>Use default (grid-like) border style</string>
</property>
<property name="text">
- <string>Fo&rmal</string>
+ <string>De&fault</string>
</property>
- <property name="checked">
- <bool>true</bool>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="resetFormalCB">
+ <property name="toolTip">
+ <string>If this is checked, the table will be reset to the formal default style (only top and bottom row have vertical lines)</string>
+ </property>
+ <property name="text">
+ <string>Use Default &Formal Style</string>
</property>
</widget>
</item>
- <item row="0" column="0">
- <widget class="QRadioButton" name="borderDefaultRB">
+ <item row="1" column="0">
+ <widget class="QRadioButton" name="booktabsRB">
<property name="toolTip">
- <string>Use default (grid-like) border style</string>
+ <string>Use formal (a.k.a. booktabs) border style (no vertical borders)</string>
</property>
<property name="text">
- <string>De&fault</string>
+ <string>Fo&rmal</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
</property>
</widget>
</item>
{ Tabular::UNSET_MULTIROW, "unset-multirow", false },
{ Tabular::SET_MROFFSET, "set-mroffset", true },
{ Tabular::SET_ALL_LINES, "set-all-lines", false },
+ { Tabular::RESET_FORMAL_DEFAULT, "reset-formal-default", false },
{ Tabular::UNSET_ALL_LINES, "unset-all-lines", false },
{ Tabular::TOGGLE_LONGTABULAR, "toggle-longtabular", false },
{ Tabular::SET_LONGTABULAR, "set-longtabular", false },
status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
break;
+ case Tabular::RESET_FORMAL_DEFAULT:
+ status.setEnabled(tabular.use_booktabs);
+ break;
+
case Tabular::SET_LINE_TOP:
case Tabular::SET_LINE_BOTTOM:
status.setEnabled(!tabular.ltCaption(tabular.cellRow(cur.idx())));
}
break;
+ case Tabular::RESET_FORMAL_DEFAULT:
+ for (row_type r = 0; r < tabular.nrows(); ++r) {
+ bool const head_or_foot = r == 0 || r == tabular.nrows() - 1;
+ for (col_type c = 0; c < tabular.ncols(); ++c) {
+ idx_type const cell = tabular.cellIndex(r, c);
+ tabular.setTopLine(cell, head_or_foot);
+ tabular.setBottomLine(cell, head_or_foot);
+ tabular.setRightLine(cell, false);
+ tabular.setLeftLine(cell, false);
+ }
+ }
+ break;
+
case Tabular::SET_BORDER_LINES:
for (row_type r = sel_row_start; r <= sel_row_end; ++r) {
tabular.setLeftLine(tabular.cellIndex(r, sel_col_start), true);
///
SET_ALL_LINES,
///
+ RESET_FORMAL_DEFAULT,
+ ///
UNSET_ALL_LINES,
///
TOGGLE_LONGTABULAR,