diff src/gui.c @ 18078:5ae41d0ea397 v8.1.2034

patch 8.1.2034: dark them of GTK 3 not supported Commit: https://github.com/vim/vim/commit/50bf7ce0c9f8c3ede2d1a02c734beba9d5a0504e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 15 13:17:00 2019 +0200 patch 8.1.2034: dark them of GTK 3 not supported Problem: Dark them of GTK 3 not supported. Solution: Add the "d" flag in 'guioptions'. (Jonathan Conder, closes https://github.com/vim/vim/issues/4934)
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Sep 2019 13:30:04 +0200
parents 59f8948b7590
children 34d5cd432cac
line wrap: on
line diff
--- a/src/gui.c
+++ b/src/gui.c
@@ -3425,6 +3425,10 @@ static int	prev_which_scrollbars[3];
     void
 gui_init_which_components(char_u *oldval UNUSED)
 {
+#ifdef FEAT_GUI_DARKTHEME
+    static int	prev_dark_theme = -1;
+    int		using_dark_theme = FALSE;
+#endif
 #ifdef FEAT_MENU
     static int	prev_menu_is_active = -1;
 #endif
@@ -3495,6 +3499,11 @@ gui_init_which_components(char_u *oldval
 	    case GO_BOT:
 		gui.which_scrollbars[SBAR_BOTTOM] = TRUE;
 		break;
+#ifdef FEAT_GUI_DARKTHEME
+	    case GO_DARKTHEME:
+		using_dark_theme = TRUE;
+		break;
+#endif
 #ifdef FEAT_MENU
 	    case GO_MENUS:
 		gui.menu_is_active = TRUE;
@@ -3528,6 +3537,14 @@ gui_init_which_components(char_u *oldval
 	need_set_size = 0;
 	fix_size = FALSE;
 
+#ifdef FEAT_GUI_DARKTHEME
+	if (using_dark_theme != prev_dark_theme)
+	{
+	    gui_mch_set_dark_theme(using_dark_theme);
+	    prev_dark_theme = using_dark_theme;
+	}
+#endif
+
 #ifdef FEAT_GUI_TABLINE
 	/* Update the GUI tab line, it may appear or disappear.  This may
 	 * cause the non-GUI tab line to disappear or appear. */