patch 9.1.1834: MS-Windows: not possible to highlight the title bar
Problem: MS-Windows: not possible to highlight the title bar
Solution: Make the title/caption bar configurable by introducing the
'go-C' option value which allows to highlight it using the
TitleBar and TitleBarNC highlighting groups (Mao-Yining).
Introduce titlebar color customization for Windows 11 GUI through
highlight groups and new 'guioptions' flag:
- Add 'C' flag to enable titlebar color customization (opt-in)
- New highlight groups: TitleBar (active) and TitleBarNC (inactive)
- Uses DWMWA_CAPTION_COLOR and DWMWA_TEXT_COLOR DWM attributes
- Dynamically loads dwmapi.dll for Windows 11 compatibility
- Defaults to system colors when set to NONE or feature disabled
closes: #18449
Signed-off-by: Mao-Yining <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
f8b9251d8f
commit
2c09368273
@ -1,4 +1,4 @@
|
||||
*gui_w32.txt* For Vim version 9.1. Last change: 2025 Aug 06
|
||||
*gui_w32.txt* For Vim version 9.1. Last change: 2025 Oct 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -488,4 +488,20 @@ VIM_KEYCODE_TRANS_STRATEGY can be set to the desired value ("experimental" or
|
||||
set VIM_KEYCODE_TRANS_STRATEGY=experimental
|
||||
gvim.exe
|
||||
<
|
||||
|
||||
Title Bar *gui-w32-title-bar*
|
||||
|
||||
Starting with Windows 11, you can customize the gVim title bar (also known as
|
||||
the caption bar) by enabling the |'go-C'| option.
|
||||
|
||||
Once enabled, the appearance is controlled by two highlighting groups:
|
||||
1. |hl-TitleBar| -- Sets the color of the title bar for the active window.
|
||||
2. |hl-TitleBarNC| -- Sets the color of the title bar for inactive windows.
|
||||
|
||||
To use the system's default title bar colors, set highlighting groups to
|
||||
`NONE`: >
|
||||
|
||||
hi TitleBar guibg=NONE guifg=NONE
|
||||
hi TitleBarNC guibg=NONE guifg=NONE
|
||||
|
||||
vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 9.1. Last change: 2025 Oct 03
|
||||
*options.txt* For Vim version 9.1. Last change: 2025 Oct 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -4487,6 +4487,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'go-c'*
|
||||
'c' Use console dialogs instead of popup dialogs for simple
|
||||
choices.
|
||||
*'go-C'*
|
||||
'C' Use |hl-TitleBar| and |hl-TitleBarNC| if available.
|
||||
Currently only works for MS-Window GUI.
|
||||
See |gui-w32-title-bar| for details.
|
||||
*'go-d'*
|
||||
'd' Use dark theme variant if available. Currently only works for
|
||||
GTK+ GUI.
|
||||
|
||||
@ -6092,6 +6092,16 @@ TabPanelSel TabPanel, active tab page label.
|
||||
Terminal |terminal| window (see |terminal-size-color|).
|
||||
*hl-Title*
|
||||
Title Titles for output from ":set all", ":autocmd" etc.
|
||||
*hl-TitleBar*
|
||||
TitleBar Title bar for the active Gui's window.
|
||||
This feature is supported only in the MS-Windows GUI.
|
||||
See |gui-w32-title-bar| for details
|
||||
Only the `guibg` and `guifg` highlight arguments are effective.
|
||||
*hl-TitleBarNC*
|
||||
TitleBarNC Title bar for inactive Gui's window.
|
||||
This feature is supported only in the MS-Windows GUI.
|
||||
See |gui-w32-title-bar| for details
|
||||
Only the `guibg` and `guifg` highlight arguments are effective.
|
||||
*hl-Visual*
|
||||
Visual Visual mode selection.
|
||||
*hl-VisualNOS*
|
||||
|
||||
@ -355,6 +355,7 @@ $quote eval.txt /*$quote*
|
||||
'go' options.txt /*'go'*
|
||||
'go-!' options.txt /*'go-!'*
|
||||
'go-A' options.txt /*'go-A'*
|
||||
'go-C' options.txt /*'go-C'*
|
||||
'go-F' options.txt /*'go-F'*
|
||||
'go-L' options.txt /*'go-L'*
|
||||
'go-M' options.txt /*'go-M'*
|
||||
@ -8224,6 +8225,7 @@ gui-w32-cmdargs gui_w32.txt /*gui-w32-cmdargs*
|
||||
gui-w32-dialogs gui_w32.txt /*gui-w32-dialogs*
|
||||
gui-w32-printing gui_w32.txt /*gui-w32-printing*
|
||||
gui-w32-start gui_w32.txt /*gui-w32-start*
|
||||
gui-w32-title-bar gui_w32.txt /*gui-w32-title-bar*
|
||||
gui-w32-various gui_w32.txt /*gui-w32-various*
|
||||
gui-w32-windowid gui_w32.txt /*gui-w32-windowid*
|
||||
gui-w32s os_win32.txt /*gui-w32s*
|
||||
@ -8417,6 +8419,8 @@ hl-TabPanelFill syntax.txt /*hl-TabPanelFill*
|
||||
hl-TabPanelSel syntax.txt /*hl-TabPanelSel*
|
||||
hl-Terminal syntax.txt /*hl-Terminal*
|
||||
hl-Title syntax.txt /*hl-Title*
|
||||
hl-TitleBar syntax.txt /*hl-TitleBar*
|
||||
hl-TitleBarNC syntax.txt /*hl-TitleBarNC*
|
||||
hl-ToolbarButton gui.txt /*hl-ToolbarButton*
|
||||
hl-ToolbarLine gui.txt /*hl-ToolbarLine*
|
||||
hl-Tooltip syntax.txt /*hl-Tooltip*
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
*version9.txt* For Vim version 9.1. Last change: 2025 Oct 05
|
||||
*version9.txt* For Vim version 9.1. Last change: 2025 Oct 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -41715,6 +41715,8 @@ Options: ~
|
||||
- Setting 'nowrap' in a modeline could cause long lines to be hidden
|
||||
off-screen. To make this visible, the listchars "extend" suboption is set
|
||||
to ">" by default, indicating text that extends beyond the window width.
|
||||
- 'guioptions': New value |'go-C'| to style the title/caption bar on Windows 11
|
||||
(see also the below platform specific change).
|
||||
|
||||
Ex commands: ~
|
||||
- allow to specify a priority when defining a new sign |:sign-define|
|
||||
@ -41750,6 +41752,8 @@ Plugins~
|
||||
Platform specific ~
|
||||
- MS-Winodws: Paths like "\Windows" and "/Windows" are now considered to be
|
||||
absolute paths (to the current drive) and no longer relative.
|
||||
- MS-Windows: The title bar follows the |hl-TitleBar| and |hl-TitleBarNC|
|
||||
highlighting group |gui-w32-title-bar|.
|
||||
- macOS: increase default scheduler priority to TASK_DEFAULT_APPLICATION.
|
||||
|
||||
Others: ~
|
||||
@ -41841,6 +41845,8 @@ Highlighting: ~
|
||||
|hl-TabPanel| |tabpanel|: not active tab page label
|
||||
|hl-TabPanelFill| |tabpanel|: filler space
|
||||
|hl-TabPanelSel| |tabpanel|: active tab page label
|
||||
|hl-TitleBarNC| Configure the inactive title/bar on MS-Windows 11
|
||||
|hl-TitleBar| Configure the active title/bar on MS-Windows 11
|
||||
|
||||
Commands: ~
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
" Language: Vim script
|
||||
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
|
||||
" Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2025 Sep 27
|
||||
" Last Change: 2025 Oct 07
|
||||
" Former Maintainer: Charles E. Campbell
|
||||
|
||||
" DO NOT CHANGE DIRECTLY.
|
||||
@ -34,8 +34,8 @@ syn cluster vimCommentGroup contains=vimTodo,@Spell
|
||||
|
||||
" regular vim commands {{{2
|
||||
" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang'
|
||||
syn keyword vimCommand contained al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bf[irst] bl[ast] bm[odified] bn[ext] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] changes che[ckpath] checkt[ime] chi[story] cl[ist] clip[reset] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] col[der] colo[rscheme] com[mand] comc[lear] comp[iler] con[tinue] conf[irm] cons[t] cope[n] cp[revious] cpf[ile] nextgroup=vimBang
|
||||
syn keyword vimCommand contained cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] delm[arks] deb[ug] defc[ompile] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] em[enu] endfo[r] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpt[ags] ha[rdcopy] hi[ghlight] his[tory] ij[ump] il[ist] int[ro] ip[ut] is[earch] isp[lit] ju[mps] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] nextgroup=vimBang
|
||||
syn keyword vimCommand contained al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bf[irst] bl[ast] bm[odified] bn[ext] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] changes che[ckpath] checkt[ime] chi[story] cl[ist] clip[reset] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] col[der] colo[rscheme] comc[lear] comp[iler] con[tinue] conf[irm] cons[t] cope[n] cp[revious] cpf[ile] cq[uit] nextgroup=vimBang
|
||||
syn keyword vimCommand contained cr[ewind] cs[cope] cst[ag] cw[indow] delm[arks] deb[ug] defc[ompile] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] em[enu] endfo[r] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpt[ags] ha[rdcopy] hi[ghlight] his[tory] ij[ump] il[ist] int[ro] ip[ut] is[earch] isp[lit] ju[mps] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] nextgroup=vimBang
|
||||
syn keyword vimCommand contained lcl[ose] lcs[cope] ld[o] le[ft] lex[pr] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lw[indow] ls m[ove] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] n[ext] nb[key] nbc[lose] nbs[tart] noh[lsearch] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] q[uit] quita[ll] qa[ll] r[ead] rec[over] nextgroup=vimBang
|
||||
syn keyword vimCommand contained red[o] redr[aw] redraws[tatus] redrawt[abline] redrawtabp[anel] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sla[st] sn[ext] so[urce] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tabc[lose] tabd[o] tabe[dit] nextgroup=vimBang
|
||||
syn keyword vimCommand contained tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] te[aroff] tf[irst] tj[ump] tl[ast] tn[ext] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] up[date] v[global] ve[rsion] vi[sual] vie[w] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] wind[o] winp[os] wl[restore] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=vimBang
|
||||
@ -146,8 +146,8 @@ syn keyword vimGroup contained Added Bold BoldItalic Boolean Changed Character C
|
||||
|
||||
" Default highlighting groups {{{2
|
||||
" GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR=''
|
||||
syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill TabPanel TabPanelSel TabPanelFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification PreInsert Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar
|
||||
syn keyword vimHLGroup contained CursorIM ComplMatchIns LineNrAbove LineNrBelow MsgArea Terminal User1 User2 User3 User4 User5 User6 User7 User8 User9
|
||||
syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill TabPanel TabPanelSel TabPanelFill Cursor lCursor TitleBar TitleBarNC QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification PreInsert Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton
|
||||
syn keyword vimHLGroup contained TitleBar TitleBarNC Menu Tooltip Scrollbar CursorIM ComplMatchIns LineNrAbove LineNrBelow MsgArea Terminal User1 User2 User3 User4 User5 User6 User7 User8 User9
|
||||
syn match vimHLGroup contained "\<Conceal\>"
|
||||
syn case match
|
||||
|
||||
@ -1368,7 +1368,7 @@ syn region vimEval
|
||||
\ end="\ze|"
|
||||
\ excludenl end="$"
|
||||
\ nextgroup=vimCmdSep
|
||||
\ contains=@vimContinue,@vimExprList,vimComment,vim9Comment
|
||||
\ contains=@vimContinue,@vimExprList,vim9Comment
|
||||
\ transparent
|
||||
|
||||
" Filter: {{{2
|
||||
|
||||
Reference in New Issue
Block a user