commit eb27932

ohmu  ·  2026-09-15 22:22:40 +0300 MSK
parent a7338d6
renamed wrong name option, added new cool column button
3 files changed,  +23, -6
M acme.1
M acme.c
M acme.1
+2, -2
 1@@ -182,7 +182,7 @@ Where to dump the window layout.  Default:
 2 .B autoindent
 3 Boolean.  Auto-indent new lines.  Default: 1.
 4 .TP
 5-.B swpscrllbtns
 6+.B swpscrlbtns
 7 Boolean.  Swap scroll buttons 1 and 3.  Default: 0.
 8 .TP
 9 .B clicktofocus
10@@ -195,7 +195,7 @@ Number of initial columns.  Default: 2.
11 Boolean.  Open files given on the command line.  Default: 1.
12 .TP
13 .B coolcolbtn
14-Boolean.  Cool column buttons.  Default: 0.
15+Boolean.  Cool column buttons. 1 is square, 2 is ellipse. Default: 0.
16 .TP
17 .B coolscrollbg
18 Boolean.  Cool scrollbar background.  Default: 0.
M acme.c
+19, -2
 1@@ -1038,7 +1038,24 @@ iconinit(void)
 2 		freeimage(modbutton);
 3 		freeimage(colbutton);
 4 	}
 5-	if (coolcolbtn) {
 6+ 
 7+
 8+	if(coolcolbtn == 1){
 9+	    r = Rect(0, 0, Scrollwid, font->height+1);
10+	    button = allocimage(display, r, screen->chan, 0, DNofill);
11+	    draw(button, r, tagcols[BORD], nil, r.min);
12+	    r.max.x -= 4;
13+	    draw(button, Rect(r.min.x + 2, r.min.y + 4, r.min.x + 8, r.min.y + 10), tagcols[BACK], nil, ZP);
14+	    r = button->r;
15+	    modbutton = allocimage(display, r, screen->chan, 0, DNofill);
16+	    draw(modbutton, r, tagcols[BORD], nil, r.min);
17+	    r = insetrect(r, 2);
18+	    if(ispastel("tmpbtn"))
19+	        tmp = allocimagemix(display, C_TMPBUTTON, C_MIX);
20+	    else
21+	        tmp = allocimage(display, Rect(0,0,1,1), RGBA32, 1, C_TMPBUTTON);
22+	    draw(modbutton, Rect(r.min.x, r.min.y + 2, r.min.x + 6, r.min.y + 8), tmp, nil, ZP);
23+	}else if(coolcolbtn == 2){
24         r = Rect(0, 0, Scrollwid, font->height+1);
25         button = allocimage(display, r, screen->chan, 0, DNofill);
26         draw(button, r, tagcols[BORD], nil, r.min);
27@@ -1053,7 +1070,7 @@ iconinit(void)
28 	    else
29     		tmp = allocimage(display, Rect(0,0,1,1), RGBA32, 1, C_TMPBUTTON);
30         fillellipse(modbutton, (Point){r.min.x + 3, r.min.y + 5}, 3, 3, tmp, ZP);
31- 	} else {
32+	}else{
33  	   	button = allocimage(display, r, screen->chan, 0, DNofill);
34     	draw(button, r, tagcols[BACK], nil, r.min);
35     	r.max.x -= ButtonBorder;
+2, -2
 1@@ -43,7 +43,7 @@ defconfig(FILE *f)
 2     fprintf(f, "btn3hl      006600\n");
 3     fprintf(f, "\n");
 4     fprintf(f, "autoindent    1\n");
 5-    fprintf(f, "swpscrllbtns  0\n");
 6+    fprintf(f, "swpscrlbtns  0\n");
 7     fprintf(f, "clicktofocus  1\n");
 8     fprintf(f, "colcount      2\n");
 9     fprintf(f, "openarg       1\n");
10@@ -189,7 +189,7 @@ initconfig(char *custom_config)
11     fontnames[1] = strdup(monofont);
12 
13     globalautoindent = getintvalue(f, "autoindent", 1);
14-    swapscrollbuttons = getintvalue(f, "swpscrllbtns", 0);
15+    swapscrollbuttons = getintvalue(f, "swpscrlbtns", 0);
16     bartflag = getintvalue(f, "clicktofocus", 1);
17     ncol = getintvalue(f, "colcount", 2);
18     openarg = getintvalue(f, "openarg", 1);