ソースを参照

rm layout name from tabbar

siduck76 3 年 前
コミット
739afd0330
2 ファイル変更8 行追加40 行削除
  1. 6 6
      chadwm/config.def.h
  2. 2 34
      chadwm/dwm.c

+ 6 - 6
chadwm/config.def.h

@@ -19,14 +19,14 @@ static const int showsystray        = 1;     /* 0 means no systray */
 static const int showbar            = 1;        /* 0 means no bar */
 enum showtab_modes { showtab_never, showtab_auto, showtab_nmodes, showtab_always };
 static const int showtab            = showtab_auto;
-static const int toptab             = False;
-static const int topbar             = 1;        /* 0 means bottom bar */
+static const int toptab             = True;
+static const int topbar             = 0;        /* 0 means bottom bar */
 static const int vertpad            = 10;       /* vertical padding of bar */
 static const int sidepad            = 10;       /* horizontal padding of bar */
 static const int horizpadbar        = 5;
 static const int vertpadbar         = 11;
-static const int horizpadtabi       = 10;
-static const int horizpadtabo       = 6;
+static const int horizpadtabi       = 13;
+static const int horizpadtabo       = 15;
 static const char *fonts[]          = { "JetBrainsMono Nerd Font:style:medium:size=10",
                                         "Material Design Icons-Regular:size=10",
                                       };
@@ -43,14 +43,14 @@ static const char green[]       = "#89b482";
 static const char red[]         = "#BF616A";
 static const char orange[]      = "#caaa6a";
 static const char pink[]        = "#B48EAD";
-static const char col_borderbar[]   = "#2E3440"; // inner border
+static const char col_borderbar[]  = "#2E3440"; // inner border
 static const char purpleBlue[]  = "#6C77BB";
 
 static const char *colors[][3]      = {
     /*               fg         bg         border   */
     [SchemeNorm]       = { gray3, black, gray2 },
     [SchemeSel]        = { gray4, blue,  blue  },
-    [TabSel]           = { black, purpleBlue,  black  },
+    [TabSel]           = { blue, gray2,  black  },
     [TabNorm]          = { gray3, black, black },
     [SchemeTag]        = { gray3, black, black },
     [SchemeTag1]       = { blue,  black, black },

+ 2 - 34
chadwm/dwm.c

@@ -1403,36 +1403,13 @@ void
 drawtab(Monitor *m) {
 	Client *c;
 	int i;
-	int itag = -1;
-	char view_info[50];
-	int view_info_w = 0;
 	int sorted_label_widths[MAXTABS];
-	int tot_width;
+	int tot_width = 0;
 	int maxsize = bh;
 	int x = 0;
 	int w = 0;
         int mw = m->ww - 2 * sp;
 
-	//view_info: indicate the tag which is displayed in the view
-	for(i = 0; i < LENGTH(tags); ++i){
-	  if((selmon->tagset[selmon->seltags] >> i) & 1) {
-	    if(itag >=0){ //more than one tag selected
-	      itag = -1;
-	      break;
-	    }
-	    itag = i;
-	  }
-	}
-
-	if(0 <= itag  && itag < LENGTH(tags)){
-	  snprintf(view_info, sizeof view_info, "[%s]", tags[itag]);
-	} else {
-	  strncpy(view_info, "[...]", sizeof view_info);
-	}
-       	view_info_w = TEXTW(view_info) - lrpad + horizpadtabi + horizpadtabo;
-	view_info_w = TEXTW(view_info);
-	tot_width = view_info_w;
-
 	/* Calculates number of labels and their width */
 	m->ntabs = 0;
 	for(c = m->clients; c; c = c->next){
@@ -1446,7 +1423,6 @@ drawtab(Monitor *m) {
         if(tot_width > mw){ //not enough space to display the labels, they need to be truncated
 	  memcpy(sorted_label_widths, m->tab_widths, sizeof(int) * m->ntabs);
 	  qsort(sorted_label_widths, m->ntabs, sizeof(int), cmpint);
-	  tot_width = view_info_w;
 	  for(i = 0; i < m->ntabs; ++i){
           if(tot_width + (m->ntabs - i) * sorted_label_widths[i] > mw)
 	      break;
@@ -1461,7 +1437,7 @@ drawtab(Monitor *m) {
 	i = 0;
 
 	/* cleans window */
-	drw_setscheme(drw, scheme[SchemeNorm]);
+	drw_setscheme(drw, scheme[TabNorm]);
 	drw_rect(drw, 0, 0, mw, th, 1, 1);
 
 	for(c = m->clients; c; c = c->next){
@@ -1475,17 +1451,9 @@ drawtab(Monitor *m) {
 	  ++i;
 	}
 
-	/* view info */
-        w = mw - view_info_w - x;
-	x += w;
-	w = view_info_w;
-        drw_setscheme(drw, scheme[TabNorm]);
-	drw_text(drw, x + horizpadtabo, vertpadbar / 2, w - horizpadtabo, th - vertpadbar, horizpadtabi / 2, view_info, 0);
-
 	drw_map(drw, m->tabwin, 0, 0, m->ww, th);
 }
 
-
 void enternotify(XEvent *e) {
   Client *c;
   Monitor *m;