[Aptitude-svn-commit] r3605 - in branches/aptitude-0.3/aptitude: . doc/en

Daniel Burrows dburrows@costa.debian.org
Mon Jul 4 15:40:05 UTC 2005


Author: dburrows
Date: Mon Jul  4 15:40:02 2005
New Revision: 3605

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/doc/en/aptitude.xml
Log:
Document style configuration.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Mon Jul  4 15:40:02 2005
@@ -1,5 +1,10 @@
 2005-07-04  Daniel Burrows  <dburrows@debian.org>
 
+	* doc/en/aptitude.xml:
+
+	  Replace the documentation dealing with color configuration with
+	  documentation addressing style configuration.
+
 	* src/load_config.cc:
 
 	  Pass Value to parse_color, not Tag; setting colors in the

Modified: branches/aptitude-0.3/aptitude/doc/en/aptitude.xml
==============================================================================
--- branches/aptitude-0.3/aptitude/doc/en/aptitude.xml	(original)
+++ branches/aptitude-0.3/aptitude/doc/en/aptitude.xml	Mon Jul  4 15:40:02 2005
@@ -5678,97 +5678,211 @@
 	</informaltable>
       </section>
 
-      <section id='secColors'>
-	<title>Customizing colors</title>
+      <section id='secStyle'>
+	<title>Customizing text colors and styles</title>
 
 	<para>
-	  The colors &aptitude; uses to display various things on the
-	  screen can be customized to your liking.  To change the
-	  color of the user interface element
-	  <replaceable>elt</replaceable>, you set the configuration
-	  key
-	  <literal>Aptitude::UI::Colors::<replaceable>elt</replaceable></literal>
-	  to a group of two elements: the foreground color and the
-	  background color.  In other words, to make broken packages
-	  red-on-black instead of black-on-red, put this in the
-	  configuration file:
+	  The colors and visual styles used by &aptitude; to display
+	  text can be extensively customized.  Each visual element has
+	  an associated <quote>style</quote>, which describes the
+	  particular colors and visual attributes that will be used to
+	  display that element.  Styles take the form of a list of
+	  color and attribute settings.  This list is not necessarily
+	  exhaustive; if some colors or attributes are not explicitly
+	  specified, their values will be taken from the surrounding
+	  visual context.  In fact, most visual elements have an
+	  <quote>empty</quote> style by default.
 	</para>
 
-	<screen>Aptitude::UI::Colors::PkgBroken {red; black;};</screen>
+	<para>
+	  You can change the contents of a style by creating a
+	  configuration group of the same name in the &apt; or
+	  &aptitude; configuration file.  For instance, the
+	  <quote><literal>MenuBorder</literal></quote> style is used
+	  to draw the visual border around drop-down menus.  By
+	  default, this border is drawn bold and white-on-blue.
+	  Placing the following text in the configuration file would
+	  change it to white-on-cyan:
+	</para>
+
+	<screen>Aptitude::UI::Styles {
+  MenuBorder {fg white; bg cyan; set bold;};
+};</screen>
 
 	<para>
-	  The available colors are <literal>black</literal>,
+	  As you can see, a style's configuration group consists of a
+	  sequence of instructions.  The general classes of
+	  instructions are:
+	</para>
+
+	<variablelist>
+	  <varlistentry>
+	    <term><literal>fg</literal> <replaceable>color</replaceable></term>
+	    <listitem>
+	      <para>
+		Sets the text foreground to the given
+		<replaceable>color</replaceable>.  See below for a
+		list of the colors known to &aptitude;.
+	      </para>
+	    </listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><literal>bg</literal> <replaceable>color</replaceable></term>
+	    <listitem>
+	      <para>
+		Sets the text background to the given
+		<replaceable>color</replaceable>.  See below for a
+		list of the colors known to &aptitude;.
+	      </para>
+	    </listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><literal>set</literal> <replaceable>attribute</replaceable></term>
+
+	    <listitem>
+	      <para>
+		Enables the given text
+		<replaceable>attribute</replaceable>.  See below for a
+		list of the text attributes known to &aptitude;.
+	      </para>
+	    </listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><literal>clear</literal> <replaceable>attribute</replaceable></term>
+
+	    <listitem>
+	      <para>
+		Disables the given text
+		<replaceable>attribute</replaceable>.  See below for a
+		list of the text attributes known to &aptitude;.
+	      </para>
+	    </listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><literal>flip</literal> <replaceable>attribute</replaceable></term>
+
+	    <listitem>
+	      <para>
+		Toggles the given text
+		<replaceable>attribute</replaceable>: if it is enabled
+		in the surrounding element, it will be disabled, and
+		vice versa.  See below for a list of the text
+		attributes known to &aptitude;.
+	      </para>
+	    </listitem>
+	  </varlistentry>
+	</variablelist>
+
+	<para>
+	  The colors that &aptitude; recognizes are <literal>black</literal>,
 	  <literal>blue</literal>, <literal>cyan</literal>,
 	  <literal>green</literal>, <literal>magenta</literal>,
 	  <literal>red</literal>, <literal>white</literal>, and
 	  <literal>yellow</literal>
 	  <footnote>
 	    <para>
