case LyXRC::RC_SERVERPIPE:
case LyXRC::RC_SET_COLOR:
case LyXRC::RC_SHOW_BANNER:
+ case LyXRC::RC_SHOW_MACRO_LABEL:
case LyXRC::RC_SPELL_COMMAND:
case LyXRC::RC_TEMPDIRPATH:
case LyXRC::RC_TEMPLATEPATH:
{ "\\serverpipe", LyXRC::RC_SERVERPIPE },
{ "\\set_color", LyXRC::RC_SET_COLOR },
{ "\\show_banner", LyXRC::RC_SHOW_BANNER },
+ { "\\show_macro_label", LyXRC::RC_SHOW_MACRO_LABEL },
{ "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
{ "\\spell_command", LyXRC::RC_SPELL_COMMAND },
{ "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
tex_allows_spaces = false;
date_insert_format = "%x";
cursor_follows_scrollbar = false;
+ show_macro_label = true;
dialogs_iconify_with_main = false;
label_init_length = 3;
preview = PREVIEW_OFF;
}
break;
+ case RC_SHOW_MACRO_LABEL:
+ if (lexrc.next()) {
+ show_macro_label = lexrc.getBool();
+ }
+ break;
+
case RC_DIALOGS_ICONIFY_WITH_MAIN:
if (lexrc.next()) {
dialogs_iconify_with_main = lexrc.getBool();
}
if (tag != RC_LAST)
break;
+ case RC_SHOW_MACRO_LABEL:
+ if (ignore_system_lyxrc ||
+ show_macro_label
+ != system_lyxrc.show_macro_label) {
+ os << "\\show_macro_label "
+ << convert<string>(show_macro_label) << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
case RC_DIALOGS_ICONIFY_WITH_MAIN:
if (ignore_system_lyxrc ||
dialogs_iconify_with_main
str = _("LyX normally doesn't update the cursor position if you move the scrollbar. Set to true if you'd prefer to always have the cursor on screen.");
break;
+ case RC_SHOW_MACRO_LABEL:
+ str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
+ break;
+
case RC_CUSTOM_EXPORT_COMMAND:
break;
RC_SERVERPIPE,
RC_SET_COLOR,
RC_SHOW_BANNER,
+ RC_SHOW_MACRO_LABEL,
RC_SPELL_COMMAND,
RC_TEMPDIRPATH,
RC_TEMPLATEPATH,
///
bool cursor_follows_scrollbar;
///
+ bool show_macro_label;
+ ///
bool dialogs_iconify_with_main;
///
int label_init_length;
this, SIGNAL(changed()));
connect(sortEnvironmentsCB, SIGNAL(clicked()),
this, SIGNAL(changed()));
+ connect(showMacroLabelCB, SIGNAL(clicked()),
+ this, SIGNAL(changed()));
connect(autoSaveSB, SIGNAL(valueChanged(int)),
this, SIGNAL(changed()));
connect(autoSaveCB, SIGNAL(clicked()),
rc.allow_geometry_session = allowGeometrySessionCB->isChecked();
rc.cursor_follows_scrollbar = cursorFollowsCB->isChecked();
rc.sort_layouts = sortEnvironmentsCB->isChecked();
+ rc.show_macro_label = showMacroLabelCB->isChecked();
rc.autosave = autoSaveSB->value() * 60;
rc.make_backup = autoSaveCB->isChecked();
rc.num_lastfiles = lastfilesSB->value();
allowGeometrySessionCB->setChecked(rc.allow_geometry_session);
cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
sortEnvironmentsCB->setChecked(rc.sort_layouts);
+ showMacroLabelCB->setChecked(rc.show_macro_label);
// convert to minutes
int mins(rc.autosave / 60);
if (rc.autosave && !mins)
</property>
</widget>
</item>
+ <item row="2" column="0" >
+ <widget class="QCheckBox" name="showMacroLabelCB" >
+ <property name="text" >
+ <string>Show a box with the macro name around Math Macros</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
<tabstops>
<tabstop>uiFileED</tabstop>
<tabstop>uiFilePB</tabstop>
+ <tabstop>tooltipCB</tabstop>
<tabstop>allowGeometrySessionCB</tabstop>
<tabstop>restoreCursorCB</tabstop>
<tabstop>loadSessionCB</tabstop>
<tabstop>autoSaveSB</tabstop>
<tabstop>lastfilesSB</tabstop>
<tabstop>cursorFollowsCB</tabstop>
+ <tabstop>sortEnvironmentsCB</tabstop>
+ <tabstop>showMacroLabelCB</tabstop>
+ <tabstop>pixmapCacheCB</tabstop>
</tabstops>
<includes>
<include location="local" >qt_helpers.h</include>
#include "Cursor.h"
#include "support/debug.h"
#include "LaTeXFeatures.h"
+#include "LyXRC.h"
#include "FuncStatus.h"
#include "FuncRequest.h"
#include "Undo.h"
macro_->unlock();
// calculate dimension with label while editing
- if (editing_[mi.base.bv]) {
+ if (lyxrc.show_macro_label && editing_[mi.base.bv]) {
FontInfo font = mi.base.font;
augmentFont(font, from_ascii("lyxtex"));
Dimension namedim;
for (size_t i = 0; i < nargs(); ++i)
cell(i).setXY(*pi.base.bv, x, y);
- if (editing_[pi.base.bv]) {
+ if (lyxrc.show_macro_label && editing_[pi.base.bv]) {
// draw header and rectangle around
FontInfo font = pi.base.font;
augmentFont(font, from_ascii("lyxtex"));
font.setColor(Color_mathmacrolabel);
Dimension namedim;
mathed_string_dim(font, name(), namedim);
-#if 0
- pi.pain.fillRectangle(x, y - dim.asc, 2 + namedim.width() + 2, dim.height(), Color_mathmacrobg);
- pi.pain.text(x + 2, y, name(), font);
- expx += 2 + namew + 2;
-#endif
+
pi.pain.fillRectangle(x, y - dim.asc, dim.wid, 1 + namedim.height() + 1, Color_mathmacrobg);
pi.pain.text(x + 1, y - dim.asc + namedim.asc + 2, name(), font);
expx += (dim.wid - expanded_.cell(0).dimension(*pi.base.bv).width()) / 2;
+ }
+ if (editing_[pi.base.bv]) {
pi.pain.enterMonochromeMode(Color_mathbg, Color_mathmacroblend);
expanded_.cell(0).draw(pi, expx, expy);
pi.pain.leaveMonochromeMode();
+
+ if (lyxrc.show_macro_label)
+ pi.pain.rectangle(x, y - dim.asc, dim.wid,
+ dim.height(), Color_mathmacroframe);
} else
expanded_.cell(0).draw(pi, expx, expy);
- // draw frame while editing
- if (editing_[pi.base.bv])
- pi.pain.rectangle(x, y - dim.asc, dim.wid, dim.height(), Color_mathmacroframe);
+ if (!lyxrc.show_macro_label)
+ drawMarkers(pi, x, y);
}
// edit mode changed?