MildenhallButtonDrawer

MildenhallButtonDrawer — Drawer provides a swipe-based side panel to provide a central location for navigation.

Functions

Properties

gboolean active Read / Write
enBackgroundState background-state Read / Write
gint64 current-state Read / Write
gfloat height Read
gchar * language Read / Write
GObject * model Read / Write
gboolean multi-state Read / Write
gboolean show-tooltip Read / Write
gfloat tooltip-width Read / Write
gboolean views-drawer Read / Write
gfloat width Read

Signals

void state-changed No Recursion
void swipe-end No Recursion

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── LightwoodButton
                ╰── MildenhallButtonDrawer

Implemented Interfaces

MildenhallButtonDrawer implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.

Description

MildenhallButtonDrawer widget can be positioned at any of the four edges of the content item. The drawer is then opened by "dragging" it from edges of the window. In general, it can be used as views drawer/menu's drawer. It also has an ability to show left and right arrows which can be configured using multi-state property. In addition, it provides tool-tip property using which the applications can show support text for the each menu item.

Freeing the widget

Call g_object_unref() to free the widget.

Sample C Code

1
2
3
4
5
6
7
8
9
10
11
GObject *object = NULL;
ThornburyItemFactory *item_factory = NULL;
MildenhallButtonSpeller *button = NULL;

item_factory = thornbury_item_factory_generate_widget_with_props (
     MILDENHALL_TYPE_BUTTON_DRAWER
     "/usr/Application/MyApp/share/mildenhall_button_speller_text_prop.json");

g_object_get (item_factory, "object", &object, NULL);
button = MILDENHALL_BUTTON_SPELLER (object);
clutter_actor_add_child (stage, CLUTTER_ACTOR (button));

Refer ThornburyItemFactory for Thornbury Item Factory details.

Functions

mildenhall_button_drawer_new ()

ClutterActor *
mildenhall_button_drawer_new (void);

Creates a drawer button object

Returns

Drawer button object.

[transfer full]


mildenhall_button_drawer_set_multi_state ()

void
mildenhall_button_drawer_set_multi_state
                               (MildenhallButtonDrawer *pButtonDrawer,
                                gboolean bState);

Set the multi state property as TRUE/FALSE. If multi state is set as TRUE, left/right arrows will be shown and swipe will get enabled to switch between states

Parameters

pObject

button drawer object reference

 

bMultiState

multi state as TRUE/FALSE

 

mildenhall_button_drawer_set_tooltip_width ()

void
mildenhall_button_drawer_set_tooltip_width
                               (MildenhallButtonDrawer *pButtonDrawer,
                                gfloat flWidth);

sets the tooltip width property for the tooltip rect. Tooltip should be enabled to set this property

Parameters

pButtonDrawer

button drawer object reference

 

flWidth

tooltip width

 

mildenhall_button_drawer_set_current_state ()

void
mildenhall_button_drawer_set_current_state
                               (MildenhallButtonDrawer *pButtonDrawer,
                                gint64 inState);

If button has multi-state, this function is used to change the state from one state to another

Parameters

pButtonDrawer

button drawer object reference

 

inState

current state of the button

 

mildenhall_button_drawer_set_model ()

void
mildenhall_button_drawer_set_model (MildenhallButtonDrawer *pButtonDrawer,
                                    ThornburyModel *pModel);

Model contains the data to be displayed on the butoon. Drawer button model contains: 1. icon image path 2. tooltip text If button has multi state, there should be more than one row with above mentioned columns

Parameters

pButtonDrawer

button drawer object reference

 

pModel

model for the button drawer

 

mildenhall_button_drawer_set_active ()

void
mildenhall_button_drawer_set_active (MildenhallButtonDrawer *pButtonDrawer,
                                     gboolean bState);

based on state, view will get changed: background and arrows

Parameters

pButtonDrawer

button drawer object reference

 

bState

whether drawer button is views drawer/menu drawer button

 

mildenhall_button_drawer_set_bg_state ()

void
mildenhall_button_drawer_set_bg_state (MildenhallButtonDrawer *pButtonDrawer,
                                       enBackgroundState state);

Drawer button has three states for background: open/normal/closed Based on background state, background view will get changed

Parameters

pButtonDrawer

button drawer object reference

 

bgState

background state

 

mildenhall_button_drawer_set_views_drawer ()

void
mildenhall_button_drawer_set_views_drawer
                               (MildenhallButtonDrawer *pButtonDrawer,
                                gboolean bState);

based on state, view will get changed: background and arrows

Parameters

pButtonDrawer

button drawer object reference

 

bState

whether drawer button is views drawer/menu drawer button

 

mildenhall_button_drawer_set_tooltip_show ()

void
mildenhall_button_drawer_set_tooltip_show
                               (MildenhallButtonDrawer *pButtonDrawer,
                                gboolean bState);

Based on state,tooltip wiil be shown or hidden. tooltip needs to be enabled to use this property

Parameters

pButtonDrawer

button drawer object reference

 

bShowState

tooltip show/hide state

 

mildenhall_button_drawer_set_tooltip_duration ()

void
mildenhall_button_drawer_set_tooltip_duration
                               (MildenhallButtonDrawer *pButtonDrawer,
                                gint inDuration);

duration to show tooltip

Parameters

pButtonDrawer

button drawer object reference

 

inTooltipDuration

tooltip duration

 

mildenhall_button_drawer_set_tooltip_direction ()

void
mildenhall_button_drawer_set_tooltip_direction
                               (MildenhallButtonDrawer *pButtonDrawer,
                                LightwoodTooltipDirection direction);

To which direction tooltip will be will be shown.

Parameters

pButtonDrawer

button drawer object reference

 

direction

tooltip direction as enum

 

mildenhall_button_drawer_set_tooltip_enabled ()

void
mildenhall_button_drawer_set_tooltip_enabled
                               (MildenhallButtonDrawer *pButtonDrawer,
                                gboolean bEnabled);

Whether tooltip is associated with the drawer button

Parameters

pButtonDrawer

button drawer object reference

 

bEnabled

enable/disable tooltip as TRUE/FALSE

 

mildenhall_button_drawer_set_language ()

void
mildenhall_button_drawer_set_language (MildenhallButtonDrawer *pButtonDrawer,
                                       gchar *pLanguage);

Function to update text on set language

Parameters

pButtonDrawer

button drawer object reference

 

pLanguage

language to be set

 

Returns

language to be set


mildenhall_button_drawer_get_width ()

gfloat
mildenhall_button_drawer_get_width (MildenhallButtonDrawer *pButtonDrawer);

Function to get the drawer button width

Parameters

pButtonDrawer

button drawer object reference

 

Returns

width of the drawer button


mildenhall_button_drawer_get_height ()

gfloat
mildenhall_button_drawer_get_height (MildenhallButtonDrawer *pButtonDrawer);

Function to get the drawer button height

Parameters

pButtonDrawer

button drawer object reference

 

Returns

height drawer button


mildenhall_button_drawer_get_multi_state ()

gboolean
mildenhall_button_drawer_get_multi_state
                               (MildenhallButtonDrawer *pButtonDrawer);

whether multi state is set or not

Parameters

pButtonDrawer

button drawer object reference

 

Returns

TRUE/FALSE


mildenhall_button_drawer_get_tooltip_width ()

gfloat
mildenhall_button_drawer_get_tooltip_width
                               (MildenhallButtonDrawer *pButtonDrawer);

Function to get the tooltip width

Parameters

pButtonDrawer

button drawer object reference

 

Returns

tooltip width


mildenhall_button_drawer_get_current_state ()

gint
mildenhall_button_drawer_get_current_state
                               (MildenhallButtonDrawer *pButtonDrawer);

To get the current state of the button. Useful if button has multi-state.

Parameters

pButtonDrawer

button drawer object reference

 

Returns

current state


mildenhall_button_drawer_get_model ()

ThornburyModel *
mildenhall_button_drawer_get_model (MildenhallButtonDrawer *pButtonDrawer);

To get the model having drawer button data

Parameters

pButtonDrawer

button drawer object reference

 

Returns

drawer button model


mildenhall_button_drawer_get_active ()

gboolean
mildenhall_button_drawer_get_active (MildenhallButtonDrawer *pButtonDrawer);

mildenhall_button_drawer_get_bg_state ()

enBackgroundState
mildenhall_button_drawer_get_bg_state (MildenhallButtonDrawer *pButtonDrawer);

Current background state of the drawer button

Parameters

pButtonDrawer

button drawer object reference

 

Returns

background state


mildenhall_button_drawer_get_views_drawer ()

gboolean
mildenhall_button_drawer_get_views_drawer
                               (MildenhallButtonDrawer *pButtonDrawer);

Whether button is for views rawer/menu drawer

Parameters

pButtonDrawer

button drawer object reference

 

Returns

TRUE/FALSE


mildenhall_button_drawer_get_tooltip_show ()

gboolean
mildenhall_button_drawer_get_tooltip_show
                               (MildenhallButtonDrawer *pButtonDrawer);

To get the tooltip-show property value

Parameters

pButtonDrawer

button drawer object reference

 

Returns

TRUE/FALSE

Types and Values

struct MildenhallButtonDrawer

struct MildenhallButtonDrawer;

The MildenhallButtonDrawer struct contains only private data.

Property Details

The “active” property

  “active”                   gboolean

Set reacticve property to TRUE to make button as inactive

Default: FALSE

Flags: Read / Write

Default value: FALSE


The “background-state” property

  “background-state”         enBackgroundState

background state for the drawer button to set the proper background images.

Flags: Read / Write

Default value: BG_NORMAL


The “current-state” property

  “current-state”            gint64

gives the current state of the button as state index Default: NULL

Flags: Read / Write

Allowed values: [-1,2147483647]

Default value: -1


The “height” property

  “height”                   gfloat

Height of the button.

Flags: Read

Allowed values: >= 0

Default value: 0


The “language” property

  “language”                 gchar *

set language Test gets updated

Flags: Read / Write

Default value: "en_US"


The “model” property

  “model”                    GObject *

model for the button states. If button model has more than one row, multi-state will get enabled and swipe feature will get enabled with left/right arrows

Model content: 1. icon-path, 2. tooltip-text

Default: NULL

Flags: Read / Write


The “multi-state” property

  “multi-state”              gboolean

Set this to TRUE to make it a multiple state button This will enable drag left and right on the button Default: FALSE

Flags: Read / Write

Default value: FALSE


The “show-tooltip” property

  “show-tooltip”             gboolean

Whether the tooltip should be shown.

Flags: Read / Write

Default value: FALSE


The “tooltip-width” property

  “tooltip-width”            gfloat

Width of the tooltip box. Height will be same as button height

Flags: Read / Write

Allowed values: >= 1

Default value: 100


The “views-drawer” property

  “views-drawer”             gboolean

Set this to TRUE to use style for views drawer button

Default: FALSE

Flags: Read / Write

Default value: FALSE


The “width” property

  “width”                    gfloat

Width of the button.

Flags: Read

Allowed values: >= 0

Default value: 0

Signal Details

The “state-changed” signal

void
user_function (MildenhallButtonDrawer *mildenhallButtonDrawer,
               gint                    oldState,
               gpointer                user_data)

::state-changed is emitted when button has multi-state and there is a change in the button state

Parameters

mildenhallButtonDrawer

The object which received the signal

 

oldState

name of the old state

 

newState

name of hte new state

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion


The “swipe-end” signal

void
user_function (MildenhallButtonDrawer *mildenhallButtonDrawer,
               LightwoodSwipeDirection LightwoodSwipeDirection,
               gpointer                user_data)

::wipe-end is emitted when button has a swipe action, based on multi-state property of the button swipe direction is calculated, If button is not a multi-state button, up/down swipe area will be wide.

Parameters

mildenhallButtonDrawer

The object which received the signal

 

LightwoodSwipeDirection

swipe direction

 

user_data

user data set when the signal handler was connected.

 

Flags: No Recursion

See Also

ClutterActor