-	      Which becomes brown on some terminals when it is the
-	      background color.
+	      On some terminals, a <quote>yellow</quote> background
+	      will actually come out brown.
 	    </para>
-	  </footnote>
-	  .  You can cause the element to appear in bold text by
-	  placing <quote><literal>bold</literal></quote> in front of the foreground
-	  color; for instance, <literal>boldwhite</literal>.  Finally,
-	  you can enter integers, which will be directly used as text
-	  attributes.
+	  </footnote>.  The styles that &aptitude; recognizes are:
 	</para>
 
+	<variablelist>
+	  <varlistentry>
+	    <term><literal>blink</literal></term>
+	    <listitem>
+	      <para>
+		Enables blinking text.
+	      </para>
+	    </listitem>
+	  </varlistentry>
 
-	<para>
-	  Putting it all together, a simple, if extremely ugly,
-	  redefinition of some colors would look like this:
-	</para>
+	  <varlistentry>
+	    <term><literal>bold</literal></term>
+	    <listitem>
+	      <para>
+		Makes the foreground color of the text (or the
+		background if reverse video is enabled) brighter.
+	      </para>
+	    </listitem>
+	  </varlistentry>
 
-	<screen>Aptitude::UI::Colors {
-DefaultWidgetBackground {boldwhite; magenta;};
-ScreenStatusColor {green; cyan;};
-ScreenHeaderColor {red; yellow;};
-Progress {cyan; white;};
-};</screen>
+	  <varlistentry>
+	    <term><literal>dim</literal></term>
+	    <listitem>
+	      <para>
+		May cause text to be extra-dim on some terminals.  No
+		effect has been observed on common Linux terminals.
+	      </para>
+	    </listitem>
+	  </varlistentry>
 
-        <para>
-	  This would result in the following display:
-	</para>
+	  <varlistentry>
+	    <term><literal>reverse</literal></term>
+	    <listitem>
+	      <para>
+		Swaps the foreground and background colors.  Many
+		visual elements flip this attribute to perform common
+		highlighting tasks.
+	      </para>
+	    </listitem>
+	  </varlistentry>
 
-	<screenshot>
-	  <mediaobject>
-	    <imageobject>
-	      <imagedata fileref='images/colors-snapshot.png' format='PNG'/>
-	    </imageobject>
-
-	    <textobject>
-	      <phrase>
-		Too eye-watering for plain text.
-	      </phrase>
-	    </textobject>
+	  <varlistentry>
+	    <term><literal>standout</literal></term>
 
-	    <textobject role='text'>
+	    <listitem>
 	      <para>
-		Sadly, you are using a non-graphical viewer, and this
-		eye-watering display cannot be faithfully represented
-		in plain text.
+		This enables <quote>the best highlighting mode of the
+		terminal</quote>.  In xterms it is similar, but
+		not idential to, reverse video; behavior on other
+		terminals may vary.
 	      </para>
