corrected scale factor used for vector icons, and updated the icons in the

corrected scale factor used for vector icons, and updated the
	icons in the vector them to be the proper size.  Also, some work
	on link set configurations that isn't completed yet, and allowed
	the sidebar to be reduced to a very small width to get started with
	the upcoming rework.
This commit is contained in:
Andy Hertzfeld 2000-06-11 03:59:41 +00:00
parent f239299837
commit d00fe18ab8
12 changed files with 342 additions and 81 deletions

View file

@ -1,3 +1,21 @@
2000-06-10 Andy Hertzfeld <andy@eazel.com>
* libnautilus-extensions/nautilus-icon-factory.c:
(load_specific_image_svg):
use the correct scale factor for vector icons, the same as image icons, instead
of expecting them to be twice the size of regular icons.
* icons/vector/i-directory-accept.svg:
* icons/vector/i-directory.svg:
* icons/vector/i-regular.svg:
new versions of the icons in the vector theme, scaled to their proper size
* libnautilus-extensions/nautilus-link-set.c,h:
(make_link_set_check_box), (get_link_set_names),
(nautilus_link_set_configure_window):
added code for configuring link sets. Still not finished yet.
* src/nautilus-sidebar.c: (nautilus_sidebar_initialize):
allowed sidebar to be reduced to a very narrow width, to start experimenting
with how to give it a minimal mode.
2000-06-10 J Shane Culpepper <pepper@eazel.com>
* configure.in: Fixed the test for ghttp to jive with changes made to

View file

