]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiDelimiter.cpp
On Mac, moving down a paragraph should place the cursor at the end of the current...
[lyx.git] / src / frontends / qt4 / GuiDelimiter.cpp
index 2ff733554f871010be3d0c05367621232b28efe3..8303fa64140783ed24b136acbb5b6c544c88feb7 100644 (file)
@@ -41,6 +41,7 @@ namespace {
 static char const *  latex_delimiters[] = {
        "(", ")", "{", "}", "[", "]",
        "lceil", "rceil", "lfloor", "rfloor", "langle", "rangle",
+       "llbracket", "rrbracket",
        "uparrow", "updownarrow", "Uparrow", "Updownarrow", "downarrow", "Downarrow",
        "|", "Vert", "/", "backslash", ""
 };
@@ -114,6 +115,8 @@ void initMathSymbols()
        math_symbols_["rfloor"] = MathSymbol(0x230B, 99, CMSY_FAMILY);
        math_symbols_["langle"] = MathSymbol(0x2329, 104, CMSY_FAMILY);
        math_symbols_["rangle"] = MathSymbol(0x232A, 105, CMSY_FAMILY);
+       math_symbols_["llbracket"] = MathSymbol(0x27e6, 74, STMARY_FAMILY);
+       math_symbols_["rrbracket"] = MathSymbol(0x27e7, 75, STMARY_FAMILY);
        math_symbols_["uparrow"] = MathSymbol(0x2191, 34, CMSY_FAMILY);
        math_symbols_["Uparrow"] = MathSymbol(0x21D1, 42, CMSY_FAMILY);
        math_symbols_["updownarrow"] = MathSymbol(0x2195, 108, CMSY_FAMILY);
@@ -173,6 +176,9 @@ GuiDelimiter::GuiDelimiter(GuiView & lv)
        leftLW->setViewMode(QListView::IconMode);
        rightLW->setViewMode(QListView::IconMode);
 
+       leftLW->setDragDropMode(QAbstractItemView::NoDragDrop);
+       rightLW->setDragDropMode(QAbstractItemView::NoDragDrop);
+
        initMathSymbols();
 
        typedef map<char_type, QListWidgetItem *> ListItems;
@@ -230,6 +236,8 @@ char_type GuiDelimiter::doMatch(char_type const symbol)
        else if (str == "lfloor") match = "rfloor";
        else if (str == "rangle") match = "langle";
        else if (str == "langle") match = "rangle";
+       else if (str == "llbracket") match = "rrbracket";
+       else if (str == "rrbracket") match = "llbracket";
        else if (str == "backslash") match = "/";
        else if (str == "/") match = "backslash";
        else return symbol;
@@ -296,6 +304,9 @@ void GuiDelimiter::on_sizeCO_activated(int index)
 
 void GuiDelimiter::on_leftLW_itemActivated(QListWidgetItem *)
 {
+       // do not auto-apply if !matchCB->isChecked()
+       if (!matchCB->isChecked())
+               return;
        on_insertPB_clicked();
        accept();
 }
@@ -303,6 +314,9 @@ void GuiDelimiter::on_leftLW_itemActivated(QListWidgetItem *)
 
 void GuiDelimiter::on_rightLW_itemActivated(QListWidgetItem *)
 {
+       // do not auto-apply if !matchCB->isChecked()
+       if (!matchCB->isChecked())
+               return;
        on_insertPB_clicked();
        accept();
 }
@@ -341,4 +355,4 @@ Dialog * createGuiDelimiter(GuiView & lv) { return new GuiDelimiter(lv); }
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiDelimiter_moc.cpp"
+#include "moc_GuiDelimiter.cpp"