mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-26 09:44:21 +00:00
Compare commits
5 Commits
8ac4f9397d
...
aff4ecbb82
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aff4ecbb82 | ||
|
|
c2d88beda8 | ||
|
|
f8d1ae37ff | ||
|
|
d0ee59596d | ||
|
|
b50e03a136 |
@ -1,9 +1,9 @@
|
||||
### Description
|
||||
A homegrown port of dwm's _truecenteredtitle_ patch, with the addition of a config option to toggle its effects.<br>Requires [the bar patch](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar) to be applied beforehand.
|
||||

|
||||

|
||||
|
||||
### Download
|
||||
- [v0.7](/dwl/dwl-patches/raw/branch/main/patches/centertitle/centertitle-v0.7.patch)<br>Targets latest dwl release v0.7.
|
||||
- [v0.7](/dwl/dwl-patches/raw/branch/main/patches/bartruecenteredtitle/bar-truecenteredtitle-v0.7.patch)<br>Targets latest dwl release v0.7.
|
||||
|
||||
### Author
|
||||
- [Codeberg: moonsabre](https://codeberg.org/moonsabre)<br>[Discord: moonsabre.](https://discordapp.com/users/1334621003648733274)
|
||||
- [moonsabre](https://codeberg.org/moonsabre)
|
||||
@ -16,7 +16,7 @@ index 5d1dc2b..ecbf223 100644
|
||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
+static const int centertitle = 1; /* 1 means center window title */
|
||||
+static const int centeredtitle = 1; /* 1 means center window title */
|
||||
static const char *fonts[] = {"monospace:size=10"};
|
||||
static const float rootcolor[] = COLOR(0x000000ff);
|
||||
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
|
||||
@ -29,7 +29,7 @@ index ece537a..d7ffce2 100644
|
||||
if (c) {
|
||||
drwl_setscheme(m->drw, colors[m == selmon ? SchemeSel : SchemeNorm]);
|
||||
- drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
|
||||
+ if ((centertitle == 0) || (TEXTW(selmon, client_get_title(c)) > w)) {
|
||||
+ if ((centeredtitle == 0) || (TEXTW(selmon, client_get_title(c)) > w)) {
|
||||
+ drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
|
||||
+ } else {
|
||||
+ drwl_text(m->drw, x, 0, w, m->b.height, (w - TEXTW(selmon, client_get_title(c))) / 2, client_get_title(c), 0);
|
||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Loading…
x
Reference in New Issue
Block a user