@ -1,54 +1,57 @@
<svg width="153" height="127">
<!-- Aopenfolder.eps converted by ill2svg.pl -->
<svg width="72" height="56">
<!-- openfolder62000a.eps converted by ill2svg.pl -->
<defs>
<linearGradient id="folder__1"
x1="74.945" y1="40.525" x2="45.881" y2="90.867"
x1="766.248" y1="756.629" x2="754.477" y2="777.017"
>
<stop offset="0%" style="stop-color:#f2cc0c"/>
<stop offset="100%" style="stop-color:#ffffff"/>
<stop offset="100%" style="stop-color:#ffffff"/>
</linearGradient>
<linearGradient id="folder__2"
x1="90.531" y1="101.184" x2="90.531" y2="1.22"
x1="772.435" y1="781.195" x2="772.435" y2="740.709"
>
<stop offset="0%" style="stop-color:#f2cc0c"/>
<stop offset="100%" style="stop-color:#ffffff"/>
<stop offset="100%" style="stop-color:#ffffff"/>
</linearGradient>
<linearGradient id="paper2__1"
x1="-12845.013" y1="-11736.48" x2="-12845.013" y2="-11736.48"
x1="-5846.263" y1="-5392.986" x2="-5846.263" y2="-5392.986"
>
<stop offset="0%" style="stop-color:#ffffff"/>
<stop offset="53%" style="stop-color:#c6c6c6"/>
<stop offset="100%" style="stop-color:#ffffff"/>
<stop offset="53%" style="stop-color:#c6c6c6"/>
<stop offset="100%" style="stop-color:#ffffff"/>
</linearGradient>
</defs>
<g> <!-- Layer: Layer 1 -->
<g style="fill: #000000; stroke: #000000; stroke-width: 2; stroke-miterlimit: 4">
<path d="M1.341 8.28C1.341 8.28 21.118 29.151 24.576 53.3C28.091 77.85 26.076 79.69 26.076 80.05C26.076 80.41 111.992 123.467 114.38 124.74C114.38 124.74 115.111 102.501 117.62 90.18C121.58 70.74 126.324 64.82 131.326 58.8C135.555 53.709 147.527 48.617 151.1 47.7C152.659 47.3 118.056 29.68 115.701 28.633C114.081 27.913 120.753 22.82 123.159 20.8C124.538 19.643 95.179 6.16 92.659 5.8C91.695 5.662 82.326 12.55 81.981 13.14C81.326 14.261 60.381 1.98 58.941 1.62C57.501 1.26 41.326 4.967 34.326 22.967C34.731 21.925 1.341 8.28 1.341 8.28"/>
<!-- 0 1 0 0 -1 -4014 4716 Bc -->
<!-- 0.53 0 0 -1 -4014 4716 Bm -->
<!-- 0.47 0 0 -1 -4013.47 4716 Bm -->
<!-- 1 0 0 -1 -4014 4716 Bc -->
<g style="fill: #000000; stroke: #000000; stroke-width: 0.81; stroke-linejoin: round; stroke-miterlimit: 1">
<path d="M1.25 8C1.25 8 8.737 16.312 10.138 26.091C11.561 36.034 11.125 36.981 11.125 37.125C11.125 37.272 45.542 54.51 46.509 55.024C46.509 55.024 46.804 46.018 47.821 41.027C49.425 33.154 51.346 30.757 53.372 28.319C55.084 26.257 58.75 23.75 61.375 23.375C61.375 23.375 47.997 16.525 47.043 16.102C46.387 15.81 49.089 13.748 50.064 12.929C50.623 12.461 38.733 7 37.711 6.853C37.321 6.798 33.248 10.065 33.387 9.827C33.485 9.659 24.056 5.161 24.056 5.161C23.125 5.625 17.375 6.875 14.086 13.807C14.104 13.769 -0.023 7.473 1.25 8"/>
<!-- 0 1 1 1 1 0 0 -1 -7885.5 8587.5 Xm -->
<!-- 1 0 0 -1 -7885.5 8587.5 Bc -->
<!-- 0.53 0 0 -1 -7885.5 8587.5 Bm -->
<!-- 0.47 0 0 -1 -7884.9702 8587.5 Bm -->
<!-- 1 0 0 -1 -7885.5 8587.5 Bc -->
</g>
<g style="fill: url(#paper2__1)">
<path d="M8.001 13.5"/>
<!-- 0 -12063.8165 -20895.5197 -129.5781 74.8106 12379.965 21286.9274 Bc -->
<!-- -29.064 -50.3412 -129.5781 74.8106 316.1485 391.4076 Bm -->
<!-- -12063.8165 -20895.5197 -129.5781 74.8106 287.0845 341.0665 Bc -->
<path d="M3.425 9.973"/>
<!-- 0 -11.7709 -20.3882 -54.1863 31.2837 224.1538 393.6621 Xm -->
<!-- -3299.7588 -5715.4878 -54.1863 31.2837 3523.9121 6109.1499 Bc -->
<!-- -11.7709 -20.3882 -54.1863 31.2837 224.1538 393.6621 Bm -->
<!-- -3299.7588 -5715.4878 -54.1863 31.2837 212.3828 373.2734 Bc -->
</g>
<g style="fill: url(#folder__1); stroke: #000000; stroke-width: 2; stroke-miterlimit: 4">
<path d="M8.001 13.5C8.001 13.5 30.668 30.167 30.334 77.167C30.324 78.607 110.334 119.5 110.334 119.5C110.334 119.5 109.438 80.038 101.084 64.167C97.751 57.833 88.099 53.031 84.769 51.207C72.834 44.667 8.001 13.5 8.001 13.5"/>
<!-- 2 0 24127.9999 112.1479 0 211.4924 -23760.1835 Bc -->
<!-- 0 99.9634 112.1479 0 211.4924 367.8163 Bm -->
<!-- 0 24127.9999 112.1479 0 211.4924 467.7797 Bc -->
<g style="fill: url(#folder__1)"; stroke: #000000; stroke-width: 0.81; stroke-miterlimit: 4">
<path d="M4.125 10.25C2.607 8.919 12.25 17.008 12.25 36.5C12.25 37.083 45.375 53.5 45.375 53.5C45.375 53.5 44.883 35.928 41.5 29.5C40.309 27.237 35.713 25.402 34 24.5C29.25 22 4.125 10.25 4.125 10.25z"/>
<!-- 0 0 40.4852 47.5124 0 180.6304 384.3906 Xm -->
<!-- -0.0003 6606.7002 47.5124 0 180.6309 -6222.3096 Bc -->
<!-- 0 40.4852 47.5124 0 180.6304 384.3906 Bm -->
<!-- -0.0003 6606.7002 47.5124 0 180.6304 424.876 Bc -->
</g>
<g style="fill: url(#folder__2)">
<path d="M41.992 25.133C41.992 25.133 87.136 47.22 88.576 48.3C90.016 49.38 96.654 52.892 98.492 54.3C110.576 63.55 109.576 72.55 113.659 90.8C114.762 95.731 112.58 78.84 121.76 64.08C128.774 52.802 133.552 50.553 141.38 46.08C142.64 45.36 58.941 5.94 58.581 5.22C58.581 5.22 44.252 8.013 38.492 23.133"/>
<path d="M17.191 14.81C17.191 14.81 34.348 23.049 35 23.375C37.5 24.625 39.5 25.625 41.375 27C44.621 29.38 45.171 36.753 46.25 44.25C46.534 46.221 46.282 37.353 50 31.375C52.841 26.807 55.375 25 59 23.125C59.523 22.854 24.021 6.291 23.875 6C23.875 6 17.583 7.627 15.25 13.75"/>
</g>
<g style="fill: #0072ba">
<path d="M86.034 13.633C87.034 14.3 112.034 25.8 112.534 26.133C113.034 26.466 117.839 20.82 118.326 20.467C118.784 20.133 94.659 8.633 93.659 8.467C92.659 8.3 86.034 13.633 86.034 13.633z"/>
<path d="M35.077 9.817C35.498 10.098 46.032 14.943 46.243 15.084C46.453 15.225 48.478 12.845 48.684 12.696C48.876 12.556 38.711 7.71 38.29 7.64C37.868 7.569 35.077 9.817 35.077 9.817z"/>
</g>
<g style="fill:none; stroke: #5ed8ff; stroke-width: 2; stroke-linecap: round; stroke-miterlimit: 4">
<path d="M88.492 13.133C88.492 13.133 92.492 9.967 93.659 10.133C94.826 10.3 114.43 19.545 115.659 20.467"/>
<g style="fill:none; stroke: #5ed8ff; stroke-width: 0.81; stroke-linecap: round; stroke-miterlimit: 4">
<path d="M36.024 9.824C36.024 9.824 37.644 8.542 38.117 8.609C38.589 8.676 46.529 12.42 47.026 12.794"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -1,41 +1,43 @@
<svg width="113" height="132">
<!-- Aclosedfolder.eps converted by ill2svg.pl -->
<svg width="44" height="52">
<!-- closedfolder62000a.eps converted by ill2svg.pl -->
<defs>
<linearGradient id="folder__1"
x1="69.721" y1="35.66" x2="32.351" y2="100.388"
x1="778.913" y1="766.115" x2="764.436" y2="791.19"
>
<stop offset="0%" style="stop-color:#f2cc0c"/>
<stop offset="100%" style="stop-color:#ffffff"/>
<stop offset="100%" style="stop-color:#ffffff"/>
</linearGradient>
<linearGradient id="folder__2"
x1="62.569" y1="84.528" x2="62.569" y2="5.088"
x1="776.143" y1="785.046" x2="776.143" y2="754.27"
>
<stop offset="0%" style="stop-color:#f2cc0c"/>
<stop offset="100%" style="stop-color:#ffffff"/>
<stop offset="100%" style="stop-color:#ffffff"/>
</linearGradient>
</defs>
<g> <!-- Layer: Layer 1 -->
<g style="fill: #000000">
<path d="M0.636 5.127C1.604 8.517 7.657 34.907 7.657 47.497C7.657 60.087 7.657 85.266 7.415 86.235C7.173 87.203 97.965 131.51 100.144 131.51C100.91 131.51 97.85 81.164 112.135 43.636C112.52 42.624 69.208 23.491 65.334 21.796C64.42 21.396 20.976 -0.181 20.007 0.303C19.039 0.787 16.373 13.117 16.131 12.39C15.889 11.664 0.636 5.127 0.636 5.127z"/>
<!-- 0 -12546.481 -21731.4346 -124.4484 71.8493 12876.4454 22131.8347 Bc -->
<!-- -37.3698 -64.7272 -124.4484 71.8493 329.9644 400.4001 Bm -->
<!-- -12546.481 -21731.4346 -124.4484 71.8493 292.5946 335.6729 Bc -->
<path d="M0.582 2.723C0.957 4.036 3.177 15.458 3.302 19.138C3.469 24.012 3.302 33.771 3.208 34.146C3.114 34.521 38.289 51.685 39.133 51.685C39.43 51.685 38.245 32.181 43.778 17.643C43.928 17.249 27.148 9.837 25.647 9.181C25.293 9.025 8.462 0.666 8.087 0.853C7.711 1.041 6.679 5.818 6.584 5.537C6.491 5.255 0.582 2.723 0.582 2.723z"/>
<!-- 0 1 1 1 -14.477 -25.0755 -48.2128 27.835 292.5137 403.6172 Xm -->
<!-- -3262.0879 -5650.2378 -48.2128 27.835 3554.6016 6053.855 Bc -->
<!-- -14.477 -25.0755 -48.2128 27.835 292.5137 403.6172 Bm -->
<!-- -3262.0879 -5650.2378 -48.2128 27.835 278.0366 378.542 Bc -->
</g>
<g style="fill: url(#folder__1); stroke: #000000; stroke-width: 3.12; stroke-miterlimit: 4">
<path d="M5.72 11.18C5.72 11.18 11.773 36.602 11.047 50.402C10.487 61.043 11.531 83.572 11.531 83.572C11.531 83.572 95.786 125.941 95.786 125.215C95.786 124.489 99.418 76.308 86.344 51.371C85.365 49.504 5.72 11.18 5.72 11.18"/>
<!-- 2 0 25093.143 93.1983 0 214.8871 -24705.6788 Bc -->
<!-- 0 79.4403 93.1983 0 214.8871 387.4642 Bm -->
<!-- 0 25093.143 93.1983 0 214.8871 466.9044 Bc -->
<g style="fill: url(#folder__1)">
<path d="M2.552 5.068C2.552 5.068 4.726 14.166 4.855 22.562C4.933 27.599 4.803 33.114 4.803 33.114C4.803 33.114 37.444 49.529 37.444 49.247C37.444 48.966 38.852 30.3 33.787 20.638C33.407 19.915 2.552 5.068 2.552 5.068z"/>
<!-- 0 0 30.7754 36.8677 0 247.4209 398.7998 Xm -->
<!-- -0.0003 6521.937 36.8677 0 247.4214 -6123.1367 Bc -->
<!-- 0 30.7754 36.8677 0 247.4209 398.7998 Bm -->
<!-- -0.0003 6521.937 36.8677 0 247.4209 429.5752 Bc -->
</g>
<g style="fill: url(#folder__2)">
<path d="M98.449 80.424C98.449 80.424 100.852 60.929 105.548 46.843C105.925 45.712 22.694 7.236 22.694 7.236C22.694 7.236 21.048 11.223 21.048 14.083C21.048 14.688 85.951 45.417 89.31 47.8C93.93 51.076 98.449 77.491 98.449 80.424z"/>
<path d="M38.477 31.894C38.477 31.894 39.712 23.756 41.531 18.3C41.677 17.861 8.858 2.932 8.858 2.932C8.858 2.932 8.341 4.998 8.084 6.16C8.032 6.389 33.634 18.332 34.935 19.255C36.725 20.524 38.477 30.758 38.477 31.894z"/>
</g>
<g style="fill: #000000">
<path d="M55.838 36.844"/>
<path d="M51.589 15.879C51.589 14.184 56.461 4.965 57.188 4.723C57.914 4.481 86.397 18.037 87.608 18.763C88.818 19.489 84.228 23.703 83.064 30.89"/>
<path d="M21.968 15.011"/>
<path d="M20.323 6.889C20.323 6.231 22.209 2.661 22.491 2.566C22.772 2.473 33.808 7.724 34.276 8.005C34.746 8.287 32.967 9.919 32.516 12.704"/>
</g>
<g style="fill: #0072ba">
<path d="M55.499 16.345C56.952 17.314 79.226 27.483 79.953 27.967C79.689 27.791 83.045 20.067 83.188 20.496C82.912 19.668 60.72 9.645 59.268 9.403C57.815 9.161 55.499 16.345 55.499 16.345z"/>
<path d="M21.837 7.069C22.399 7.444 31.029 11.383 31.31 11.571C31.209 11.503 32.509 8.511 32.563 8.678C32.457 8.356 23.859 4.474 23.296 4.379C22.734 4.285 21.837 7.069 21.837 7.069z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -1,22 +1,38 @@
<svg width="110" height="122">
<!-- Adocument4.eps converted by ill2svg.pl -->
<svg width="45" height="50">
<!-- 3document62000a.eps converted by ill2svg.pl -->
<defs>
<linearGradient id="Paper__1"
x1="36.263" y1="-1.979" x2="72.476" y2="124.31"
<linearGradient id="paper_5__1"
x1="1301.404" y1="1311.013" x2="1305.872" y2="1316.338"
>
<stop offset="6%" style="stop-color:#ffffff"/>
<stop offset="94%" style="stop-color:#cccccc"/>
</linearGradient>
<linearGradient id="paper2__1"
x1="2221.489" y1="2247.835" x2="2221.489" y2="2200.4"
>
<stop offset="0%" style="stop-color:#ffffff"/>
<stop offset="100%" style="stop-color:#a8a8a8"/>
<stop offset="53%" style="stop-color:#c6c6c6"/>
<stop offset="100%" style="stop-color:#ffffff"/>
</linearGradient>
</defs>
<g> <!-- Layer: Layer 1 -->
<g style="fill: #000000; stroke: #000000; stroke-width: 1.6679; stroke-miterlimit: 4">
<path d="M1.626 120.976L93.918 120.976C93.918 120.976 101.021 96.011 100.59 67.324C100.314 48.942 101.285 38.413 101.285 38.413C101.285 38.413 103.092 17.147 108.374 1.024L15.665 1.024C15.665 1.024 9.132 21.317 8.993 41.054C8.854 60.792 7.881 81.779 7.881 81.779C7.881 81.779 4.128 114.582 1.626 120.976"/>
<!-- 0 5386.9761 -18786.4912 -123.1628 -35.3166 -5089.5731 19273.3152 Bc -->
<!-- 36.2128 -126.2882 -123.1628 -35.3166 297.403 486.824 Bm -->
<!-- 5386.9761 -18786.4912 -123.1628 -35.3166 333.6158 360.5358 Bc -->
<g style="fill: #000000">
<path d="M6.672 0.4C6.672 0.4 43.911 0.262 44.135 0.486C44.358 0.71 41.16 9.148 40.836 16.816C40.446 26.058 42.2 37.114 39.324 41.116C39.3 41.15 35.448 46.682 29.388 48.892C26.844 49.82 1.305 49.446 0.409 49.446C-0.487 49.446 2.047 44.891 2.928 38.109C3.936 30.353 3.293 20.089 3.36 16.276C3.468 10.12 6.112 0.512 6.672 0.4z"/>
<!-- 0 1 1 1 0 47.4356 43.049 0 149.9844 417.1768 Xm -->
<!-- -0.0001 1845.2501 43.049 0 149.9844 -1428.0732 Bc -->
<!-- 0 25.1409 43.049 0 149.9844 417.1768 Bm -->
<!-- 0 22.2947 43.049 0 149.9844 442.3179 Bm -->
<!-- -0.0001 1845.2501 43.049 0 149.9844 464.6123 Bc -->
</g>
<g style="fill: url(#Paper__1)">
<path d="M19.661 6.156L102.483 6.156C102.483 6.156 96.003 23.436 96.003 59.211C96.003 83.377 95.463 82.565 95.463 82.565C95.463 82.565 94.518 101.6 89.32 116.112L7.444 116.045C7.444 116.045 12.574 101.06 13.249 64.206C13.249 64.206 12.709 27.081 19.661 6.156z"/>
<g style="fill: url(#paper2__1)">
<path d="M1.848 48.244C1.848 48.244 5.428 40.664 4.98 22.972C4.708 12.228 5.47 9.265 7.572 1.696C7.592 1.623 39.532 1.374 42.564 1.481C43.169 1.502 39.544 7.984 39.376 18.062C39.208 28.139 40.62 36.472 38.136 38.956C36.959 40.133 33.128 40.416 31.224 40.36C30.889 40.351 29.55 47.347 26.364 47.92C24.638 48.231 3.468 48.46 1.848 48.244z"/>
<!-- 0 4.4684 -5.3252 -11.0378 -9.2619 185.5596 429.7686 Xm -->
<!-- 1824.46 -2174.2993 -11.0378 -9.2619 -1638.6323 2603.7485 Bc -->
<!-- 3.9322 -4.6862 -11.0378 -9.2619 185.8276 429.4492 Bm -->
<!-- 1824.46 -2174.2993 -11.0378 -9.2619 189.7598 424.7632 Bc -->
</g>
<g style="fill: url(#paper_5__1)">
<path d="M29.55 47.347C29.108 47.677 32.405 46.367 34.421 44.408C36.436 42.448 37.612 41.384 38.284 40.377C38.284 40.377 37.007 41.135 35.68 41.356C34.336 41.58 32.644 41.552 32.363 41.552C32.084 41.552 32.182 42.14 31.734 43.652C31.336 44.994 29.998 47.011 29.55 47.347z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -1201,7 +1201,7 @@ load_specific_image_svg (const char *path, guint size_in_pixels)
}
/* nominal vector icon is twice the size of nominal bitmap, so scale it down here */
result = rsvg_render_file (f, size_in_pixels *
(1.0 / (NAUTILUS_ICON_SIZE_STANDARD << 1)));
(1.0 / NAUTILUS_ICON_SIZE_STANDARD));
fclose (f);
return result;