-	    </textobject>
-	  </mediaobject>
-	</screenshot>
+	    </listitem>
+	  </varlistentry>
+
+	  <varlistentry>
+	    <term><literal>underline</literal></term>
+
+	    <listitem>
+	      <para>
+		Enables underlined text.
+	      </para>
+	    </listitem>
+	  </varlistentry>
+	</variablelist>
+
+	<para>
+	  You can select several attributes at once by separating them
+	  with commas; for instance, <literal>set
+	  bold,standout;</literal>.
+	</para>
+
+	<note>
+	  <para>
+	    As hinted at above, the interpretation of both styles and
+	    text attributes is highly terminal-dependent.  You may
+	    need to experiment a bit to find out exactly what some
+	    settings do on your terminal.
+	  </para>
+	</note>
 
 	<para>
-	  The colors that can be customized are shown in <xref
-	  linkend='figColors'/>.  The default for each color is given
-	  as a pair
-	  <literal><replaceable>foreground</replaceable>,<replaceable>background</replaceable></literal>.
+	  The following styles can be customized in &aptitude;:
 	</para>
 
-	<figure id='figColors'>
-	  <title>Customizable colors in &aptitude;</title>
+	<figure id='figStyles'>
+	  <title>Customizable styles in &aptitude;</title>
 
 	  <informaltable>
 	    <tgroup cols='2'>
 	      <thead>
 		<row>
-		  <entry>Color</entry>
+		  <entry>Style</entry>
 		  <entry>Default</entry>
 		  <entry>Description</entry>
 		</row>
@@ -5777,129 +5891,174 @@
 	      <tbody>
 		<row>
 		  <entry>Bullet</entry>
-		  <entry><literal>yellow,black</literal></entry>
+		  <entry><literal>fg yellow; set bold;</literal></entry>
 		  <entry>
-		    The color used to display the bullets in bulleted
-		    lists.
+		    The style of the bullets in bulleted lists.
 		  </entry>
 		</row>
 
 		<row id='colorDefaultWidgetBackground'>
-		  <entry><literal>DefaultWidgetBackground</literal></entry>
-		  <entry><literal>white,black</literal></entry>
+		  <entry><literal>Default</literal></entry>
+		  <entry><literal>fg white; bg black;</literal></entry>
 		  <entry>
-		    The color used to draw blank areas of the screen,
-		    and the default color used to display text.
+		    The basic style of the screen.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>DepBroken</literal></entry>
-		  <entry><literal>black,red</literal></entry>
+		  <entry><literal>fg black; bg red;</literal></entry>
+		  <entry>
+		    The style of unfulfilled dependencies.
+		  </entry>
+		</row>
+
+		<row>
+		  <entry><literal>DisabledMenuEntry</literal></entry>
+		  <entry><literal>fg black; bg blue; set dim;</literal></entry>
 		  <entry>
-		    The color used to display unfulfilled dependencies.
+		    The style of menu entries that are disabled and
+		    cannot be used.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>DownloadHit</literal></entry>
-		  <entry><literal>black,green</literal></entry>
+		  <entry><literal>fg black; bg green;</literal></entry>
 		  <entry>
-		    The color used to indicate that a file was <quote>hit</quote>:
-		    ie, it was checked but is unchanged, so it won't
-		    be donloaded.
+		    The style used to indicate that a file was
+		    <quote>hit</quote>: i.e., it has not changed since
+		    the last time it was downloaded.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>DownloadProgress</literal></entry>
-		  <entry><literal>black,yellow</literal></entry>
+		  <entry><literal>fg blue; bg yellow;</literal></entry>
 		  <entry>
-		    The color used to display the progress indicator
-		    for a download.
+		    The style of the progress indicator for a
+		    download.
+		  </entry>
+		</row>
+
+		<row>
+		  <entry><literal>EditLine</literal></entry>
+		  <entry><literal>fg white; bg black; clear reverse;</literal></entry>
+		  <entry>
+		    The style of line editors (for instance, the entry
+		    in the <quote>Search</quote> dialog).
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>Error</literal></entry>
-		  <entry><literal>boldwhite,red</literal></entry>
-		  <entry>The color used to display error messages.</entry>
+		  <entry><literal>fg white; bg red; set bold;</literal></entry>
+		  <entry>The style of error messages.</entry>
+		</row>
+
+
+		<row>
+		  <entry><literal>Header</literal></entry>
+		  <entry><literal>fg white; bg blue; set bold;</literal></entry>
+		  <entry>
+		    The style of screen headers.
+		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>HighlightedMenuBar</literal></entry>
-		  <entry><literal>boldwhite,blue</literal></entry>
+		  <entry><literal>fg white; bg blue; set bold,reverse;</literal></entry>
 		  <entry>
