Thanks. I think it worked (patch and screenshot of gitk attached).
On 12.07.2016 00:10, Richard Heck wrote:
[...] Then right-click on the commit for which you want to
make the patch.
You will have the option "Make patch". Choose that and then choose where
to save it.
Should I try to commit the patch before making the patch?
Also, playing around with LFUNs I did to kinds of changes in the patch
1) a LFUN for locking the position of toolbars
2) a LFUN for setting custom icon sizes
Since they are unrelated, I guess it would be good to keep them in
patches apart, right?
But I can't find where to tell gitk to add only parts of the "local"
changes.
Daniel
diff --git a/src/FuncCode.h b/src/FuncCode.h
index 40ec9d3..3404a0c 100644
--- a/src/FuncCode.h
+++ b/src/FuncCode.h
@@ -362,6 +362,8 @@ enum FuncCode
LFUN_LISTING_INSERT, // Herbert 20011110, bpeng 20070502
// 275
LFUN_TOOLBAR_TOGGLE, // Edwin 20070521
+ LFUN_TOOLBAR_MOVABLE, // 20160711
+ LFUN_ICON_SIZE, // 20160711
LFUN_BUFFER_WRITE_ALL, // rgh, gpothier 200707XX
LFUN_PARAGRAPH_PARAMS,
LFUN_LAYOUT_MODULES_CLEAR,
diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp
index 3702810..9594699 100644
--- a/src/LyXAction.cpp
+++ b/src/LyXAction.cpp
@@ -2728,6 +2728,26 @@ void LyXAction::init()
*/
{ LFUN_TOOLBAR_TOGGLE, "toolbar-toggle", NoBuffer, Buffer },
/*!
+* \var lyx::FuncCode lyx::LFUN_TOOLBAR_MOVABLE
+* \li Action: Toggles movability of a given toolbar between true/false.
+* \li Syntax: toolbar-toggle <NAME>
+* \li Params: <NAME>: standard|extra|table|math|mathmacrotemplate|\n
+minibuffer|review|view/update|math_panels|vcs|
+view-others|update-others
+* \li Origin: 11 July 2016
+* \endvar
+*/
+ { LFUN_TOOLBAR_MOVABLE, "toolbar-movable", NoBuffer, Buffer },
+/*!
+* \var lyx::FuncCode lyx::LFUN_ICON_SIZE
+* \li Action: Sets icon size of toolbars.
+* \li Syntax: icon-size <SIZE>
+* \li Params: <SIZE>: int
+* \li Origin: 11 July 2016
+* \endvar
+*/
+ { LFUN_ICON_SIZE, "icon-size", NoBuffer, Buffer },
+/*!
* \var lyx::FuncCode lyx::LFUN_MENU_OPEN
* \li Action: Opens the menu given by its name.
* \li Syntax: menu-open <NAME>
diff --git a/src/frontends/qt4/GuiToolbar.cpp b/src/frontends/qt4/GuiToolbar.cpp
index 77471c9..f9c8167 100644
--- a/src/frontends/qt4/GuiToolbar.cpp
+++ b/src/frontends/qt4/GuiToolbar.cpp
@@ -409,6 +409,16 @@ void GuiToolbar::toggle()
qstring_to_ucs4(windowTitle()), state));
}
+void GuiToolbar::movable()
+{
+ setMovable(!isMovable());
+
+ docstring state = _("test");
+
+ owner_.message(bformat(_("Toolbar \"%1$s\" state set to %2$s"),
+ qstring_to_ucs4(windowTitle()), state));
+}
+
} // namespace frontend
} // namespace lyx
diff --git a/src/frontends/qt4/GuiToolbar.h b/src/frontends/qt4/GuiToolbar.h
index caad355..ded027a 100644
--- a/src/frontends/qt4/GuiToolbar.h
+++ b/src/frontends/qt4/GuiToolbar.h
@@ -98,6 +98,9 @@ public:
void toggle();
///
+ void movable();
+
+ ///
GuiCommandBuffer * commandBuffer() { return command_buffer_; }
///
diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp
index b94625b..3504b7e 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -731,14 +731,14 @@ bool GuiView::restoreLayout()
//code below is skipped when when ~/.config/LyX is (re)created
QSize icon_size = settings.value(icon_key).toSize();
// Check whether session size changed.
- if (icon_size.width() != int(d.smallIconSize) &&
+ /*if (icon_size.width() != int(d.smallIconSize) &&
icon_size.width() != int(d.normalIconSize) &&
icon_size.width() != int(d.bigIconSize) &&
icon_size.width() != int(d.hugeIconSize) &&
icon_size.width() != int(d.giantIconSize)) {
icon_size.setWidth(d.normalIconSize);
icon_size.setHeight(d.normalIconSize);
- }
+ }*/
setIconSize(icon_size);
#if defined(Q_WS_X11) || defined(QPA_XCB)
@@ -1096,7 +1096,6 @@ void GuiView::updateStatusBarMessage(QString const & str)
d.statusbar_timer_.start(3000);
}
-
void GuiView::smallSizedIcons()
{
setIconSize(QSize(d.smallIconSize, d.smallIconSize));
@@ -1892,6 +1891,23 @@ bool GuiView::getStatus(FuncRequest const & cmd,
FuncStatus & flag)
break;
}
+ case LFUN_TOOLBAR_MOVABLE: {
+ string const name = cmd.getArg(0);
+ if (GuiToolbar * t = toolbar(name))
+ flag.setOnOff(t->isMovable());
+ else {
+ enable = false;
+ docstring const msg =
+ bformat(_("Unknown toolbar \"%1$s\""),
from_utf8(name));
+ flag.message(msg);
+ }
+ break;
+ }
+
+ case LFUN_ICON_SIZE:
+ // Nothing to check.
+ break;
+
case LFUN_DROP_LAYOUTS_CHOICE:
enable = buf != 0;
break;
@@ -3773,6 +3789,19 @@ void GuiView::dispatch(FuncRequest const & cmd,
DispatchResult & dr)
break;
}
+ case LFUN_TOOLBAR_MOVABLE: {
+ string const name = cmd.getArg(0);
+ if (GuiToolbar * t = toolbar(name))
+ t->movable();
+ break;
+ }
+
+ case LFUN_ICON_SIZE: {
+ string const size = cmd.getArg(0);
+ setIconSize(QSize(stoi(size), stoi(size)));
+ break;
+ }
+
case LFUN_DIALOG_UPDATE: {
string const name = to_utf8(cmd.argument());
if (name == "prefs" || name == "document")