View file

@ -30,13 +30,15 @@
#include <parser.h>
#include <xmlmemory.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libgnomevfs/gnome-vfs.h>
#include <gtk/gtkwindow.h>
#include "nautilus-file.h"
#include "nautilus-link.h"
#include "nautilus-metadata.h"
#include "nautilus-string.h"
#include "nautilus-xml-extensions.h"
#include "nautilus-glib-extensions.h"
#include "nautilus-global-preferences.h"
#include "nautilus-preferences.h"
@ -176,3 +178,110 @@ nautilus_link_set_remove (const char *directory_path, const char *link_set_name)
xmlFreeDoc (document);
}
/* utility to make a link set checkbox that installs and removes it's corresponding
link set when toggled */
static void
make_link_set_check_box(const char *directory_path, GtkWidget *checkbox_table, int index, char *name)
{
/* not yet implemented, coming soon */
g_message("make check box for directory %s, name %s", directory_path, name);
}
/* utility routine t o return a list of link set names by iterating the link set directory */
static GList *
get_link_set_names()
{
GnomeVFSResult result;
GnomeVFSFileInfo *current_file_info;
GnomeVFSDirectoryList *list;
char *link_set_uri, *link_set_name, *dot_pos;
GList *link_set_list;
link_set_list = NULL;
/* get a uri to the link set directory */
link_set_uri = g_strdup_printf ("file://%s/share/nautilus/linksets",
NAUTILUS_PREFIX);
/* get the directory info */
result = gnome_vfs_directory_list_load (&list, link_set_uri, GNOME_VFS_FILE_INFO_GETMIMETYPE, NULL, NULL);
if (result != GNOME_VFS_OK) {
return NULL;
}
/* build the list by iterating through the directory info */
for (current_file_info = gnome_vfs_directory_list_first(list); current_file_info != NULL;
current_file_info = gnome_vfs_directory_list_next(list)) {
link_set_name = g_strdup(current_file_info->name);
/* strip file type suffix */
dot_pos = strrchr(link_set_name, '.');
if (dot_pos)
*dot_pos = '\0';
link_set_list = g_list_prepend(link_set_list, link_set_name);
}
gnome_vfs_directory_list_destroy(list);
g_free(link_set_uri);
return link_set_list;
}
/* create a window used to configure the link sets in the passed in directory */
GtkWindow *
nautilus_link_set_configure_window(const char *directory_path)
{
char *title;
int link_set_count, index;
GtkWindow *window;
GtkWidget *checkbox_table, *scrolled_window;
GList *link_set_names, *current_link_set;
/* Create the window. */
window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
gtk_container_set_border_width (GTK_CONTAINER (window), GNOME_PAD);
gtk_window_set_policy (window, FALSE, FALSE, FALSE);
/* set the window title */
title = g_strdup_printf (_("Linksets for %s"), directory_path);
gtk_window_set_title (window, title);
g_free(title);
/* fetch the link set names */
link_set_names = get_link_set_names();
link_set_count = g_list_length(link_set_names);
/* allocate a table to hold the link set checkboxes */
checkbox_table = gtk_table_new ((link_set_count + 1) / 2, 2, TRUE);
gtk_widget_show (checkbox_table);
gtk_container_set_border_width (GTK_CONTAINER (checkbox_table), GNOME_PAD);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window),
checkbox_table);
gtk_container_add(GTK_CONTAINER(window), scrolled_window);
gtk_widget_show (scrolled_window);
/* iterate the directory to add a checkbox for each linkset found */
index = 0;
for (current_link_set = link_set_names; current_link_set != NULL;
current_link_set = current_link_set->next) {
make_link_set_check_box(directory_path, checkbox_table,
index++, (char*) current_link_set->data);
}
/* clean up and we're done */
nautilus_g_list_free_deep (link_set_names);
return window;
}

