From: Edwin Leuven Date: Mon, 29 Oct 2007 08:56:30 +0000 (+0000) Subject: - add label and remove subclassed SearchLineEdit X-Git-Tag: 1.6.10~7624 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=608236c0db2d4be30157eff907d29f86463a123b;p=features.git - add label and remove subclassed SearchLineEdit - put ShortcutLineEdit in namespace lyx::frontend - additional dialog layout tweaks git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21254 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/CustomizedWidgets.cpp b/src/frontends/qt4/CustomizedWidgets.cpp index a653fdf0b6..32c09f7793 100644 --- a/src/frontends/qt4/CustomizedWidgets.cpp +++ b/src/frontends/qt4/CustomizedWidgets.cpp @@ -36,6 +36,9 @@ using lyx::KeySequence; using lyx::KeyModifier; using lyx::toqstr; +namespace lyx { +namespace frontend { + ShortcutLineEdit::ShortcutLineEdit(QWidget * parent) : QLineEdit(parent), keysequence_() { @@ -128,25 +131,7 @@ void ShortcutLineEdit::appendToSequence(QKeyEvent * e) keysequence_.addkey(sym, mod, lyx::NoModifier); } - -QString const SearchLineEdit::hintMessage() const -{ - return toqstr("Search ..."); -} - - -void SearchLineEdit::focusInEvent(QFocusEvent * e) -{ - if (text() == hintMessage()) - clear(); -} - - -void SearchLineEdit::focusOutEvent(QFocusEvent * e) -{ - if (text().isEmpty()) - setText(hintMessage()); -} - +} // namespace frontend +} // namespace lyx #include "CustomizedWidgets_moc.cpp" diff --git a/src/frontends/qt4/CustomizedWidgets.h b/src/frontends/qt4/CustomizedWidgets.h index 495f56a3d1..6b3226c3e4 100644 --- a/src/frontends/qt4/CustomizedWidgets.h +++ b/src/frontends/qt4/CustomizedWidgets.h @@ -19,6 +19,9 @@ class QEvent; class QKeyEvent; +namespace lyx { +namespace frontend { + /** * A lineedit for inputting shortcuts */ @@ -38,20 +41,7 @@ private: bool has_cursor_; }; - -/** - * A lineedit that displays a hint message when there is no - * text and not under focus. - */ -class SearchLineEdit : public QLineEdit { - Q_OBJECT -public: - QString const hintMessage() const; - SearchLineEdit(QWidget * parent) : QLineEdit(parent) {} -protected Q_SLOTS: - void focusInEvent(QFocusEvent * e); - void focusOutEvent(QFocusEvent * e); -}; - +} // namespace frontend +} // namespace lyx #endif // CUSTOMIZEDWIDGETS_H diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 40d7a7785a..9fd303de60 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -2021,10 +2021,8 @@ void PrefShortcuts::on_removePB_pressed() } -void PrefShortcuts::on_searchLE_textChanged() +void PrefShortcuts::on_searchLE_textEdited() { - if (searchLE->text() == searchLE->hintMessage()) - return; if (searchLE->text().isEmpty()) { // show all hidden items QTreeWidgetItemIterator it(shortcutsTW, QTreeWidgetItemIterator::Hidden); diff --git a/src/frontends/qt4/GuiPrefs.h b/src/frontends/qt4/GuiPrefs.h index 9a8520e447..0eff31969a 100644 --- a/src/frontends/qt4/GuiPrefs.h +++ b/src/frontends/qt4/GuiPrefs.h @@ -382,7 +382,7 @@ public Q_SLOTS: void select_bind(); void on_newPB_pressed(); void on_removePB_pressed(); - void on_searchLE_textChanged(); + void on_searchLE_textEdited(); /// void on_shortcutsTW_itemSelectionChanged(); void shortcut_okPB_pressed(); diff --git a/src/frontends/qt4/ui/PrefShortcutsUi.ui b/src/frontends/qt4/ui/PrefShortcutsUi.ui index 9854b41539..44ad762ac9 100644 --- a/src/frontends/qt4/ui/PrefShortcutsUi.ui +++ b/src/frontends/qt4/ui/PrefShortcutsUi.ui @@ -1,4 +1,7 @@ + + + PrefShortcuts @@ -6,7 +9,7 @@ 0 0 409 - 418 + 494 @@ -27,57 +30,78 @@ 6 - - - - Qt::Vertical - - - QSizePolicy::Expanding + + + + 0 - - - 51 - 83 - + + 6 - + + + + Show commands containing: + + + searchLE + + + + + + + - - - - Qt::Vertical + + + + <- Clea&r - - QSizePolicy::Expanding + + + + + + 0 - - - 51 - 83 - + + 6 - - - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Remove + + + + + + + New + + + + - + - - - - Remove - - - - - - - New - - + + @@ -96,44 +120,37 @@ - - - - Shortcuts: - - - - - - - - 1 - 0 - 0 - 0 - - - - Search ... - - - - - - SearchLineEdit - QLineEdit -
CustomizedWidgets.h
-
-
+ bindFileED bindFilePB + searchLE + shortcutsTW + removePB + newPB qt_helpers.h - + + + pushButton + clicked() + searchLE + clear() + + + 349 + 52 + + + 265 + 52 + + + +
diff --git a/src/frontends/qt4/ui/ShortcutUi.ui b/src/frontends/qt4/ui/ShortcutUi.ui index f3571f5f63..9b9eb9d59e 100644 --- a/src/frontends/qt4/ui/ShortcutUi.ui +++ b/src/frontends/qt4/ui/ShortcutUi.ui @@ -1,22 +1,17 @@ + + + shortcutUi 0 0 - 277 - 147 + 348 + 106 - - - 1 - 1 - 0 - 0 - - Edit shortcut @@ -30,16 +25,21 @@ 6 + + + + true + + + Enter BibTeX database name + + + + + + - - - 7 - 0 - 0 - 0 - - Enter BibTeX database name @@ -55,17 +55,17 @@ - - + + - Shortcut + Function: - - + + - Function: + Shortcut @@ -118,34 +118,16 @@ - - - - true - - - - 13 - 13 - 0 - 0 - - - - Enter BibTeX database name - - - - - - + - ShortcutLineEdit + lyx::frontend::ShortcutLineEdit QLineEdit
CustomizedWidgets.h
+ 0 +