summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rio/data.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-10-20 15:51:32 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-10-20 15:51:32 +0200
commit8057e48ae19db2f26f109aa3eb76c047b900e6ba (patch)
treecc9aa6d19fa35d28e7261b513a583eaf9b0a7835 /sys/src/cmd/rio/data.c
parentc33732a5305270321beccbd3e1b44881cd2e0004 (diff)
rio: colors, flicker reduction, refresh after mouse close
allocate all the colors in iconinit(), remove unused ones like grey. rename darkgrey to paletextcol because thats what it is used for. new approach to window image allocation. we allocate the window with DNofill and let the window fill itself. this reduces flickering especially with (-b) option and makes rio resize feel a lot faster. wrefresh() didnt work. now fixed.
Diffstat (limited to 'sys/src/cmd/rio/data.c')
-rw-r--r--sys/src/cmd/rio/data.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/src/cmd/rio/data.c b/sys/src/cmd/rio/data.c
index 86e589b3e..65599b9a4 100644
--- a/sys/src/cmd/rio/data.c
+++ b/sys/src/cmd/rio/data.c
@@ -176,5 +176,28 @@ void
iconinit(void)
{
background = allocimage(display, Rect(0,0,1,1), RGB24, 1, 0x777777FF);
- red = allocimage(display, Rect(0,0,1,1), RGB24, 1, 0xDD0000FF);
+
+ /* greys are multiples of 0x11111100+0xFF, 14* being palest */
+ cols[BACK] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xFFFFFFFF^reverse);
+ cols[HIGH] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0xCCCCCCFF^reverse);
+ cols[BORD] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x999999FF^reverse);
+ cols[TEXT] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x000000FF^reverse);
+ cols[HTEXT] = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x000000FF^reverse);
+ if(!reverse) {
+ titlecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DGreygreen);
+ lighttitlecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DPalegreygreen);
+ } else {
+ titlecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DPurpleblue);
+ lighttitlecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x999999FF);;
+ }
+ dholdcol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DMedblue);
+ lightholdcol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DGreyblue);
+ paleholdcol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DPalegreyblue);
+ paletextcol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x666666FF^reverse);
+ sizecol = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DRed);
+
+ if(reverse == 0)
+ holdcol = dholdcol;
+ else
+ holdcol = paleholdcol;
}