View file

@ -26,10 +26,12 @@
#define NAUTILUS_LINK_SET_H
#include <glib.h>
#include <gtk/gtkwindow.h>
gboolean nautilus_link_set_install (const char *directory_path,
const char *link_set_name);
void nautilus_link_set_remove (const char *directory_path,
const char *link_set_name);
gboolean nautilus_link_set_install (const char *directory_path,
const char *link_set_name);
void nautilus_link_set_remove (const char *directory_path,
const char *link_set_name);
GtkWindow *nautilus_link_set_configure_window(const char *directory_path);
#endif /* NAUTILUS_LINK_SET_H */

View file

@ -1201,7 +1201,7 @@ load_specific_image_svg (const char *path, guint size_in_pixels)
}
/* nominal vector icon is twice the size of nominal bitmap, so scale it down here */
result = rsvg_render_file (f, size_in_pixels *
(1.0 / (NAUTILUS_ICON_SIZE_STANDARD << 1)));
(1.0 / NAUTILUS_ICON_SIZE_STANDARD));
fclose (f);
return result;

View file

@ -30,13 +30,15 @@
#include <parser.h>
#include <xmlmemory.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libgnomevfs/gnome-vfs.h>
#include <gtk/gtkwindow.h>
#include "nautilus-file.h"
#include "nautilus-link.h"
#include "nautilus-metadata.h"
#include "nautilus-string.h"
#include "nautilus-xml-extensions.h"
#include "nautilus-glib-extensions.h"
#include "nautilus-global-preferences.h"
#include "nautilus-preferences.h"
@ -176,3 +178,110 @@ nautilus_link_set_remove (const char *directory_path, const char *link_set_name)
xmlFreeDoc (document);
}
/* utility to make a link set checkbox that installs and removes it's corresponding
link set when toggled */
static void
make_link_set_check_box(const char *directory_path, GtkWidget *checkbox_table, int index, char *name)
{
/* not yet implemented, coming soon */
g_message("make check box for directory %s, name %s", directory_path, name);
}
/* utility routine t o return a list of link set names by iterating the link set directory */
static GList *
get_link_set_names()
{
GnomeVFSResult result;
GnomeVFSFileInfo *current_file_info;
GnomeVFSDirectoryList *list;
char *link_set_uri, *link_set_name, *dot_pos;
GList *link_set_list;
link_set_list = NULL;
/* get a uri to the link set directory */
link_set_uri = g_strdup_printf ("file://%s/share/nautilus/linksets",
NAUTILUS_PREFIX);
/* get the directory info */
result = gnome_vfs_directory_list_load (&list, link_set_uri, GNOME_VFS_FILE_INFO_GETMIMETYPE, NULL, NULL);
if (result != GNOME_VFS_OK) {
return NULL;
}
/* build the list by iterating through the directory info */
for (current_file_info = gnome_vfs_directory_list_first(list); current_file_info != NULL;
current_file_info = gnome_vfs_directory_list_next(list)) {
link_set_name = g_strdup(current_file_info->name);
/* strip file type suffix */
dot_pos = strrchr(link_set_name, '.');
if (dot_pos)
*dot_pos = '\0';
link_set_list = g_list_prepend(link_set_list, link_set_name);
}
gnome_vfs_directory_list_destroy(list);
g_free(link_set_uri);
return link_set_list;
}
/* create a window used to configure the link sets in the passed in directory */
GtkWindow *
nautilus_link_set_configure_window(const char *directory_path)
{
char *title;
int link_set_count, index;
GtkWindow *window;
GtkWidget *checkbox_table, *scrolled_window;
GList *link_set_names, *current_link_set;
/* Create the window. */
window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
gtk_container_set_border_width (GTK_CONTAINER (window), GNOME_PAD);
gtk_window_set_policy (window, FALSE, FALSE, FALSE);
/* set the window title */
title = g_strdup_printf (_("Linksets for %s"), directory_path);
gtk_window_set_title (window, title);
g_free(title);
/* fetch the link set names */
link_set_names = get_link_set_names();
link_set_count = g_list_length(link_set_names);
/* allocate a table to hold the link set checkboxes */
checkbox_table = gtk_table_new ((link_set_count + 1) / 2, 2, TRUE);
gtk_widget_show (checkbox_table);
gtk_container_set_border_width (GTK_CONTAINER (checkbox_table), GNOME_PAD);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window),
checkbox_table);
gtk_container_add(GTK_CONTAINER(window), scrolled_window);
gtk_widget_show (scrolled_window);
/* iterate the directory to add a checkbox for each linkset found */
index = 0;
for (current_link_set = link_set_names; current_link_set != NULL;
current_link_set = current_link_set->next) {
make_link_set_check_box(directory_path, checkbox_table,
index++, (char*) current_link_set->data);
}
/* clean up and we're done */
nautilus_g_list_free_deep (link_set_names);
return window;
}

