]> git.mdlowis.com Git - projs/tide.git/commitdiff
add margin and change color scheme
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 17 Mar 2022 02:39:34 +0000 (22:39 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 17 Mar 2022 02:39:34 +0000 (22:39 -0400)
Rsconscript
config.h
src/lib/draw.c
src/tide.c

index c3afa508a528ed1769c25688591c62d145ac73d7..024959ae3cf79a691786238dff2def2e71ed7f20 100644 (file)
@@ -2,7 +2,7 @@ configure do
   check_c_compiler "clang", "gcc"
   check_c_header "X11/Xlib.h", check_cpppath: ["/usr/X11/include"]
   check_lib "X11", check_libpath: ["/usr/X11/lib"]
-  check_cfg program: "freetype-config"
+#  check_cfg program: "freetype-config"
 end
 
 build do
@@ -11,7 +11,7 @@ build do
   env["CC"] = "cc"
   env["LD"] = "tools/alcc"
   env["CFLAGS"] += %w[-g]
-  env["CPPPATH"] += %w[. inc]
+  env["CPPPATH"] += %w[. inc /usr/include/freetype2]
   env["LIBPATH"] += %w[.]
   env["LIBS"] += ["util"]
 
@@ -38,4 +38,4 @@ build do
   Dir.glob("bin/*").each{|bin| env.Install("${prefix}/bin", bin) }
 end
 
-# CC=./alcc ./atf -Iinc -I. -I/usr/include/freetype2/ src/lib/buf.c src/lib/dbc.c src/lib/telem.c src/lib/gapbuf.c src/lib/utf8.c src/lib/editlog.c src/lib/range.c src/lib/argv0.c src/lib/writefd.c src/lib/readfd.c
\ No newline at end of file
+# CC=./alcc ./atf -Iinc -I. -I/usr/include/freetype2/ src/lib/buf.c src/lib/dbc.c src/lib/telem.c src/lib/gapbuf.c src/lib/utf8.c src/lib/editlog.c src/lib/range.c src/lib/argv0.c src/lib/writefd.c src/lib/readfd.c
index df4309bc1953e727c7aac63f8f0761fdacce03d4..e1ab9432e1c47ca5a3b00e52f5a75ce9e761c4a7 100644 (file)
--- a/config.h
+++ b/config.h
@@ -36,34 +36,31 @@ static char* TagString = "Del Put Get | Font Tabs Eol | x+ w+ !st !term | Find "
 
 /* List of font patterns available to the editor */
 static char* Fonts[2] = {
-    "Verdana:size=11",
-#ifdef __MACH__
-    "Monaco:size=11"
-#else
-    "Liberation Mono:size=11"
-#endif
+    "Verdana:size=12",
+    "Liberation Mono:size=12"
 };
 
 #ifdef INCLUDE_DEFS
 /* Integer config options */
-int WinWidth = 640;    /* default window width */
-int WinHeight = 480;   /* default window height */
-int ScrollWidth = 5;   /* width in pixels of the scrollbar */
-int Timeout = 100;     /* number of milliseconds to wait before poll() times out */
-int TabWidth = 4;      /* number of spaces tab characters will be expanded to */
-int ScrollBy = 1;      /* number of lines to scroll by on mouse wheel  events */
-int ClickTime = 500;   /* number of milliseconds after a click wehre multi-clicks will be recognized */
-int CopyIndent = On;   /* whether indentation should be copied from previous line or not */
-int TrimOnSave = On;   /* whether trailing whitespace should be removed on save or not */
-int ExpandTabs = On;   /* whether tab characters should be expanded to spaces or not */
+int WinWidth    = 640; /* default window width */
+int WinHeight   = 480; /* default window height */
+int ScrollWidth = 8;   /* width in pixels of the scrollbar */
+int Timeout     = 100; /* number of milliseconds to wait before poll() times out */
+int TabWidth    = 4;   /* number of spaces tab characters will be expanded to */
+int ScrollBy    = 1;   /* number of lines to scroll by on mouse wheel  events */
+int ClickTime   = 500; /* number of milliseconds after a click wehre multi-clicks will be recognized */
+int CopyIndent  = On;  /* whether indentation should be copied from previous line or not */
+int TrimOnSave  = On;  /* whether trailing whitespace should be removed on save or not */
+int ExpandTabs  = On;  /* whether tab characters should be expanded to spaces or not */
 int DosLineFeed = Off; /* use \r\n line endings by default */
+int Margin      = 50;
 #else
 extern int WinWidth, WinHeight, ScrollWidth, Timeout, TabWidth, ScrollBy,
-    ClickTime, CopyIndent, TrimOnSave, ExpandTabs, DosLineFeed;
+    ClickTime, CopyIndent, TrimOnSave, ExpandTabs, DosLineFeed, Margin;
 #endif
 
 static int Palette[ClrCount] = {
-#if 1 /* Original Acme Colors */
+#if 0 /* Original Acme Colors */
     [EditBg]   = 0xFFFFEA, /* Edit region background */
     [EditFg]   = 0x000000, /* Edit region text */
     [EditSel]  = 0xEEEE9E, /* Edit region selection */
@@ -79,20 +76,24 @@ static int Palette[ClrCount] = {
     [Red]      = 0xCC0000, /* Red */
     [Orange]   = 0xFF7700, /* Orange */
 #else
-    [Red]      = 0xD1160B, /* Red */
-    [Purple]   = 0x7878BA, /* Purple */
-    [Orange]   = 0xF39812, /* Orange */
-    [EditBg]   = 0xF0F0E5, /* Edit region background */
-    [EditFg]   = 0x000000, /* Edit region text */
-    [EditSel]  = 0xDFDF99, /* Edit region selection */
-    [TagsBg]   = 0xE5F0F0, /* Tags region background */
-    [TagsFg]   = 0x000000, /* Tags region text */
-    [TagsSel]  = 0x99DFDF, /* Tags region selection */
-    [ScrollBg] = 0x909047, /* Scroll region background */
-    [ScrollFg] = 0xF0F0E5, /* Scroll region foreground */
-    [VerBdr]   = 0x909047, /* Vertical border */
-    [HorBdr]   = 0x000000, /* Horizontal border */
-    [Point]    = 0x98BE8F, /* Window border */
+    [EditBg]   = 0xF5F5F0, /* Edit region background */
+    [EditFg]   = 0x222222, /* Edit region text */
+    [EditSel]  = 0xAACCEE, /* Edit region selection */
+
+    [TagsBg]   = 0xF5F5F0, /* Tags region background */
+    [TagsFg]   = 0x222222, /* Tags region text */
+    [TagsSel]  = 0xAACCEE, /* Tags region selection */
+
+    [ScrollBg] = 0x959590, /* Scroll region background */
+    [ScrollFg] = 0xF5F5F0, /* Scroll region foreground */
+
+    [VerBdr]   = 0x959590, /* Vertical border */
+    [HorBdr]   = 0x222222, /* Horizontal border */
+
+    [Point]    = 0xD5D5D0, /* Point background */
+    [Purple]   = 0x6666CC, /* Purple */
+    [Red]      = 0xCC0000, /* Red */
+    [Orange]   = 0xFF7700, /* Orange */
 #endif
 };
 
index 493cdb12c63aedfee74cac90594faa54dc955544..abe9c24da1094b47957ab6c567a7f8bda5097843 100644 (file)
@@ -35,13 +35,13 @@ void draw_view(XConf* x, View* view, XftFont* font, size_t nrows, drawcsr* csr,
     size_t fheight = font->height;
     bool csr_drawn = false;
     /* draw the view to the window */
-    view_resize(view, (csr->w - csr->x), nrows);
+    view_resize(view, (csr->w - csr->x - 2) - (2* Margin), nrows);
     view_update(view);
     draw_rect(x, bg, csr->x, csr->y, csr->w, ((nrows + 1) * fheight) + 9);
     for (size_t i = 0; i < nrows; i++)
     {
         Row* row = view_getrow(view, i + view->index);
-        size_t posx = (csr->x + 2), y = (csr->y + 2 + (i * fheight));
+        size_t posx = (csr->x + 2 + Margin), y = (csr->y + 2 + (i * fheight));
         if (row->off == buf_end(&(view->buffer)))
         {
             if (buf_end(&(view->buffer)) == buf_selend(&(view->buffer)))
index cea4d2fbbfee157a9994e70bbec2eb6c29c8c97f..f385cccbdbba618af7ace486c3180431acdb6916 100644 (file)
@@ -92,7 +92,7 @@ static void font_load(char* name)
 static void get_position(WinRegion id, int x, int y, size_t* row, size_t* col)
 {
     int starty = (id == EDIT ? Divider+3 : 0);
-    int startx = ScrollWidth+3;
+    int startx = ScrollWidth + 3 + Margin;
     int maxy = (id == EDIT
         ? (Divider + (int)(win_view(EDIT)->nrows * X.font->height))
         : Divider - 4