[Approved] keepLook - a new GUI feature (1 Viewer)

ajp8164

Portal Pro
January 9, 2008
575
1,166
Atlanta, GA
Home Country
United States of America United States of America
This patch adds new capability to the button control. It provides the opportunity for a button to maintain its focused render state (look) even when navigation is moved away from the button. The controls for this feature are introduced through the navigation actions on the control (onleft, onright, onup, ondown). This implementation design allows for the skinner to allow a button to become focused and then maintain that focused look if navigation moves in a certain direction. Also, when (true) focus has moved from the button and the keepLook feature is engaged the button control will become dimmed according to the dimColor setting on the button. This feature has no effect on the focus logic for controls, it is a visual capability only.

To use this feature simply add the keepLook skin parameter to your button controls onleft, onright, onup, and/or ondown values as follows. The default value "no". You can use this feature on any combination of these actions.

<onright keepLook="yes">24</onright>

Example. A menu/submenu structure rendered with buttons. I have two columns of buttons, a left column and a right column. Consider the left column of buttons to be a menu from which you make a selection by navigating up and down. When the desired left column button is in focus (and it's look is perhaps different from the other buttons in the left column), the right column is rendered with a set of buttons that offer (sub-menu) choices based on the selected left column button. When you navigate from the left column to the right column the left column button will maintain it's render state (look) aiding in the usability of the interface (allows the user to have a good visual queue of the selected main-menu item). I have attached a few pictures of this scenario. In the first picture you see a button in the left column in focus (selected by the user). In the second picture you see that focus has moved from the left column to the right column; the render state of the button in the left column is maintained but dimmed. The skin xml for the left column button is below.

This patch is backward compatible; it does not affect existing skins or behavior. This patch affects GUIControl.cs and GUIControlButton.cs only. Even though the user may set keepLook on any control it will only have effect on a button control (it's the only control that is keepLook aware; others may extend this capability to other controls).

Code:
			<control>
				<description>codec settings</description>
				<type>button</type>
				<id>12</id>
				<label>Codecs</label>
				<!--
				<onfocus>Skin.SetString(SkinSettings,1)</onfocus>
				-->
				<onleft>12</onleft>
				<onright keepLook="yes">24</onright>
				<onup>11</onup>
				<ondown>13</ondown>
				<!-- start include: categoryButton -->
				<height>34</height>
				<width>220</width>
				<font>menu</font>
				<textcolor>#buttonTextColor</textcolor>
				<textalign>left</textalign>
				<textOffX>10</textOffX>
				<textOffY>4</textOffY>
				<textureFocus border="1" position="inside" colorKey="66FFFFFF">list-focus.png</textureFocus>
				<textureNoFocus>list-nofocus.png</textureNoFocus>
				<!-- end include: categoryButton -->
			</control>
attachment.php


attachment.php
 

Attachments

  • Picture 1.png
    Picture 1.png
    30.3 KB
  • Picture 2.png
    Picture 2.png
    29 KB
  • keep_look.patch
    30.6 KB

Users who are viewing this thread

Top Bottom