View file

@ -26,10 +26,12 @@
#define NAUTILUS_LINK_SET_H
#include <glib.h>
#include <gtk/gtkwindow.h>
gboolean nautilus_link_set_install (const char *directory_path,
const char *link_set_name);
void nautilus_link_set_remove (const char *directory_path,
const char *link_set_name);
gboolean nautilus_link_set_install (const char *directory_path,
const char *link_set_name);
void nautilus_link_set_remove (const char *directory_path,
const char *link_set_name);
GtkWindow *nautilus_link_set_configure_window(const char *directory_path);
#endif /* NAUTILUS_LINK_SET_H */

View file

@ -90,12 +90,12 @@ static void nautilus_sidebar_update_buttons (NautilusSidebar *sidebar);
static void add_command_buttons (NautilusSidebar *sidebar,
GList *application_list);
/* FIXME bug 1245: hardwired sizes */
#define DEFAULT_BACKGROUND_COLOR "rgb:DDDD/DDDD/FFFF"
#define DEFAULT_TAB_COLOR "rgb:9999/9999/9999"
/* FIXME bugzilla.eazel.com 1245: Hardcoded sizes? */
#define SIDEBAR_WIDTH 136
#define SIDEBAR_HEIGHT 400
#define SIDEBAR_MINIMUM_WIDTH 24
#define SIDEBAR_MINIMUM_HEIGHT 400
enum {
LOCATION_CHANGED,
@ -196,8 +196,8 @@ nautilus_sidebar_initialize (GtkObject *object)
sidebar->details = g_new0 (NautilusSidebarDetails, 1);
/* set the size of the sidebar */
gtk_widget_set_usize (widget, SIDEBAR_WIDTH, SIDEBAR_HEIGHT);
/* set the minimum size of the sidebar */
gtk_widget_set_usize (widget, SIDEBAR_MINIMUM_WIDTH, SIDEBAR_MINIMUM_HEIGHT);
/* create the container box */
sidebar->details->container = GTK_VBOX (gtk_vbox_new (FALSE, 0));

View file

@ -90,12 +90,12 @@ static void nautilus_sidebar_update_buttons (NautilusSidebar *sidebar);
static void add_command_buttons (NautilusSidebar *sidebar,
GList *application_list);
/* FIXME bug 1245: hardwired sizes */
#define DEFAULT_BACKGROUND_COLOR "rgb:DDDD/DDDD/FFFF"
#define DEFAULT_TAB_COLOR "rgb:9999/9999/9999"
/* FIXME bugzilla.eazel.com 1245: Hardcoded sizes? */
#define SIDEBAR_WIDTH 136
#define SIDEBAR_HEIGHT 400
#define SIDEBAR_MINIMUM_WIDTH 24
#define SIDEBAR_MINIMUM_HEIGHT 400
enum {
LOCATION_CHANGED,
@ -196,8 +196,8 @@ nautilus_sidebar_initialize (GtkObject *object)
sidebar->details = g_new0 (NautilusSidebarDetails, 1);
/* set the size of the sidebar */
gtk_widget_set_usize (widget, SIDEBAR_WIDTH, SIDEBAR_HEIGHT);
/* set the minimum size of the sidebar */
gtk_widget_set_usize (widget, SIDEBAR_MINIMUM_WIDTH, SIDEBAR_MINIMUM_HEIGHT);
/* create the container box */
sidebar->details->container = GTK_VBOX (gtk_vbox_new (FALSE, 0));