Blame hig/C/switches.page

Packit 1470ea
Packit 1470ea
      xmlns:uix="http://projectmallard.org/experimental/ui/"
Packit 1470ea
      type="topic"
Packit 1470ea
      id="switches">
Packit 1470ea
Packit 1470ea
  <info>
Packit 1470ea
    <credit type="author">
Packit 1470ea
      <name>Allan Day</name>
Packit 1470ea
      <email>aday@gnome.org</email>
Packit 1470ea
    </credit>
Packit 1470ea
Packit 1470ea
    <link type="guide" xref="ui-elements"/>
Packit 1470ea
    <uix:thumb mime="image/svg" src="figures/ui-elements/switches.svg"/>
Packit 1470ea
Packit 1470ea
    <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
Packit 1470ea
  </info>
Packit 1470ea
Packit 1470ea
<title>Switches</title>
Packit 1470ea
Packit 1470ea

A switch is a simple interface element which has an on and off state.

Packit 1470ea
Packit 1470ea
<media type="image" mime="image/svg" src="figures/ui-elements/switches.svg"/>
Packit 1470ea
Packit 1470ea
<section id="when-to-use">
Packit 1470ea
<title>When to use</title>
Packit 1470ea
Packit 1470ea

Switches should be used for controlling services or hardware that have a clear on/off logic. They are particularly appropriate when those services or hardware do not activate immediately (ie. there is a delay between the switch being operated and it having an effect), or when they affect the operation of the application in a significant way.

Packit 1470ea
Packit 1470ea

When the control does not turn a function on or off, or when a function does not clearly have an on/off nature, a <link xref="check-boxes">check box</link> is a more appropriate option. For example, an alarm might be controlled using a switch, since it can be turned on or off. However, a check box is a better choice for an option to repeat that alarm on a daily basis, since alarm repetition is a configuration option, rather than starting or stopping a particular piece of functionality.

Packit 1470ea
Packit 1470ea

When in doubt, use switches for important configuration options, and check boxes for minor sub-options.

Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="switch-labels">
Packit 1470ea
<title>Switch labels</title>
Packit 1470ea
Packit 1470ea

Switch labels should be written using <link xref="writing-style#capitalization">header capitalization</link>. The name of the function affected by the switch should be used as the label. <gui>Automatic Location</gui> or <gui>Notifications</gui> are examples of good switch labels.

Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
<section id="api-reference">
Packit 1470ea
<title>API reference</title>
Packit 1470ea
Packit 1470ea
<list>
Packit 1470ea
<item>

<link href="https://developer.gnome.org/gtk3/stable/GtkSwitch.html">GtkSwitch</link>

</item>
Packit 1470ea
</list>
Packit 1470ea
Packit 1470ea
</section>
Packit 1470ea
Packit 1470ea
</page>