comparison src/gui.c @ 18679:fd95d4dbeb37 v8.1.2331

patch 8.1.2331: the option.c file is still very big Commit: https://github.com/vim/vim/commit/7bae0b1bc84a95d565ffab38cf7f82ad21c656b6 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 21 22:14:18 2019 +0100 patch 8.1.2331: the option.c file is still very big Problem: The option.c file is still very big. Solution: Move a few functions to where they fit better. (Yegappan Lakshmanan, closes #4895)
author Bram Moolenaar <Bram@vim.org>
date Thu, 21 Nov 2019 22:15:03 +0100
parents df141c730008
children 49b78d6465e5
comparison
equal deleted inserted replaced
18678:cb4a4b71df4a 18679:fd95d4dbeb37
4740 return (int)( (((rgb >> 16) & 0xff) * 299) 4740 return (int)( (((rgb >> 16) & 0xff) * 299)
4741 + (((rgb >> 8) & 0xff) * 587) 4741 + (((rgb >> 8) & 0xff) * 587)
4742 + ((rgb & 0xff) * 114)) / 1000; 4742 + ((rgb & 0xff) * 114)) / 1000;
4743 } 4743 }
4744 4744
4745 char_u *
4746 gui_bg_default(void)
4747 {
4748 if (gui_get_lightness(gui.back_pixel) < 127)
4749 return (char_u *)"dark";
4750 return (char_u *)"light";
4751 }
4752
4753 /*
4754 * Option initializations that can only be done after opening the GUI window.
4755 */
4756 void
4757 init_gui_options(void)
4758 {
4759 /* Set the 'background' option according to the lightness of the
4760 * background color, unless the user has set it already. */
4761 if (!option_was_set((char_u *)"bg") && STRCMP(p_bg, gui_bg_default()) != 0)
4762 {
4763 set_option_value((char_u *)"bg", 0L, gui_bg_default(), 0);
4764 highlight_changed();
4765 }
4766 }
4767
4745 #if defined(FEAT_GUI_X11) || defined(PROTO) 4768 #if defined(FEAT_GUI_X11) || defined(PROTO)
4746 void 4769 void
4747 gui_new_scrollbar_colors(void) 4770 gui_new_scrollbar_colors(void)
4748 { 4771 {
4749 win_T *wp; 4772 win_T *wp;