1- *gui_x11.txt* For Vim version 8.0. Last change: 2016 Sep 12
1+ *gui_x11.txt* For Vim version 8.0. Last change: 2017 Jun 27
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -288,8 +288,9 @@ For CDE "dtwm" (a derivative of Motif) add this line in the .Xdefaults: >
288288 For "mwm" (Motif window manager) the line would be: >
289289 Mwm*Vim*iconImage: /usr/local/share/vim/vim32x32.xpm
290290
291- Mouse Pointers Available in X11 *X11_mouse_shapes*
292291
292+ Mouse Pointers Available in X11 ~
293+ *X11_mouse_shapes*
293294By using the | 'mouseshape' | option, the mouse pointer can be automatically
294295changed whenever Vim enters one of its various modes (e.g., Insert or
295296Command). Currently, the available pointers are:
@@ -363,7 +364,9 @@ to the GTK documentation, however little there is, on how to do this.
363364See http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html
364365for more information.
365366
366- *gtk-tooltip-colors*
367+
368+ Tooltip Colors ~
369+ *gtk-tooltip-colors*
367370Example, which sets the tooltip colors to black on light-yellow: >
368371
369372 style "tooltips"
@@ -381,15 +384,122 @@ distribution.
381384For GTK+ 3, an effect similar to the above can be obtained by adding the
382385following snippet of CSS code to $XDG_HOME_DIR/gtk-3.0/gtk.css (usually,
383386$HOME/.config/gtk-3.0/gtk.css):
384- >
387+
388+ For GTK+ 3 < 3.20: >
389+
385390 .tooltip {
386391 background-color: #ffffcc;
387392 color: #000000;
388393 }
389394<
395+ For GTK+ 3 >= 3.20: >
396+
397+ tooltip {
398+ background-color: #ffffcc;
399+ text-shadow: none;
400+ }
401+
402+ tooltip label {
403+ color: #2e3436;
404+ }
405+ <
406+
407+ A Quick Look at GTK+ CSS ~
408+ *gtk-css*
409+ The contents of this subsection apply to GTK+ 3.20 or later which provides
410+ stable support for GTK+ CSS:
411+
412+ https://developer.gnome.org/gtk3/stable/theming.html
390413
391- Using Vim as a GTK+ plugin *gui-gtk-socketid*
414+ GTK+ uses CSS for styling and layout of widgets. In this subsection, we'll
415+ have a quick look at GTK+ CSS through simple, illustrative examples.
392416
417+ Example 1. Empty Space Adjustment ~
418+
419+ By default, the toolbar and the tabline of the GTK+ 3 GUI are somewhat larger
420+ than those of the GTK+ 2 GUI. Some people may want to make them look similar
421+ to the GTK+ 2 GUI in size.
422+
423+ To do that, we'll try reducing empty space around icons and labels that looks
424+ apparently superfluous.
425+
426+ Add the following lines to $XDG_HOME_DIR/gtk-3.0/gtk.css (usually,
427+ $HOME/.config/gtk-3.0/gtk.css): >
428+
429+ toolbar button {
430+ margin-top: -2px;
431+ margin-right: 0px;
432+ margin-bottom: -2px;
433+ margin-left: 0px;
434+
435+ padding-top: 0px;
436+ padding-right: 0px;
437+ padding-bottom: 0px;
438+ padding-left: 0px
439+ }
440+
441+ notebook tab {
442+ margin-top: -1px;
443+ margin-right: 3px;
444+ margin-bottom: -1px;
445+ margin-left: 3px;
446+
447+ padding-top: 0px;
448+ padding-right: 0px;
449+ padding-bottom: 0px;
450+ padding-left: 0px
451+ }
452+ <
453+ Since it's a CSS, they can be rewritten using shorthand: >
454+
455+ toolbar button {
456+ margin: -2px 0px;
457+ padding: 0px;
458+ }
459+
460+ notebook tab {
461+ margin: -1px 3px;
462+ padding: 0px
463+ }
464+ <
465+ Note: You might want to use 'toolbariconsize' to adjust the icon size, too.
466+
467+ Note: Depending on the icon theme and/or the font in use, some extra tweaks
468+ may be needed for a satisfactory result.
469+
470+ Note: In addition to margin and padding, you can use border. For details,
471+ refer to the box model of CSS, e.g.,
472+
473+ https://www.w3schools.com/css/css_boxmodel.asp
474+
475+ Example 2. More Than Just Colors ~
476+
477+ GTK+ CSS supports gradients as well: >
478+
479+ tooltip {
480+ background-image: -gtk-gradient(linear,
481+ 0 0, 0 1,
482+ color-stop(0, #344752),
483+ color-stop(0.5, #546772),
484+ color-stop(1, #243742));
485+ }
486+
487+ tooltip label {
488+ color: #f3f3f3;
489+ }
490+ <
491+ Gradients can be used to make a GUI element visually distinguishable from
492+ others without relying on high contrast. Accordingly, effective use of them is
493+ a useful technique to give a theme a sense of unity in color and luminance.
494+
495+ Note: Theming can be difficult since it must make every application look
496+ equally good; making a single application more charming often gets others
497+ unexpectedly less attractive or even deteriorates their usability. Keep this
498+ in mind always when you try improving a theme.
499+
500+
501+ Using Vim as a GTK+ plugin ~
502+ *gui-gtk-socketid*
393503When the GTK+ version of Vim starts up normally, it creates its own top level
394504window (technically, a 'GtkWindow'). GTK+ provides an embedding facility with
395505its GtkSocket and GtkPlug widgets. If one GTK+ application creates a
@@ -434,8 +544,8 @@ Note: Avoid use of --enable-gnome-check with GTK+ 3 GUI build. The
434544functionality mentioned above is consolidated in GTK+ 3.
435545
436546
437- GNOME session support *gui-gnome-session* *gnome-session*
438-
547+ GNOME session support ~
548+ *gui-gnome-session* *gnome-session*
439549On logout, Vim shows the well-known exit confirmation dialog if any buffers
440550are modified. Clicking [Cancel] will stop the logout process. Otherwise the
441551current session is stored to disk by using the | :mksession | command, and
0 commit comments