-		    The color used to display the currently selected
-		    menu in the menu bar.
+		    The style of the currently selected menu name in
+		    the menu bar.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>HighlightedMenuEntry</literal></entry>
-		  <entry><literal>boldblue,white</literal></entry>
+		  <entry><literal>fg white; bg blue; set bold,reverse;</literal></entry>
 		  <entry>
-		    The color used to display the currently selected
-		    choice in a menu.
+		    The style of the currently selected choice in a
+		    menu.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>MediaChange</literal></entry>
-		  <entry><literal>boldyellow,red</literal></entry>
+		  <entry><literal>fg yellow; bg red; set bold;</literal></entry>
 		  <entry>
-		    The color used when asking the user to change CDs.
+		    The style of the dialog used to ask the user to
+		    insert a new CD.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>MenuBar</literal></entry>
-		  <entry><literal>boldblue,white</literal></entry>
+		  <entry><literal>fg white; bg blue; set bold;</literal></entry>
 
 		  <entry>
-		    The color used to display the menu bar.
+		    The style of the menu bar.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>MenuBorder</literal></entry>
-		  <entry><literal>boldwhite,blue</literal></entry>
+		  <entry><literal>fg white; bg blue; set bold;</literal></entry>
 		  <entry>
-		    The color used to draw borders around menus.
+		    The style of the borders that surround a drop-down
+		    menu.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>MenuEntry</literal></entry>
-		  <entry><literal>white,blue</literal></entry>
+		  <entry><literal>fg white; bg blue;</literal></entry>
 		  <entry>
-		    The color used to display the choices in a menu.
-		    This will be changed to boldface when drawing
-		    hotkeys.
+		    The style of each entry in a drop-down menu.
 		  </entry>
 		</row>
 
 		<row>
-		  <entry><literal>MineBombColor</literal></entry>
-		  <entry><literal>boldred,black</literal></entry>
+		  <entry><literal>MineBomb</literal></entry>
+		  <entry><literal>fg red; set bold;</literal></entry>
 		  <entry>
-		    The color used to display bombs in <link
+		    The style of bombs in <link
 		    linkend='secMinesweeper'>Minesweeper</link>.
 		  </entry>
 		</row>
 
 		<row>
-		  <entry><literal>MineFlagColor</literal></entry>
-		  <entry><literal>boldred,black</literal></entry>
+		  <entry><literal>MineBorder</literal></entry>
+		  <entry><literal>set bold;</literal></entry>
 		  <entry>
-		    The color used to display flags in <link
+		    The style of the border drawn around a <link
+		    linkend='secMinesweeper'>Minesweeper</link> board.
+		  </entry>
+		</row>
+
+		<row>
+		  <entry><literal>MineFlag</literal></entry>
+		  <entry><literal>fg red; set bold;</literal></entry>
+		  <entry>
+		    The style of flags in <link
 		    linkend='secMinesweeper'>Minesweeper</link>.
 		  </entry>
 		</row>
 
 		<row>
+		  <entry><literal>MineNumber</literal><replaceable>N</replaceable></entry>
+		  <entry>Various</entry>
+		  <entry>
+		    The style of the number
+		    <replaceable>N</replaceable> in Minesweeper;
+		    <replaceable>N</replaceable> may range from 0 to
+		    8.
+		  </entry>
+		</row>
+
+		<row>
 		  <entry><literal>MultiplexTab</literal></entry>
-		  <entry><literal>white, blue</literal></entry>
+		  <entry><literal>fg white; bg blue;</literal></entry>
 		  <entry>
 		    The color used to display <quote>tabs</quote>
 		    other than the currently selected one.
@@ -5908,7 +6067,7 @@
 
 		<row>
 		  <entry><literal>MultiplexTabHighlighted</literal></entry>
