ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/init.C
(Generate patch)

Comparing rxvt-unicode/src/init.C (file contents):
Revision 1.339 by sf-exg, Mon Oct 13 17:05:32 2014 UTC vs.
Revision 1.340 by root, Sat Dec 13 12:24:32 2014 UTC

1056 run_command (argv); 1056 run_command (argv);
1057} 1057}
1058 1058
1059/*----------------------------------------------------------------------*/ 1059/*----------------------------------------------------------------------*/
1060void 1060void
1061rxvt_term::get_colours () 1061rxvt_term::get_colors ()
1062{ 1062{
1063 int i; 1063 int i;
1064 1064
1065#ifdef OFF_FOCUS_FADING 1065#ifdef OFF_FOCUS_FADING
1066 pix_colors = pix_colors_focused; 1066 pix_colors = pix_colors_focused;
1067#endif 1067#endif
1068 1068
1069 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) 1069 for (i = 0; i < NRS_COLORS; i++)
1070 { 1070 {
1071 const char *name = rs[Rs_color + i]; 1071 const char *name = rs[Rs_color + i];
1072 1072
1073 if (!name) 1073 if (!name)
1074 continue; 1074 continue;
1084#endif 1084#endif
1085 name = def_colorName [i]; 1085 name = def_colorName [i];
1086 1086
1087 if (!name) 1087 if (!name)
1088 continue; 1088 continue;
1089
1090 xcol.free (this);
1089 1091
1090 if (!set_color (xcol, name)) 1092 if (!set_color (xcol, name))
1091 { 1093 {
1092 switch (i) 1094 switch (i)
1093 { 1095 {
1113 1115
1114 pix_colors[i] = xcol; 1116 pix_colors[i] = xcol;
1115 rs[Rs_color + i] = name; 1117 rs[Rs_color + i] = name;
1116 } 1118 }
1117 1119
1118 if (depth <= 2)
1119 {
1120 if (!rs[Rs_color + Color_pointer_fg]) alias_color (Color_pointer_fg, Color_fg);
1121 if (!rs[Rs_color + Color_pointer_bg]) alias_color (Color_pointer_bg, Color_bg);
1122 if (!rs[Rs_color + Color_border] ) alias_color (Color_border, Color_fg);
1123 }
1124
1125 /* 1120 /*
1126 * get scrollBar shadow colors 1121 * get scrollBar shadow colors
1127 * 1122 *
1128 * The calculations of topShadow/bottomShadow values are adapted 1123 * The calculations of topShadow/bottomShadow values are adapted
1129 * from the fvwm window manager. 1124 * from the fvwm window manager.
1130 */ 1125 */
1131#ifdef RXVT_SCROLLBAR 1126#ifdef RXVT_SCROLLBAR
1132 if (depth <= 2)
1133 {
1134 /* Monochrome */
1135 alias_color (Color_scroll, Color_fg);
1136 alias_color (Color_topShadow, Color_bg);
1137 alias_color (Color_bottomShadow, Color_bg);
1138 }
1139 else
1140 {
1141 pix_colors [Color_scroll].fade (this, 50, pix_colors [Color_bottomShadow]); 1127 pix_colors [Color_scroll].fade (this, 50, pix_colors [Color_bottomShadow]);
1142 1128
1143 rgba cscroll; 1129 rgba cscroll;
1144 pix_colors [Color_scroll].get (cscroll); 1130 pix_colors [Color_scroll].get (cscroll);
1145 1131
1146 /* topShadowColor */ 1132 /* topShadowColor */
1147 if (!pix_colors[Color_topShadow].set (this, 1133 if (!pix_colors[Color_topShadow].set (this,
1148 rgba ( 1134 rgba (
1149 min ((int)rgba::MAX_CC, max (cscroll.r / 5, cscroll.r) * 7 / 5), 1135 min ((int)rgba::MAX_CC, max (cscroll.r / 5, cscroll.r) * 7 / 5),
1150 min ((int)rgba::MAX_CC, max (cscroll.g / 5, cscroll.g) * 7 / 5), 1136 min ((int)rgba::MAX_CC, max (cscroll.g / 5, cscroll.g) * 7 / 5),
1151 min ((int)rgba::MAX_CC, max (cscroll.b / 5, cscroll.b) * 7 / 5), 1137 min ((int)rgba::MAX_CC, max (cscroll.b / 5, cscroll.b) * 7 / 5),
1152 cscroll.a) 1138 cscroll.a)
1153 )) 1139 ))
1154 alias_color (Color_topShadow, Color_White); 1140 alias_color (Color_topShadow, Color_White);
1155 }
1156#endif 1141#endif
1157 1142
1158#ifdef OFF_FOCUS_FADING 1143#ifdef OFF_FOCUS_FADING
1159 for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++) 1144 for (i = 0; i < NRS_COLORS; i++)
1160 update_fade_color (i); 1145 update_fade_color (i, true);
1161#endif 1146#endif
1162} 1147}
1163 1148
1164/*----------------------------------------------------------------------*/ 1149/*----------------------------------------------------------------------*/
1165/* color aliases, fg/bg bright-bold */ 1150/* color aliases, fg/bg bright-bold */
1344 Window top, parent; 1329 Window top, parent;
1345 1330
1346 dLocal (Display *, dpy); 1331 dLocal (Display *, dpy);
1347 1332
1348 /* grab colors before netscape does */ 1333 /* grab colors before netscape does */
1349 get_colours (); 1334 get_colors ();
1350 1335
1351 if (!set_fonts ()) 1336 if (!set_fonts ())
1352 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); 1337 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n");
1353 1338
1354 parent = display->root; 1339 parent = display->root;
1507 if (rs[Rs_fade]) 1492 if (rs[Rs_fade])
1508 pix_colors = pix_colors_unfocused; 1493 pix_colors = pix_colors_unfocused;
1509#endif 1494#endif
1510 1495
1511 pointer_unblank (); 1496 pointer_unblank ();
1512 scr_recolour (); 1497 scr_recolor ();
1513} 1498}
1514 1499
1515/*----------------------------------------------------------------------*/ 1500/*----------------------------------------------------------------------*/
1516/* 1501/*
1517 * Run the command in a subprocess and return a file descriptor for the 1502 * Run the command in a subprocess and return a file descriptor for the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines