mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
parent
d70ddce841
commit
d48e5330be
@ -142,6 +142,7 @@ LexerKeyword lyxrcTags[] = {
|
|||||||
{ "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
|
{ "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
|
||||||
{ "\\make_backup", LyXRC::RC_MAKE_BACKUP },
|
{ "\\make_backup", LyXRC::RC_MAKE_BACKUP },
|
||||||
{ "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
|
{ "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
|
||||||
|
{ "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
|
||||||
{ "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
|
{ "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
|
||||||
{ "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
|
{ "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
|
||||||
{ "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
|
{ "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
|
||||||
@ -377,6 +378,7 @@ void LyXRC::setDefaults()
|
|||||||
default_length_unit = Length::CM;
|
default_length_unit = Length::CM;
|
||||||
cursor_width = 1;
|
cursor_width = 1;
|
||||||
close_buffer_with_last_view = "yes";
|
close_buffer_with_last_view = "yes";
|
||||||
|
mouse_middlebutton_paste = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1292,6 +1294,10 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case RC_MOUSE_MIDDLEBUTTON_PASTE:
|
||||||
|
lexrc >> mouse_middlebutton_paste;
|
||||||
|
break;
|
||||||
|
|
||||||
case RC_LAST:
|
case RC_LAST:
|
||||||
break; // this is just a dummy
|
break; // this is just a dummy
|
||||||
}
|
}
|
||||||
@ -2243,6 +2249,14 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
|
|||||||
}
|
}
|
||||||
if (tag != RC_LAST)
|
if (tag != RC_LAST)
|
||||||
break;
|
break;
|
||||||
|
case RC_MOUSE_MIDDLEBUTTON_PASTE:
|
||||||
|
if (ignore_system_lyxrc ||
|
||||||
|
mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
|
||||||
|
os << "\\mouse_middlebutton_paste "
|
||||||
|
<< convert<string>(mouse_middlebutton_paste) << '\n';
|
||||||
|
}
|
||||||
|
if (tag != RC_LAST)
|
||||||
|
break;
|
||||||
case RC_COMPLETION_INLINE_DELAY:
|
case RC_COMPLETION_INLINE_DELAY:
|
||||||
if (ignore_system_lyxrc ||
|
if (ignore_system_lyxrc ||
|
||||||
completion_inline_delay != system_lyxrc.completion_inline_delay) {
|
completion_inline_delay != system_lyxrc.completion_inline_delay) {
|
||||||
@ -2974,6 +2988,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
|
|||||||
case LyXRC::RC_MAKE_BACKUP:
|
case LyXRC::RC_MAKE_BACKUP:
|
||||||
case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
|
case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
|
||||||
case LyXRC::RC_MOUSE_WHEEL_SPEED:
|
case LyXRC::RC_MOUSE_WHEEL_SPEED:
|
||||||
|
case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
|
||||||
case LyXRC::RC_NUMLASTFILES:
|
case LyXRC::RC_NUMLASTFILES:
|
||||||
case LyXRC::RC_PARAGRAPH_MARKERS:
|
case LyXRC::RC_PARAGRAPH_MARKERS:
|
||||||
case LyXRC::RC_PATH_PREFIX:
|
case LyXRC::RC_PATH_PREFIX:
|
||||||
|
@ -119,6 +119,7 @@ public:
|
|||||||
RC_MAKE_BACKUP,
|
RC_MAKE_BACKUP,
|
||||||
RC_MARK_FOREIGN_LANGUAGE,
|
RC_MARK_FOREIGN_LANGUAGE,
|
||||||
RC_MOUSE_WHEEL_SPEED,
|
RC_MOUSE_WHEEL_SPEED,
|
||||||
|
RC_MOUSE_MIDDLEBUTTON_PASTE,
|
||||||
RC_NOMENCL_COMMAND,
|
RC_NOMENCL_COMMAND,
|
||||||
RC_NUMLASTFILES,
|
RC_NUMLASTFILES,
|
||||||
RC_OPEN_BUFFERS_IN_TABS,
|
RC_OPEN_BUFFERS_IN_TABS,
|
||||||
@ -305,6 +306,8 @@ public:
|
|||||||
std::string hunspelldir_path;
|
std::string hunspelldir_path;
|
||||||
///
|
///
|
||||||
bool auto_region_delete;
|
bool auto_region_delete;
|
||||||
|
/// enable middle-mouse-button paste
|
||||||
|
bool mouse_middlebutton_paste;
|
||||||
/// flag telling whether lastfiles should be checked for existance
|
/// flag telling whether lastfiles should be checked for existance
|
||||||
bool auto_reset_options;
|
bool auto_reset_options;
|
||||||
///
|
///
|
||||||
|
@ -1549,11 +1549,13 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case mouse_button::button2:
|
case mouse_button::button2:
|
||||||
// Middle mouse pasting.
|
if (lyxrc.mouse_middlebutton_paste) {
|
||||||
bv->mouseSetCursor(cur);
|
// Middle mouse pasting.
|
||||||
lyx::dispatch(
|
bv->mouseSetCursor(cur);
|
||||||
FuncRequest(LFUN_COMMAND_ALTERNATIVES,
|
lyx::dispatch(
|
||||||
"selection-paste ; primary-selection-paste paragraph"));
|
FuncRequest(LFUN_COMMAND_ALTERNATIVES,
|
||||||
|
"selection-paste ; primary-selection-paste paragraph"));
|
||||||
|
}
|
||||||
cur.noScreenUpdate();
|
cur.noScreenUpdate();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -497,6 +497,8 @@ PrefInput::PrefInput(GuiPreferences * form)
|
|||||||
this, SIGNAL(changed()));
|
this, SIGNAL(changed()));
|
||||||
connect(dontswapCB, SIGNAL(toggled(bool)),
|
connect(dontswapCB, SIGNAL(toggled(bool)),
|
||||||
this, SIGNAL(changed()));
|
this, SIGNAL(changed()));
|
||||||
|
connect(mmPasteCB, SIGNAL(toggled(bool)),
|
||||||
|
this, SIGNAL(changed()));
|
||||||
|
|
||||||
// reveal checkbox for switching Ctrl and Meta on Mac:
|
// reveal checkbox for switching Ctrl and Meta on Mac:
|
||||||
bool swapcb = false;
|
bool swapcb = false;
|
||||||
@ -532,6 +534,7 @@ void PrefInput::applyRC(LyXRC & rc) const
|
|||||||
rc.scroll_wheel_zoom = LyXRC::SCROLL_WHEEL_ZOOM_OFF;
|
rc.scroll_wheel_zoom = LyXRC::SCROLL_WHEEL_ZOOM_OFF;
|
||||||
}
|
}
|
||||||
rc.mac_dontswap_ctrl_meta = dontswapCB->isChecked();
|
rc.mac_dontswap_ctrl_meta = dontswapCB->isChecked();
|
||||||
|
rc.mouse_middlebutton_paste = mmPasteCB->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -560,6 +563,7 @@ void PrefInput::updateRC(LyXRC const & rc)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dontswapCB->setChecked(rc.mac_dontswap_ctrl_meta);
|
dontswapCB->setChecked(rc.mac_dontswap_ctrl_meta);
|
||||||
|
mmPasteCB->setChecked(rc.mouse_middlebutton_paste);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>350</width>
|
<width>350</width>
|
||||||
<height>303</height>
|
<height>316</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -142,8 +142,21 @@
|
|||||||
<property name="flat">
|
<property name="flat">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item>
|
<item row="0" column="3">
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="scrollingSpeedLA">
|
<widget class="QLabel" name="scrollingSpeedLA">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Wheel scrolling speed:</string>
|
<string>&Wheel scrolling speed:</string>
|
||||||
@ -153,7 +166,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="0" column="2">
|
||||||
<widget class="QDoubleSpinBox" name="mouseWheelSpeedSB">
|
<widget class="QDoubleSpinBox" name="mouseWheelSpeedSB">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>1.0 is the standard scrolling speed with the mouse wheel. Higher values will speed it up, low values slow it down.</string>
|
<string>1.0 is the standard scrolling speed with the mouse wheel. Higher values will speed it up, low values slow it down.</string>
|
||||||
@ -175,18 +188,15 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="1">
|
||||||
<spacer>
|
<widget class="QCheckBox" name="mmPasteCB">
|
||||||
<property name="orientation">
|
<property name="toolTip">
|
||||||
<enum>Qt::Horizontal</enum>
|
<string>If this is checked, the middle mouse button will paste the recent selection</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="text">
|
||||||
<size>
|
<string>&Middle mouse button pasting</string>
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@ -214,7 +224,7 @@
|
|||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>30</y>
|
<y>30</y>
|
||||||
<width>304</width>
|
<width>304</width>
|
||||||
<height>27</height>
|
<height>29</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
@ -1551,7 +1551,7 @@ void InsetMathNest::lfunMousePress(Cursor & cur, FuncRequest & cmd)
|
|||||||
// cur.result().update(): don't overwrite previously set flags.
|
// cur.result().update(): don't overwrite previously set flags.
|
||||||
cur.screenUpdateFlags(Update::Decoration | Update::FitCursor
|
cur.screenUpdateFlags(Update::Decoration | Update::FitCursor
|
||||||
| cur.result().screenUpdate());
|
| cur.result().screenUpdate());
|
||||||
} else if (cmd.button() == mouse_button::button2) {
|
} else if (cmd.button() == mouse_button::button2 && lyxrc.mouse_middlebutton_paste) {
|
||||||
if (cap::selection()) {
|
if (cap::selection()) {
|
||||||
// See comment in Text::dispatch why we do this
|
// See comment in Text::dispatch why we do this
|
||||||
cap::copySelectionToStack();
|
cap::copySelectionToStack();
|
||||||
|
Loading…
Reference in New Issue
Block a user