-		  <entry><literal>blue,white</literal></entry>
+		  <entry><literal>fg blue; bg white;</literal></entry>
 		  <entry>
 		    The color used to display the currently selected
 		    <quote>tab</quote>.
@@ -5917,77 +6076,87 @@
 
 		<row>
 		  <entry><literal>PkgBroken</literal></entry>
-		  <entry><literal>black,red</literal></entry>
+		  <entry><literal>fg black; bg red;</literal></entry>
 		  <entry>
-		    The color used to display packages which have
-		    unfulfilled dependencies.
+		    The style of packages in the package list which
+		    have unfulfilled dependencies.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>PkgToHold</literal></entry>
-		  <entry><literal>black,white</literal></entry>
+		  <entry><literal>fg black; bg white;</literal></entry>
 		  <entry>
-		    The color used to display packages which are <link
-		    linkend='pkgCmdHold'>on hold</link>.
+		    The style of packages in the package list which
+		    are <link linkend='pkgCmdHold'>on hold</link>.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>PkgToInstall</literal></entry>
-		  <entry><literal>black,green</literal></entry>
+		  <entry><literal>fg black; bg green;</literal></entry>
 		  <entry>
-		    The color used to display packages which are being
-		    <link linkend='pkgCmdInstall'>installed</link>
-		    (not upgraded) or <link
+		    The style of packages in the package list which
+		    are being <link
+		    linkend='pkgCmdInstall'>installed</link> (not
+		    upgraded) or <link
 		    linkend='pkgCmdReinstall'>reinstalled</link>.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>PkgToRemove</literal></entry>
-		  <entry><literal>black,magenta</literal></entry>
+		  <entry><literal>fg black; bg magenta;</literal></entry>
 		  <entry>
-		    The color used to display a package which will be
-		    <link linkend='pkgCmdRemove'>removed</link> or
-		    <link linkend='pkgCmdPurge'>purged</link>.
+		    The style of packages in the package list which
+		    will be <link
+		    linkend='pkgCmdRemove'>removed</link> or <link
+		    linkend='pkgCmdPurge'>purged</link>.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>PkgToUpgrade</literal></entry>
-		  <entry><literal>black,cyan</literal></entry>
+		  <entry><literal>fg black; bg cyan;</literal></entry>
 		  <entry>
-		    The color used to display a package which will be
-		    upgraded.
+		    The style of packages in the package list which
+		    will be upgraded.
 		  </entry>
 		</row>
 
 		<row>
 		  <entry><literal>Progress</literal></entry>
-		  <entry><literal>blue,yellow</literal></entry>
+		  <entry><literal>fg blue; bg yellow;</literal></entry>
 		  <entry>
-		    The color used to display progress indicators such
-		    as the one that appears while the package cache is
-		    being loaded.
+		    The style of progress indicators such as the one
+		    that appears while the package cache is being
+		    loaded.
 		  </entry>
 		</row>
 
-		<row>
-		  <entry><literal>ScreenHeaderColor</literal></entry>
+		<row id='colorScreenStatusColor'>
+		  <entry><literal>Status</literal></entry>
 		  <entry><literal>boldwhite,blue</literal></entry>
 		  <entry>
-		    The color used to display a screen header
-		    (information at the top of the screen).
+		    The style of status lines at the bottom of the
+		    screen.
 		  </entry>
 		</row>
 
-		<row id='colorScreenStatusColor'>
-		  <entry><literal>ScreenStatusColor</literal></entry>
-		  <entry><literal>boldwhite,blue</literal></entry>
+		<row id='colorTreeBackground'>
+		  <entry><literal>TreeBackground</literal></entry>
+		  <entry><literal></literal></entry>
+		  <entry>
+		    The basic color of all visual lists and trees.
+		  </entry>
+		</row>
+
+		<row id='colorTrustWarning'>
+		  <entry><literal>TrustWarning</literal></entry>
+		  <entry><literal>fg red; bg black; set bold;</literal></entry>
 		  <entry>
-		    The color used to display a status line at the
-		    bottom of the screen.
+		    The color used to display warnings about <link
+		    linkend='secTrust'>package trust</link>.
 		  </entry>
 		</row>
 	      </tbody>




More information about the Aptitude-svn-commit mailing list