[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: How to create icon



大和です.

>> w3m-view-parent-pageのツールバーアイコンを作りたくなりました.
>> [...]

寺西さん,質問にお答え頂きありがとうございます.
作ってみました.forwardとかbackにピクセル値(?)を揃えたかった
のですが,非常に手間がかかりそうだったのであきらめました.
^Lで区切って送ります.C-x n wして下さい.すいません.

2001-04-17  Masatake YAMATO  <masata-y@gyve.aist-nara.ac.jp>

	* w3m.el (w3m-toolbar): Added w3m-toolbar-parent-icon.
	(w3m-toolbar-buttons): Added "parent".
	(w3m-parent-page-available-p): New function.

	* icons/parent-*.xpm: New files.

Index: w3m.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.201
diff -u -r1.201 w3m.el
--- w3m.el	2001/04/16 14:12:30	1.201
+++ w3m.el	2001/04/16 15:23:31
@@ -590,7 +590,7 @@
   "An alist of CONTENT-TYPE and IMAGE-TYPE.")
 
 (defconst w3m-toolbar-buttons
-  '("back" "forward" "reload" "open" "home" "search" "image"
+  '("back" "parent" "forward" "reload" "open" "home" "search" "image"
     "weather" "antenna")
   "Toolbar button list for w3m.")
 
@@ -598,6 +598,9 @@
   '([w3m-toolbar-back-icon w3m-view-previous-page
 			   (w3m-history-previous-link-available-p)
 			   "前のページに戻る"]
+    [w3m-toolbar-parent-icon w3m-view-parent-page 
+			     (w3m-parent-page-available-p)
+			     "上のディレクトリへ移動する"]
     [w3m-toolbar-forward-icon w3m-view-next-page
 			      (w3m-history-next-link-available-p)
 			      "次のページに進む"]
@@ -1949,6 +1952,12 @@
       (unless quiet
 	(message "Not found such name anchor."))
       nil)))
+
+(defun w3m-parent-page-available-p ()
+  (if (null w3m-current-url)
+      nil
+    (save-match-data
+      (string-match "[a-z]+://?[^/]+/." w3m-current-url))))
 
 (defun w3m-view-parent-page ()
   (interactive)

/* XPM */
static char * parent_up_xpm[] = {
"34 30 11 1",
" 	c #B6B6B2B2B6B6  s backgroundToolBarColor",
".	c #000000000000",
"X	c #C7C7FFFF8686",
"o	c #5959F3F30000",
"O	c #5151E7E70000",
"+	c #4949DBDB0000",
"@	c #4141CFCF0000",
"#	c #8E8E8A8A8E8E",
"$	c #3838C7C70000",
"%	c #2828BABA0000",
"&	c #2020AEAE0000",
"                                  ",
"                                  ",
"                                  ",
"                                  ",
"                                  ",
"                .                 ",
"               .X.                ",
"              .XoX.               ",
"             .XoooX.              ",
"            .XOOOOOX.             ",
"           .XOOOOOOOX.            ",
"          .X+++++++++X.           ",
"         .....@@@@@.....          ",
"         ####.$$$$$.####          ",
"             .%%%%%.              ",
"             .&&&&&.              ",
"             .&&&&&.              ",
"             .......              ",
"             #######              ",
"                                  ",
"            .   .                 ",
"            .   . ...             ",
"            .   . .  .            ",
"            .   . .  .            ",
"            .   . .  .            ",
"             ...  ...             ",
"                  .               ",
"                  .               ",
"                                  ",
"                                  "};

/* XPM */
static char * parent_down_xpm[] = {
" 34 30 15 1",
". c #b6b2b6 s backgroundToolBarColor",
"# c #606060",
"a c #d7d7d7",
"b c #c6c6c6",
"c c #bebebe",
"d c #b6b6b6",
"e c #a9ada9",
"f c #a1a5a1",
"g c #aeaaae",
"h c #999999",
"i c #bebabe",
"j c #919191",
"k c #898989",
"l c #818181",
"m c #797979",
/* pixels */
"..................................",
"..................................",
"..................................",
"..................................",
"..................................",
"................#.................",
"...............#a#................",
"..............#aba#...............",
".............#abbba#..............",
"............#accccca#.............",
"...........#accccccca#............",
"..........#addddddddda#...........",
".........#####eeeee#####..........",
".........iiii#fffff#iiii..........",
".............#hhhhh#..............",
".............#kkkkk#..............",
".............#mmmmm#..............",
".............#######..............",
".............iiiiiii..............",
"..................................",
"............#...#.................",
"............#...#.###.............",
"............#...#.#..#............",
"............#...#.#..#............",
"............#...#.#..#............",
".............###..###.............",
"..................#...............",
"..................#...............",
"..................................",
".................................."};