X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXRC.cpp;h=252bbfb36d4c3c28c8a1a3feaa9f3355dfa2d296;hb=1712e4f35e3e8cb132f731dca773f7767a241bf6;hp=4de11cc08fee1c055e03965561df332476115416;hpb=e2e63b4b1b06e1950c1c8437637fba5f1cf92814;p=lyx.git diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index 4de11cc08f..252bbfb36d 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -173,6 +173,7 @@ LexerKeyword lyxrcTags[] = { { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY }, { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM }, { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT }, + { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM }, { "\\serverpipe", LyXRC::RC_SERVERPIPE }, { "\\set_color", LyXRC::RC_SET_COLOR }, { "\\show_banner", LyXRC::RC_SHOW_BANNER }, @@ -198,6 +199,7 @@ LexerKeyword lyxrcTags[] = { { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE }, // compatibility with versions older than 1.4.0 only { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB }, + { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS }, // compatibility with versions older than 1.4.0 only { "\\use_tempdir", LyXRC::RC_USETEMPDIR }, { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP }, @@ -320,6 +322,7 @@ void LyXRC::setDefaults() date_insert_format = "%x"; cursor_follows_scrollbar = false; scroll_below_document = false; + scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL; paragraph_markers = false; mac_like_word_movement = false; macro_edit_style = MACRO_EDIT_INLINE_BOX; @@ -328,6 +331,7 @@ void LyXRC::setDefaults() preview_hashed_labels = false; preview_scale_factor = 1.0; use_converter_cache = true; + use_system_colors = false; use_tooltip = true; use_pixmap_cache = false; converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months @@ -912,6 +916,9 @@ int LyXRC::read(Lexer & lexrc) case RC_ACCEPT_COMPOUND: lexrc >> spellchecker_accept_compound; break; + case RC_USE_SYSTEM_COLORS: + lexrc >> use_system_colors; + break; case RC_USE_TOOLTIP: lexrc >> use_tooltip; break; @@ -1195,6 +1202,23 @@ int LyXRC::read(Lexer & lexrc) } } break; + case RC_SCROLL_WHEEL_ZOOM: + if (lexrc.next()) { + string const tmp = lexrc.getString(); + if (tmp == "ctrl") + scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL; + else if (tmp == "shift") + scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT; + else if (tmp == "alt") + scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT; + else { + scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF; + if (tmp != "off" && tmp != "false") + LYXERR0("Unrecognized scroll_wheel_zoom status \"" + << tmp << '"'); + } + } + break; // Obsoteted in 1.4.0 case RC_USETEMPDIR: @@ -2363,6 +2387,15 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c // obsoleted in 2.0 if (tag != RC_LAST) break; + case RC_USE_SYSTEM_COLORS: + if (ignore_system_lyxrc || + use_system_colors != system_lyxrc.use_system_colors) { + os << "\\use_system_colors " + << convert(use_system_colors) + << '\n'; + } + if (tag != RC_LAST) + break; case RC_USE_TOOLTIP: if (ignore_system_lyxrc || use_tooltip != system_lyxrc.use_tooltip) { @@ -2571,6 +2604,29 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c if (tag != RC_LAST) break; + case RC_SCROLL_WHEEL_ZOOM: + if (ignore_system_lyxrc || + scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) { + string status; + switch (scroll_wheel_zoom) { + case SCROLL_WHEEL_ZOOM_OFF: + status = "off"; + break; + case SCROLL_WHEEL_ZOOM_CTRL: + status = "ctrl"; + break; + case SCROLL_WHEEL_ZOOM_SHIFT: + status = "shift"; + break; + case SCROLL_WHEEL_ZOOM_ALT: + status = "alt"; + break; + } + os << "\\scroll_wheel_zoom " << status << '\n'; + } + if (tag != RC_LAST) + break; + os << "\n#\n" << "# FORMATS SECTION ##########################\n" << "#\n\n"; @@ -2890,6 +2946,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new) case LyXRC::RC_USE_ESC_CHARS: case LyXRC::RC_USE_INP_ENC: case LyXRC::RC_USE_PERS_DICT: + case LyXRC::RC_USE_SYSTEM_COLORS: case LyXRC::RC_USE_TOOLTIP: case LyXRC::RC_USE_PIXMAP_CACHE: case LyXRC::RC_USE_SPELL_LIB: @@ -2909,6 +2966,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new) case LyXRC::RC_FORWARD_SEARCH_PDF: case LyXRC::RC_EXPORT_OVERWRITE: case LyXRC::RC_DEFAULT_DECIMAL_POINT: + case LyXRC::RC_SCROLL_WHEEL_ZOOM: case LyXRC::RC_LAST: break; } @@ -3339,6 +3397,10 @@ string const LyXRC::getDescription(LyXRCTags tag) case RC_USETEMPDIR: break; + case RC_USE_USE_SYSTEM_COLORS: + str = _("Enable use the system colors for some things like main window background and selection."); + break; + case RC_USE_TOOLTIP: str = _("Enable the automatic appearance of tool tips in the work area."); break;