\end_layout
\begin_layout Verbatim
-
This is Verbatim.
\end_layout
\begin_layout Verbatim
\noindent
\align block
-
The following 2 lines are empty:
\end_layout
\end_layout
\begin_layout Verbatim
-
Almost everything is allowed in Verbatim:"%&$§#~'`
\backslash
}][{|
\end_layout
\begin_layout Verbatim*
-
This is Verbatim*.
\end_layout
Buffer
\family default
- can be turned on and off.
+ can be turned
+\emph on
+on
+\emph default
+ and
+\emph on
+off
+\emph default
+.
The
\emph on
on
\emph default
state is denoted in the menu with a checkmark.
- The
+
+\change_deleted -712698321 1608195495
+
+\change_inserted -712698321 1608195492
+
+\end_layout
+
+\begin_layout Standard
+The
+\change_inserted -712698321 1608195407
+
+\family sans
+Phonetic
+\begin_inset space ~
+\end_inset
+
+Symbols
+\family default
+,
+\change_unchanged
+
\family sans
Table
\family default
toolbars can additionally be set to the state
\emph on
automatic
+\change_deleted -712698321 1608195728
+
\emph default
-, denoted in the menu with the suffix
+,
+\change_inserted -712698321 1608196033
+.
+ The state of these toolbars is set and indicated in a submenu which lets
+ you select
+\family sans
+On
+\family default
+,
+\family sans
+Off
+\family default
+, and
+\family sans
+Automatic
+\family default
+.
+\change_deleted -712698321 1608195563
+denoted in the menu with the suffix
\family sans
(auto)
\family default
.
+\change_unchanged
+
\end_layout
\begin_layout Standard
\emph on
on
\emph default
- state the toolbar is permanently shown; in the
+ state the toolbar is permanently shown
+\change_inserted -712698321 1608195803
+, in the
+\emph on
+off
+\emph default
+ state it is never shown
+\change_unchanged
+; in the
\emph on
automatic
\emph default
or when a certain feature is enabled.
That means that the review toolbar will only be shown if change tracking
is activated, the math and table toolbars are only shown if the cursor
- is inside a formula or table respectively.
+ is inside a formula or table respectively
+\change_inserted -712698321 1608195857
+, the phonetic symbols toolbar only in the phonetic symbols environment
+\change_unchanged
+.
\end_layout
\begin_layout Standard
\end_layout
\begin_layout Verbatim
+
Dies ist Unformatiert.
\end_layout
\begin_layout Verbatim
+
Die folgenden 2 Zeilen sind leer:
\end_layout
\end_layout
\begin_layout Verbatim
+
Fast alles ist in Unformatiert erlaubt:"%&$§#~'`
\backslash
}][{|
\end_layout
\begin_layout Verbatim*
+
Dies ist Unformatiert*.
\end_layout
Befehlseingabefenster
\family default
können an- und ausgeschaltet werden.
- Der Zustand
+ Der Status
\emph on
an
\emph default
ist im Menü mit einem Häkchen gekennzeichnet.
- Die Werkzeugleisten
+
+\end_layout
+
+\begin_layout Standard
+Die Werkzeugleisten
\family sans
Überarbeiten
\family default
\family default
,
\family sans
-Mathe-Makros
+Mathe-Makros,
\family default
- und
+
\family sans
Mathe
\family default
- können zusätzlich auf den Zustand
+ und
+\family sans
+Phonetische Symbole
+\family default
+ können zusätzlich auf den Status
\emph on
automatisch
\emph default
- gesetzt werden, der im Menü mit dem Suffix
-\family sans
-(automatisch)
-\family default
- gekennzeichnet ist.
+ gesetzt werden.
+ Der Status dieser Werkzeugleisten wird in einem Untermenü mit den Einträgen
+ Ein, Aus und Automatisch gesetzt und angezeigt.
\end_layout
\begin_layout Standard
-Im Zustand
+Im Status
\emph on
an
\emph default
- wird die Werkzeugleiste permanent angezeigt, im Zustand
+ wird die Werkzeugleiste permanent angezeigt, im Status
+\emph on
+aus
+\emph default
+ nie.
+ Im Zustand
\emph on
automatisch
\emph default
\family sans
Überarbeiten
\family default
- nur angezeigt wird, wenn Änderungsverfolgung aktiviert ist, die Mathe und
- Tabellen Werkzeugleisten werden nur angezeigt, wenn der Cursor in einer
+ nur angezeigt wird, wenn Änderungsverfolgung aktiviert ist, die Mathe-
+ und Tabellen-Werkzeugleisten werden nur angezeigt, wenn der Cursor in einer
Formel bzw.
\begin_inset space \space{}
\end_inset
-Tabelle ist.
+Tabelle ist, die Werkzeugleiste mit phonetischen Symbolen nur in der Einfügung
+
+\emph on
+Phonetische Symbole
+\emph default
+.
\end_layout
\begin_layout Standard
LFUN_IF_RELATIVES, // spitz 20200102
LFUN_WINDOW_RAISE, // forenr, 20202104
LFUN_CITATION_OPEN, // sanda, 20200815
+ LFUN_TOOLBAR_SET, // spitz 20201217
+ // 385
LFUN_LASTACTION // end of the table
};
*/
{ LFUN_TOOLBAR_MOVABLE, "toolbar-movable", NoBuffer, Buffer },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_TOOLBAR_SET
+ * \li Action: Sets visibility of a given toolbar to on, off, or auto.
+ * \li Notion: Skipping "auto" when allowauto is false.
+ * \li Syntax: toolbar-set <NAME> [on|off|auto]
+ * \li Params: <NAME>: standard|extra|table|math|mathmacrotemplate|\n
+ minibuffer|review|view/update|math_panels|vcs|
+ view-others|update-others
+ * \li Origin: spitz, 17 Dec 2020
+ * \endvar
+ */
+ { LFUN_TOOLBAR_SET, "toolbar-set", NoBuffer, Buffer },
+
/*!
* \var lyx::FuncCode lyx::LFUN_TOOLBAR_TOGGLE
* \li Action: Toggles visibility of a given toolbar between on/off/auto.
}
-void GuiToolbar::toggle()
+void GuiToolbar::setState(string const state)
{
- docstring state;
- if (visibility_ & Toolbars::ALLOWAUTO) {
- if (!(visibility_ & Toolbars::AUTO)) {
+ docstring newstate;
+ if (state == "auto") {
+ if (visibility_ & Toolbars::ALLOWAUTO) {
visibility_ |= Toolbars::AUTO;
hide();
- state = _("auto");
- } else {
- visibility_ &= ~Toolbars::AUTO;
- if (isVisible()) {
- hide();
- state = _("off");
- } else {
- show();
- state = _("on");
- }
- }
+ newstate = _("auto");
+ } else
+ owner_.message(bformat(_("Toolbar \"%1$s\" does not support state \"auto\""),
+ qstring_to_ucs4(windowTitle())));
} else {
- if (isVisible()) {
+ if (visibility_ & Toolbars::AUTO)
+ visibility_ &= ~Toolbars::AUTO;
+ if (state == "off") {
hide();
- state = _("off");
- } else {
+ newstate = _("off");
+ } else if (state == "on") {
show();
- state = _("on");
+ newstate = _("on");
}
}
owner_.message(bformat(_("Toolbar \"%1$s\" state set to %2$s"),
- qstring_to_ucs4(windowTitle()), state));
+ qstring_to_ucs4(windowTitle()), newstate));
+}
+
+
+void GuiToolbar::toggle()
+{
+ if (visibility_ & Toolbars::ALLOWAUTO) {
+ if (!(visibility_ & Toolbars::AUTO) && !isVisibiltyOn()) {
+ setState("auto");
+ } else {
+ if (isVisibiltyOn())
+ setState("off");
+ else
+ setState("on");
+ }
+ } else {
+ if (isVisible())
+ setState("off");
+ else
+ setState("on");
+ }
}
void GuiToolbar::movable(bool silent)
/// Refresh the contents of the bar.
void update(int context = 0);
+ ///
+ void setState(std::string const state);
///
void toggle();
flag.setOnOff(devel_mode_);
break;
+ case LFUN_TOOLBAR_SET: {
+ string const name = cmd.getArg(0);
+ string const state = cmd.getArg(1);
+ if (name.empty() || state.empty()) {
+ enable = false;
+ docstring const msg =
+ _("Function toolbar-set requires two arguments!");
+ flag.message(msg);
+ break;
+ }
+ if (state != "on" && state != "off" && state != "auto") {
+ enable = false;
+ docstring const msg =
+ bformat(_("Invalid argument \"%1$s\" to function toolbar-set!"),
+ from_utf8(state));
+ flag.message(msg);
+ break;
+ }
+ if (GuiToolbar * t = toolbar(name)) {
+ bool const autovis = t->visibility() & Toolbars::AUTO;
+ if (state == "on")
+ flag.setOnOff(t->isVisible() && !autovis);
+ else if (state == "off")
+ flag.setOnOff(!t->isVisible() && !autovis);
+ else if (state == "auto")
+ flag.setOnOff(autovis);
+ } else {
+ enable = false;
+ docstring const msg =
+ bformat(_("Unknown toolbar \"%1$s\""), from_utf8(name));
+ flag.message(msg);
+ }
+ break;
+ }
+
case LFUN_TOOLBAR_TOGGLE: {
string const name = cmd.getArg(0);
if (GuiToolbar * t = toolbar(name))
dr.setMessage(_("Developer mode is now disabled."));
break;
+ case LFUN_TOOLBAR_SET: {
+ string const name = cmd.getArg(0);
+ string const state = cmd.getArg(1);
+ if (GuiToolbar * t = toolbar(name))
+ t->setState(state);
+ break;
+ }
+
case LFUN_TOOLBAR_TOGGLE: {
string const name = cmd.getArg(0);
if (GuiToolbar * t = toolbar(name))
Toolbars::Infos::const_iterator cit = guiApp->toolbars().begin();
Toolbars::Infos::const_iterator end = guiApp->toolbars().end();
for (; cit != end; ++cit) {
- MenuItem const item(MenuItem::Command, toqstr(cit->gui_name),
- FuncRequest(LFUN_TOOLBAR_TOGGLE, cit->name));
+ MenuItem item(MenuItem::Command, toqstr(cit->gui_name),
+ FuncRequest(LFUN_TOOLBAR_TOGGLE, cit->name));
+ if (cit->allow_auto) {
+ MenuDefinition tristate;
+ tristate.add(MenuItem(MenuItem::Command, qt_("[[Toolbar]]On|O"),
+ FuncRequest(LFUN_TOOLBAR_SET, cit->name + " on")));
+ tristate.add(MenuItem(MenuItem::Command, qt_("[[Toolbar]]Off|f"),
+ FuncRequest(LFUN_TOOLBAR_SET, cit->name + " off")));
+ tristate.add(MenuItem(MenuItem::Command, qt_("[[Toolbar]]Automatic|A"),
+ FuncRequest(LFUN_TOOLBAR_SET, cit->name + " auto")));
+ item = MenuItem(MenuItem::Submenu,toqstr(cit->gui_name));
+ item.setSubmenu(tristate);
+ }
if (guiApp->toolbars().isMainToolbar(cit->name))
add(item);
else
if (visibility & ALLOWAUTO) {
if (ToolbarInfo const * ti = info(name))
- const_cast<ToolbarInfo *>(ti)->gui_name +=
- " (" + _("auto") + ")";
+ const_cast<ToolbarInfo *>(ti)->allow_auto = true;
}
}
}
typedef Items::const_iterator item_iterator;
explicit ToolbarInfo(std::string const & name = std::string())
- : name(name) {}
+ : name(name), allow_auto(false) {}
/// toolbar name
std::string name;
/// toolbar GUI name
docstring gui_name;
+ /// allows auto visibility
+ bool allow_auto;
/// toolbar contents
Items items;